diff --git a/BUPTBachelorThesis.sty b/BUPTBachelorThesis.sty index c0ae45c..d10a63d 100644 --- a/BUPTBachelorThesis.sty +++ b/BUPTBachelorThesis.sty @@ -168,6 +168,14 @@ pdfborder=001, linkcolor=black, citecolor=black, urlcolor=black]{hyperref} % % Appendix \usepackage{appendix} +% 定义新指令 \appendixsection,接受标题和标签名两个参数 +\newcommand{\appendixsection}[2]{ + \section*{#1} + \phantomsection + \hypertarget{#2}{} + \addcontentsline{toc}{section}{#1} +} + % Figure & Table \usepackage{graphicx} \usepackage{array,booktabs,multirow} % multirow, multicolumn and more professional format support diff --git a/README.md b/README.md index a288e4b..36e633d 100644 --- a/README.md +++ b/README.md @@ -117,4 +117,14 @@ latexmk main.tex 这是因为现在的`见`/`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 缩略语表} +``` diff --git a/appendix/appendix1.tex b/appendix/appendix1.tex index 129a5e4..ace023e 100644 --- a/appendix/appendix1.tex +++ b/appendix/appendix1.tex @@ -2,8 +2,7 @@ \begin{document} -\section*{附录1\quad{}缩略语表} -\phantomsection\addcontentsline{toc}{section}{附录1\quad{}缩略语表} +\appendixsection{附录1\quad 缩略语表}{appendix:abbr} \begin{table}[!htbp] \centering diff --git a/chapters/chapter2.tex b/chapters/chapter2.tex index 1d81c2b..400d54d 100644 --- a/chapters/chapter2.tex +++ b/chapters/chapter2.tex @@ -6,6 +6,8 @@ \section{国内外研究现状} +评论量含义见\hyperlink{appendix:abbr}{附录1\quad 缩略语表} + \section{毕业设计论文模板的功能与要求} \section{研究差距与挑战}