feat: appedix ref (#4)

This commit is contained in:
GuoChenxu 2025-04-14 01:00:53 +08:00 committed by GitHub
parent 61f6f7d045
commit 2c70110ac9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 2 deletions

View File

@ -168,6 +168,14 @@ pdfborder=001, linkcolor=black, citecolor=black, urlcolor=black]{hyperref} %
% Appendix % Appendix
\usepackage{appendix} \usepackage{appendix}
% 定义新指令 \appendixsection接受标题和标签名两个参数
\newcommand{\appendixsection}[2]{
\section*{#1}
\phantomsection
\hypertarget{#2}{}
\addcontentsline{toc}{section}{#1}
}
% Figure & Table % Figure & Table
\usepackage{graphicx} \usepackage{graphicx}
\usepackage{array,booktabs,multirow} % multirow, multicolumn and more professional format support \usepackage{array,booktabs,multirow} % multirow, multicolumn and more professional format support

View File

@ -117,4 +117,14 @@ latexmk main.tex
这是因为现在的`见`/`In`判断逻辑非常粗糙,是通过引用条目中是否存在`language`字段来判断的,所以文献文件`ref.bib`中的引用条目添加任意取值的`language`字段都会生成为`见`,因此引用英文文献就只能手动删除`language`字段以生成为`In`。 这是因为现在的`见`/`In`判断逻辑非常粗糙,是通过引用条目中是否存在`language`字段来判断的,所以文献文件`ref.bib`中的引用条目添加任意取值的`language`字段都会生成为`见`,因此引用英文文献就只能手动删除`language`字段以生成为`In`。
### 如何引用附录
在附录中使用指令`\appendixsection{}{}`创建标题第一个参数是附录标题第二个参数是引用label。在引用时使用指令`\hyperlink{}{}`第一个参数是引用label第二个参数是引用显示文本。举个栗子
```latex
appendix1.tex中
\appendixsection{附录1\quad 缩略语表}{appendix:abbr}
chapter2.tex中
评论量含义见\hyperlink{appendix:abbr}{附录1\quad 缩略语表}
```

View File

@ -2,8 +2,7 @@
\begin{document} \begin{document}
\section*{附录1\quad{}缩略语表} \appendixsection{附录1\quad 缩略语表}{appendix:abbr}
\phantomsection\addcontentsline{toc}{section}{附录1\quad{}缩略语表}
\begin{table}[!htbp] \begin{table}[!htbp]
\centering \centering

View File

@ -6,6 +6,8 @@
\section{国内外研究现状} \section{国内外研究现状}
评论量含义见\hyperlink{appendix:abbr}{附录1\quad 缩略语表}
\section{毕业设计论文模板的功能与要求} \section{毕业设计论文模板的功能与要求}
\section{研究差距与挑战} \section{研究差距与挑战}