whutug / whu-thesis

:memo: 武汉大学毕业论文 LaTeX 模版 2024
LaTeX Project Public License v1.3c
908 stars 200 forks source link

请问如何在图表索引结束后添加缩略语对照表 #214

Closed crml233 closed 1 year ago

crml233 commented 1 year ago

检查

编译环境

描述问题

最小工作示例(MWE)


%%% ---- 目录 ----- %%%
\cs_new_protected:Npn \__whu_make_contents:
  {
    \__whu_new_chapter_page:
    \tableofcontents
    \__whu_new_chapter_page:

    \bool_if:NT \g__whu_style_list_of_figures_bool
      {
        % \listoffigures 
         {%
         \let\oldnumberline\numberline%
         \renewcommand{\numberline}{\figurename~\oldnumberline}%
         \listoffigures%
         }
        \__whu_new_chapter_page:
      }

    \bool_if:NT \g__whu_style_list_of_tables_bool
      {
        % \listoftables
          {%
          \let\oldnumberline\numberline%
          \renewcommand{\numberline}{\tablename~\oldnumberline}%
          \listoftables%
          }
        \__whu_new_chapter_page:
      }

 }
     %% 缩略语表
  \RequirePackage{nomencl}
     \renewcommand{\nomname}{\makebox[\linewidth]{缩写、符号清单、术语表}}
    \newcommand{\nomdescr}[1]{
       \parbox[t]{8cm}{\raggedright\strut #1 \strut}
    }
     \newcommand{\nomdescrchn}[1]{
      \hfill\parbox[t]{4.5cm}{\strut #1 \strut}\ignorespaces
    }
     \newcommand{\nomchn}[4][]{
       \nomenclature[#1]{#2}{
           \nomdescr{#3}
           \nomdescrchn{#4}
       }
     }
     % 生成术语表
     \makenomenclature
\begin{document}
%%----------- 主体部分 ----------- %%
\nomchn{CCDCCD}{charge-coupled device charge-coupled device charge-coupled device}{电荷耦合器件电荷耦合器件电荷耦合器件}
\nomchn{CCD}{charge-coupled device}{电荷耦合器件}
\printnomenclature[10cm]
\include{pages/my/chapter1}
\end{document}

%(用 XeLaTeX 编译后)无缩略词索引表输出

链接

我还做了这些尝试

附件

SwitWu commented 1 year ago

你仔细阅读一下手册,第一次运行时会生成 .nlo 文件,然后需要使用 makeindex 程序生成 .nls 文件,命令行

makeindex ⟨filename⟩.nlo -s nomencl.ist -o ⟨filename⟩.nls

生成 .nls 后再用 xelatex 运行源代码。