Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复电子版和夜间模式论坛链接 #40

Merged
merged 4 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ jobs:
with:
root_file: TerrariaWiringTutorial_printed.tex
latexmk_use_xelatex: true
- name: Compile Night Mode
uses: xu-cheng/latex-action@v2
with:
root_file: TerrariaWiringTutorial_nightmode.tex
latexmk_use_xelatex: true
195 changes: 195 additions & 0 deletions chapters/comblogic.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
\chapter{代数理论}

目前代数理论可以用于解决组合逻辑与推广递次的电路压缩问题。本章内容面向有线性代数基础的读者。没有线性代数基础的读者需要预先学习向量、矩阵、线性方程组、行列式、秩的运算。群论基础对于本章内容的理解有帮助但是没有必要。

\section{域$\mathbb{Z}_2$简介}
把整数分成奇数和偶数,则有如下运算规律:
\begin{center}
\begin{tabular}{|c|cc|}
\hline
$+$&偶&奇\\\hline
偶&偶&奇\\
奇&奇&偶\\\hline
\end{tabular}
\begin{tabular}{|c|cc|}
\hline
$\times$&偶&奇\\\hline
偶&偶&偶\\
奇&偶&奇\\\hline
\end{tabular}
\end{center}

$\mathbb{Z}_2=\{0,1\}$表示整数除以2所得余数的集合,则0代表偶数,1代表奇数,0和1之间的加法和乘法运算遵守上述奇偶的运算规律,即
\begin{center}
\begin{tabular}{|c|cc|}
\hline
$+$&0&1\\\hline
0&0&1\\
1&1&0\\\hline
\end{tabular}
\begin{tabular}{|c|cc|}
\hline
$\times$&0&1\\\hline
0&0&0\\
1&0&1\\\hline
\end{tabular}
\end{center}

另外,定义除法为乘法的逆运算,即$0\div 1=0$、$1\div 1=1$,除数不能为0。定义减法为加法的逆运算,由于$\mathbb{Z}_2$中恰好有$1=-1$,减法和加法的运算规则完全一样。

加法和乘法满足交换律和结合律,乘法对加法满足分配律。

$\mathbb{Z}_2$上的乘法和加法可以很好地描述泰拉瑞亚电路逻辑,如\autoref{fig83}所示。把多根线接到同一个输出上,相当于做加法;与逻辑相当于多个输入做乘法。

\begin{figure}[!htp]
\centering
\subfloat[]{
\label{i350:351:2}
\adjincludegraphics{images/350.png}%
\quad%
\adjincludegraphics{images/351.png}
}%
\subfloat[]{
\label{i352:353:2}
\adjincludegraphics{images/352.png}%
\quad%
\adjincludegraphics{images/353.png}
}%
\caption{
\protect\subref{i350:351:2}加法:$B=A+C$;
\protect\subref{i352:353:2}乘法:$C=AB$。
}\label{fig83}
\end{figure}

\section{$\mathbb{Z}_2$上的线性代数}
通过定义$\mathbb{Z}_2$上的加减乘除就可以导出$\mathbb{Z}_2$上的线性代数,基本理论也和实/复数域上线性代数没有什么区别。唯一需要注意的是,$\mathbb{Z}_2$上的多项式环结构不同于实/复数域,所以相应的特征值理论有区别,这个区别将在后续小节中细说。本小节将侧重于解释为什么我们需要用到$\mathbb{Z}_2$上的线性代数。

$\mathbb{Z}_2$上的向量和矩阵在电路中有实际意义,因为接线的本质就是矩阵。

%\begin{example}{}{}
% 一个逻辑门上的普通逻辑灯状态可以排列成一个向量,亮对应$\mathbb{Z}_2$中的1,灭对应$\mathbb{Z}_2$中的0。
%\end{example}
\begin{example}{}{}
一个七段线显示器的状态可以表示成一个$\mathbb{Z}_2$上的7维向量。考虑如图所示的七段线显示结构,七个输入并不直接对应七段线。输入的状态表示为$\mathbf{x}=(x_1,\dots,x_7)$,七段线状态表示为$\mathbf{y}=(y_1,\dots,y_7)$。

\begin{center}
\begin{tikzpicture}[scale=0.5]
\draw[rounded corners, fill] (0,0) rectangle node[white] {$y_7$} (3,1);
\draw[rounded corners, fill] (0,1) rectangle node[white] {$y_5$} (-1,4);
\draw[rounded corners, fill] (3,1) rectangle node[white] {$y_6$} (4,4);
\draw[rounded corners, fill] (0,4) rectangle node[white] {$y_4$} (3,5);
\draw[rounded corners, fill] (0,5) rectangle node[white] {$y_2$} (-1,8);
\draw[rounded corners, fill] (3,5) rectangle node[white] {$y_3$} (4,8);
\draw[rounded corners, fill] (0,8) rectangle node[white] {$y_1$} (3,9);

\draw[red, ultra thick] (-0.25,3.75) -- (-0.25,0.75) -- (3.25,0.75) -- (3.25,3.75) -- (10,3.75) node[thmcoltext, anchor=west] {$x_5$};
\draw[cyan, ultra thick] (0.25,0.5) -- (3.5,0.5) -- (3.5,3.5) -- (3.5,3.0) -- (10,3.0) node[thmcoltext, anchor=west] {$x_6$};
\draw[green, ultra thick] (3.75,1.25) -- (3.75,3.5) -- (3.75,2.25) -- (10,2.25) node[thmcoltext, anchor=west] {$x_7$};

\draw[red, ultra thick] (-0.25,5.25) -- (-0.25,8.25) -- (3.25,8.25) -- (3.25,5.25) -- (10,5.25) node[thmcoltext, anchor=west] {$x_3$};
\draw[cyan, ultra thick] (0.25,8.5) -- (3.5,8.5) -- (3.5,5.5) -- (3.5,6) -- (10,6) node[thmcoltext, anchor=west] {$x_2$};
\draw[green, ultra thick] (3.75,7.75) -- (3.75,5.5) -- (3.75,6.75) -- (10,6.75) node[thmcoltext, anchor=west] {$x_1$};

\draw[brown, ultra thick] (-0.5,1.25) -- (-0.5,7.75);
\draw[brown, ultra thick] (-0.5,4.5) -- (10,4.5) node[thmcoltext, anchor=west] {$x_4$};
\end{tikzpicture}
\end{center}

七个输入和七段线的对应关系可以用一个矩阵表示:

\[\begin{array}{c|ccccccc}
& y_1 & y_2 & y_3 & y_4 & y_5 & y_6 & y_7 \\\hline
x_1 & & & 1 & & & & \\
x_2 & 1 & & 1 & & & & \\
x_3 & 1 & 1 & 1 & & & & \\
x_4 & & 1 & & 1 & 1 & & \\
x_5 & & & & & 1 & 1 & 1 \\
x_6 & & & & & & 1 & 1 \\
x_7 & & & & & & 1 & \\\hline
\end{array}\]

%表格中每行表示一个输入覆盖的段,可以理解为一个7维行向量;每列表示经过一个分段的输入,可以理解为一个7维列向量。去掉表头,这个表格就是一个$\mathbb{Z}_2$上的$7\times 7$\myind{矩阵},记为$\mathbf{A}$。

%一个分段的值等于经过它的输入的和,例如$y_3=x_1+x_2+x_3$。这可以写成$y_3=1x_1+1x_2+1x_3+0x_4+0x_5+0x_6+0x_7$,即$y_3$是输入$\mathbf{x}$和矩阵中对应列向量的\myind{向量积}:

%\[
% y_3=\mathbf{x}(1,1,1,0,0,0,0)^\top,
%\]
记这个矩阵为$\mathbf{A}^\top$,七段线的初始状态为$\mathbf{b}$,则分段与输入的关系可以表示为$\mathbf{y}=\mathbf{A}\mathbf{x}+\mathbf{b}$.

\end{example}

一般的组合逻辑可以看作集合。
\begin{definition}{}{}
$n$输入的组合逻辑和$\mathbb{Z}_2^n$的子集存在一一对应关系。设某逻辑为$n$元函数$f$,则相应的集合为$f^{-1}(1)=\{\mathbf{v}\in\mathbb{Z}_2^n:f(\mathbf{v})=1\}$,这个集合称为$f$的\emph{特征集}。一个组合逻辑的输入数称为该逻辑的\emph{维数},特征集的秩称为该逻辑的\emph{秩}。
\end{definition}
\begin{example}{}{}
$n$维异或逻辑的特征集是$\mathbb{Z}_2^n$的标准基。
\end{example}
\begin{theorem}{TNoName \& putianyi888}{}
假设某$n$维组合逻辑可以用单异或门实现,则该异或门的最优灯数不超过$n+1$。
\end{theorem}
\begin{proof}
用$V=\mathbb{Z}_2^n$表示输入空间,$U=\mathbb{Z}_2^m$表示灯的状态空间。用矩阵$\boldsymbol{L}\in\mathbb{Z}_2^{m\times n}$表示接线,向量$\boldsymbol{b}\in U$表示灯的初始状态,则$L:V\to U, \boldsymbol{v}\mapsto \boldsymbol{L}\boldsymbol{v}+\boldsymbol{b}$表示从输入到灯的状态的映射。设某$n$维逻辑为$f:V\to\mathbb{Z}_2$,实现该逻辑的异或门为$g:U\to \mathbb{Z}_2^n$。假设$m>n+1$。

先考虑齐次情况$\boldsymbol{b}=\boldsymbol{0}$。由于$\dim(V)=n$,$L(V)$是$U$的一个$n'\le n$维线性子空间。因为$m>n+1\ge n'+1$,取$U/L(V)$的一组基$\boldsymbol{A}=(\boldsymbol{\alpha}_1,\dots,\boldsymbol{\alpha}_{m-n'})$。由于$g$是异或逻辑,$g^{-1}(1)$是$U$的标准基,且$L(f^{-1}(1))=g^{-1}(1)\cap L(V)$。记$L(f^{-1}(1))$为$\boldsymbol{B}=(\boldsymbol{\beta}_1,\dots,\boldsymbol{\beta}_r)$,取$L(V)/\spanspace(L(f^{-1}))$的一组基$\boldsymbol{C}=(\boldsymbol{\gamma}_1,\dots,\boldsymbol{\gamma}_{n'-r})$。显然$(\boldsymbol{B}|\boldsymbol{C}|\boldsymbol{A})$是$U$的一组基。

构造$U$的另一组基$\boldsymbol{F}=(\boldsymbol{B}|\boldsymbol{C}+\boldsymbol{\alpha}_1|\boldsymbol{A})$,其中$\boldsymbol{C}+\boldsymbol{\alpha}_1$表示将$\boldsymbol{\alpha}_1$加到$\boldsymbol{C}$的每一列上。记$F^{-1}:\boldsymbol{v}\mapsto\boldsymbol{F}^{-1}\boldsymbol{v}$是将$\boldsymbol{F}$映到标准基的线性映射。考虑复合映射$F^{-1}L$,有
\begin{enumerate}
\item 当$\boldsymbol{v}\in f^{-1}(1)$时,$L(\boldsymbol{v})\in\boldsymbol{B}$,从而$F^{-1}L(\boldsymbol{v})$是一个标准基向量。
\item 当$\boldsymbol{v}\in V\backslash f^{-1}(1)$时,$L(\boldsymbol{v})\notin\boldsymbol{F}$,从而$F^{-1}L(\boldsymbol{v})$不是一个标准基向量。
\item 当$\boldsymbol{v}\in V$时,$L(\boldsymbol{v})\in\spanspace(\boldsymbol{B}|\boldsymbol{C})\subseteq\spanspace(\boldsymbol{B}|\boldsymbol{C}+\boldsymbol{\alpha}_1|\boldsymbol{\alpha}_1)$,从而$F^{-1}L(\boldsymbol{v})$的后$(m-n'-1)$个分量为0。
\end{enumerate}
综上三条性质,接线$F^{-1}L$与$L$对于异或门是等价逻辑,且在接线$F^{-1}L$的情况下,异或门的后$(m-n'-1)$个灯恒灭,所以这些灯可以去掉,剩下$(n'+1)$个灯。

对于非齐次情况$\boldsymbol{b}\ne\boldsymbol{0}$,如果$\boldsymbol{b}\in \boldsymbol{L}V$,那么$L(V)=\boldsymbol{L}V$,退化为齐次情况。如果$L(V)\cap g^{-1}(1)=\emptyset$,则$f(V)=\{0\}$,退化为平凡逻辑。

一般地,取$\boldsymbol{b}'\in L(V)\cap g^{-1}(1)$,那么$L(V)=\boldsymbol{L}V+\boldsymbol{b}'$。
\end{proof}

\section{$\mathbb{Z}_2$上的多项式}


% \section{向量与矩阵}
% $\mathbb{Z}_2$上的向量即为一组有序的$\mathbb{Z}_2$元素。向量组成向量空间。





% \begin{definition}{}{}
% $\mathbb{Z}_2^n=\{(x_1,\dots,x_n): x_k\in\mathbb{Z}_2\}$是$\mathbb{Z}_2$上的$n$维向量空间。$\mathbb{Z}_2^n$中的元素是$\mathbb{Z}_2$上的$n$维向量。
% \end{definition}

% 向量的加减法定义为对应元素加减:
% \[
% (x_1,\dots,x_n) + (y_1,\dots,y_n) = (x_1+y_1,\dots,x_n+y_n).
% \]

% 数字乘向量定义为用数字乘向量中的每个元素:
% \[
% \lambda(x_1,\dots,x_n) = (\lambda x_1,\dots,\lambda x_n).
% \]
% 由于$\mathbb{Z}_2$中仅有0和1两个数字,所以向量的数乘可以列举为
% \[
% 1\mathbf{x}=\mathbf{x},\qquad 0\mathbf{x}=\mathbf{0},
% \]
% 其中粗体小写字母表示向量,$\mathbf{0}$表示零向量,即向量中所有元素都是0。



% $\mathbb{Z}_2$元素也可以有序地组成矩阵。矩阵组成矩阵空间。
% \begin{definition}
% $\mathbb{Z}_2^{m\times n}=\left\{\begin{pmatrix}
% x_{11}&x_{12}&\cdots&x_{1n}\\
% x_{21}&x_{22}&\cdots&x_{2n}\\
% \vdots&\vdots&\ddots&\vdots\\
% x_{m1}&x_{m2}&\cdots&x_{mn}
% \end{pmatrix}: x_{jk}\in\mathbb{Z}_2\right\}$是$\mathbb{Z}_2$上的$m\times n$维矩阵空间。$\mathbb{Z}_2^{m\times n}$中的元素是$\mathbb{Z}_2$上的$m\times n$维矩阵。
% \end{definition}

% 矩阵也可以看作向量的向量。一个$m\times n$维矩阵既可以理解为由$m$个$n$维行向量组成的列向量也可以理解为由$n$个$m$维列向量组成的行向量。$n$维行向量也可以看作$1\times n$维矩阵,$m$维列向量也可以看作$m\times 1$维矩阵。

% 按照向量加减法与数乘的定义,矩阵加减法也定义成对应元素加减,矩阵数乘也定义成用数字乘矩阵中的每个元素。

% 矩阵一般用粗体大写字母表示。零矩阵用$\mathbf{O}$表示。
63 changes: 63 additions & 0 deletions chapters/latexreference.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
\chapter{文档开发引导}

本文档使用\LaTeX 编写,在TeXLive 2022环境下编译。为了便于开发,文档导言区定义了一些命令与变量,本附录即为这些功能的文档。

\section{三种排版主题}

本文档支持三种排版主题。优先保证电子版外观。

\begin{itemize}
\item 打印版的文本内容最多。打印版不能用文本搜索功能,所以添加了索引;打印版不能点击超链接,所以链接均为明文。打印版的排版是针对双面打印的,页边距较宽,奇偶页边距不同。打印版通过编译\trvar{TerrariaWiringTutorial\_printed.tex}生成。
\item 电子版用于在电子屏幕上浏览。电子版的超链接地址全部隐藏用于节省空间,网站logo尽量采用小图标,页边距较窄,上下页边距极窄,便于电脑/手机浏览。电子版通过编译\trvar{TerrariaWiringTutorial\_onscreen.tex}生成。
\item 夜间模式是暗色主题的电子版,用于在低亮度环境下浏览。夜间模式通过编译\trvar{TerrariaWiringTutorial\_nightmode.tex}生成。
\end{itemize}

\section{格式标准}

\subsection{插图}
插图使用\lstinline{adjustbox}宏包的\lstinline{\adjincludegraphics}

\section{预设颜色}

预设颜色定义在\trvar{preambles/skin.tex}中。

\begin{longtable}{|c|c|}
\hline
名称 & 描述 \\\hline
\endhead
\textcolor{bilibiliblue}{bilibiliblue} & 哔哩哔哩蓝 \\\hline
\textcolor{youkudeeppink}{youkudeeppink} & 优酷logo最深的粉色 \\\hline
\textcolor{terrariaforumback}{terrariaforumback} & 泰拉瑞亚官方论坛背景 \\\hline
\textcolor{terrariaforumtext}{terrariaforumtext} & 泰拉瑞亚官方论坛文本 \\\hline
\textcolor{bbstrback}{bbstrback} & 泰拉瑞亚中文论坛背景 \\\hline
\textcolor{bbstrtext}{bbstrtext} & 泰拉瑞亚中文论坛文本 \\\hline
\makecell{
\textcolor{redwiredarkborder}{redwiredarkborder}\\
\textcolor{redwirelightborder}{redwirelightborder}\\
\textcolor{redwirelight}{redwirelight}\\
\textcolor{redwiremiddle}{redwiremiddle}\\
\textcolor{redwiredark}{redwiredark}
} & 红色电线配色 \\\hline
\makecell{
\textcolor{bluewiredarkborder}{bluewiredarkborder}\\
\textcolor{bluewirelightborder}{bluewirelightborder}\\
\textcolor{bluewirelight}{bluewirelight}\\
\textcolor{bluewiremiddle}{bluewiremiddle}\\
\textcolor{bluewiredark}{bluewiredark}
} & 蓝色电线配色 \\\hline
\makecell{
\textcolor{greenwiredarkborder}{greenwiredarkborder}\\
\textcolor{greenwirelightborder}{greenwirelightborder}\\
\textcolor{greenwirelight}{greenwirelight}\\
\textcolor{greenwiremiddle}{greenwiremiddle}\\
\textcolor{greenwiredark}{greenwiredark}
} & 绿色电线配色 \\\hline
\makecell{
\textcolor{yellowwiredarkborder}{yellowwiredarkborder}\\
\textcolor{yellowwirelightborder}{yellowwirelightborder}\\
\textcolor{yellowwirelight}{yellowwirelight}\\
\textcolor{yellowwiremiddle}{yellowwiremiddle}\\
\textcolor{yellowwiredark}{yellowwiredark}
} & 黄色电线配色 \\\hline
\textcolor{thmcolback}{thmcolback} & 定理类环境背景\\\hline
\end{longtable}
8 changes: 8 additions & 0 deletions chapters/peopleandcommunity.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
\chapter{重要的玩家与社区}

\begin{longtable}{|c|c|c|c|c|c|}
\hline
代号 & \adjustimage{height=12pt, align=c}{figure/tmec.png} & \adjustimage{height=12pt, align=c}{figure/discordcommunity.png} & \adjustimage{height=12pt, align=c}{figure/bbstr.png} & \adjustimage{height=12pt, align=c}{figure/qqcommunity.png} & \adjustimage{height=12pt, align=c}{figure/tiebacommunity.jpg}\\\hline
\endhead
putianyi888 & \href{https://forums.terraria.org/index.php?members/121300}{\small\sffamily putianyi888} & \vipbox{figure/putianyi888.jpg}{putianyi888}{} & \href{}{}
\end{longtable}
2 changes: 1 addition & 1 deletion labels used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fig1, fig2, fig3, fig4, fig5, fig6, fig7, fig8, fig9, fig10,
fig51, fig52, fig53, fig54, fig55, fig56, fig57, fig58, fig59, fig60,
fig61, fig62, fig63, fig64, fig65, fig66, fig67, fig68, fig69, fig70,
fig71, fig72, fig73, fig74, fig75, fig76, fig77, fig78, fig79, fig80,
fig81, fig82,
fig81, fig82, fig83
tab1, tab2, tab3, tab4, tab5, tab6, tab7, tab8, tab9, tab10,
tab11, tab12, tab13, tab14, tab15, tab16, tab17, tab18
tab1406,
Expand Down
3 changes: 2 additions & 1 deletion main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
\include{chapters/Sources}
%\include{chapters/chapter8}
\include{chapters/chapter5}
%\include{chapters/comblogic}
%\include{chapters/Farm}

\appendix
Expand All @@ -70,4 +71,4 @@
\include{chapters/cooldown}
\include{chapters/knowledge}
\include{chapters/chapter6}

%\include{chapters/latexreference}
10 changes: 10 additions & 0 deletions preambles/envs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@
fonttitle=\bfseries,
blueframe
}{}
\newtcbtheorem{definition}{定义}{
breakable,
colframe=greencolframe, colback=thmcolback, coltext=thmcoltext,
skin=enhanced,
parbox=false,
sharp corners=all,
before title={\noindent},
fonttitle=\bfseries,
greenframe
}{}
\newtcbtheorem{problem}{思考题}{
breakable,
colframe=yellowcolframe, colback=thmcolback, coltext=thmcoltext,
Expand Down
9 changes: 7 additions & 2 deletions preambles/temps.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

\usepackage{tcolorbox}
\usepackage{calc}
\usepackage{amsbsy}

% 数学符号
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\spanspace}{span}

% 网址链接
\if\rendermode1
\NewDocumentCommand{\myhref}{mm}{\href{#1}{#2}}

\NewDocumentCommand{\bilibili}{O{video}m}{\href{https://www.bilibili.com/#1/#2}{\includegraphics[align=c, height=9pt]{figure/bilibiliicon.pdf}}}
\newcommand{\youtube}[1]{\href{https://youtu.be/#1}{\includegraphics[align=c, height=9pt]{figure/youtubeicon.pdf}}}
\NewDocumentCommand{\trforum}{O{threads}m}{\href{https://forums.terraria.org/index.php?/#1/#2}{\includegraphics[align=c, height=9pt]{figure/terrariaforum.png}}}
\NewDocumentCommand{\trforum}{O{threads}m}{\href{https://forums.terraria.org/index.php?#1/#2}{\includegraphics[align=c, height=9pt]{figure/terrariaforum.png}}}
\newcommand{\tieba}[1]{\href{https://tieba.baidu.com/p/#1}{\includegraphics[align=c, height=9pt]{figure/tieba.png}}}
\NewDocumentCommand{\bbstr}{O{t}m}{\href{https://www.bbstr.net/#1/#2}{\includegraphics[align=c, height=9pt]{figure/bbstr.png}}}
\NewDocumentCommand{\github}{m}{\href{https://github.com/#1}{\includegraphics[align=c, height=9pt]{figure/githubicon.pdf}}}
Expand All @@ -29,7 +34,7 @@

\NewDocumentCommand{\bilibili}{O{video}m}{\href{https://www.bilibili.com/#1/#2}{\includegraphics[align=c, height=9pt]{figure/bilibiliicon.pdf}}}
\newcommand{\youtube}[1]{\href{https://youtu.be/#1}{\includegraphics[align=c, height=9pt]{figure/youtubeicon.pdf}}}
\NewDocumentCommand{\trforum}{O{threads}m}{\href{https://forums.terraria.org/index.php?/#1/#2}{\includegraphics[align=c, height=9pt]{figure/terrariaforum.png}}}
\NewDocumentCommand{\trforum}{O{threads}m}{\href{https://forums.terraria.org/index.php?#1/#2}{\includegraphics[align=c, height=9pt]{figure/terrariaforum.png}}}
\newcommand{\tieba}[1]{\href{https://tieba.baidu.com/p/#1}{\includegraphics[align=c, height=9pt]{figure/tieba.png}}}
\NewDocumentCommand{\bbstr}{O{t}m}{\href{https://www.bbstr.net/#1/#2}{\includegraphics[align=c, height=9pt]{figure/bbstr.png}}}
\NewDocumentCommand{\github}{m}{\href{https://github.com/#1}{\includegraphics[align=c, height=9pt]{figure/githubiconnight.png}}}
Expand Down