更新进一步的问题(已解决)

更新进一步的问题(已解决)

我正在尝试编写一个List of Acronyms,并尝试弄清楚如何编辑\printacronyms列表的输出格式。我希望它们看起来如下所示,间距不必完全如下所示,但这是一般的想法。

为方便您查看,请参阅以下 MWE,谢谢

连字符样式

\documentclass{scrreprt}
\usepackage{acro}

% probably a good idea for the nomenclature entries:
%\acsetup{first-style=long}

% class `abbrev': abbreviations:
\DeclareAcronym{ny}{
  short = NY ,
  long  = New York ,
  class = abbrev
}
\DeclareAcronym{la}{
  short = LA ,
  long  = Los Angeles ,
  class = abbrev
}
\DeclareAcronym{un}{
  short = UN ,
  long  = United Nations ,
  class = abbrev
}

% class `nomencl': nomenclature
\DeclareAcronym{angelsperarea}{
  short = \ensuremath{a} ,
  long  = The number of angels per unit area ,
  sort  = a ,
  class = nomencl
}
\DeclareAcronym{numofangels}{
  short = \ensuremath{N} ,
  long  = The number of angels per needle point ,
  sort  = N ,
  class = nomencl
}
\DeclareAcronym{areaofneedle}{
  short = \ensuremath{A} ,
  long  = The area of the needle point ,
  sort  = A ,
  class = nomencl ,
  cite =  ,
}

\begin{document}

\ac{ny}, \ac{la} \ac{ny} and \ac{un} are abbreviations whereas
\ac{angelsperarea}, \ac{numofangels} and \ac{areaofneedle} are part of the
nomenclature

\printacronyms

\printacronyms[include-classes=nomencl,name=Nomenclature]

\end{document}

更新进一步的问题(已解决)

我已经实现了包装标签环境,它看起来很完美,但我想打印缩写词,无论我是否使用它们,所以我改变了\acsetup{list-type=acronyms,only-used=false}如下所示。问题是现在我在每个打印列表中最多只能得到 4 个首字母缩略词,这确实不是但是如果我只是这样做的话会发生什么\printacronyms。你能帮我解释一下吗?

请查看更新后的 MWE:

\documentclass{scrreprt}
\usepackage{acro}

% \DeclareAcronym{ny}{
% short = NY ,
% short-plural = ,
% long = New York ,
% long-plural = ,
% class = city ,
% cite = NewYork
% }

\DeclareAcronym{pwr}{
    short = PWR ,
    short-plural = s ,
    long = Pressurised Water Reactor ,
    long-plural = s ,
    class = reactors ,
}

\DeclareAcronym{ebr}{
    short = EBR-I ,
    short-plural =  ,
    long = Experimental Breeder Reactor I ,
    long-plural =  ,
    class = reac.exist ,
}

\DeclareAcronym{lwr}{
    short = LWR ,
    short-plural = s ,
    long = Light Water Reactor ,
    long-plural = s ,
    class = reactors ,
}

\DeclareAcronym{epr}{
    short = EPR ,
    short-plural =  ,
    long = European Pressurised Reactor ,
    long-plural =  ,
    class = reac.exist ,
}

\DeclareAcronym{candu}{
    short = CANDU ,
    short-plural =  ,
    long = CANada Deuterium Uranium ,
    long-plural =  ,
    class = reac.exist ,
}

\DeclareAcronym{acr}{
    short = ACR ,
    short-plural = s ,
    long = Advanced CANDU Reactor ,
    long-plural = s ,
    class = reactors ,
}

\DeclareAcronym{sfr}{
    short = SFR ,
    short-plural = s ,
    long = Sodium Fast Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{lfr}{
    short = LFR ,
    short-plural = s ,
    long = Lead Fast Reactor ,
    long-plural = s ,
    class = reactors ,
}

\DeclareAcronym{gfr}{
    short = GFR ,
    short-plural = s ,
    long = Gas Fast Reactors ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{msr}{
    short = MSR ,
    short-plural = s ,
    long = Molten Salt Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{scwr}{
    short = SCWR ,
    short-plural = s ,
    long = Supercritical Water Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{vhtr}{
    short = VHTR ,
    short-plural = s ,
    long = Very High Temperature Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{htgr}{
    short = HTGR ,
    short-plural = s ,
    long = High Temperature Gas cooled Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{htr}{
    short = HTR ,
    short-plural = s ,
    long = High Temperature Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{mhr}{
    short = GT-MHR ,
    short-plural = s ,
    long = Gas Turbine-Modular Helium Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{pmr}{
    short = PMR ,
    short-plural = s ,
    long = Prismatic Modular Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{pbmr}{
    short = PBMR ,
    short-plural = s ,
    long = Pebble Bed Modular Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{heu}{
    short = HEU ,
    short-plural =  ,
    long = High Enriched Uranium ,
    long-plural =  ,
    class = reac.term ,
}

\DeclareAcronym{leu}{
    short = LEU ,
    short-plural =  ,
    long = Low Enriched Uranium ,
    long-plural =  ,
    class = reac.term ,
}

\DeclareAcronym{pcs}{
    short = PCS ,
    short-plural = s ,
    long = Power Conversion System ,
    long-plural = s ,
    class = reac.term ,
}

\DeclareAcronym{ihx}{
    short = IHX ,
    short-plural = s ,
    long = Intermediate Heat Exchanger ,
    long-plural = s ,
    class = reac.term ,
}


\newenvironment{acronyms}
  {\labeling[~\dots]{myheadings}}
  {\endlabeling}

\acsetup{list-type=acronyms,only-used=false}

\begin{document}

\addchap*{List of Acronyms}
    \addcontentsline{toc}{section}{List of Acronyms}

    \printacronyms[include-classes=reactors,name=Reactor Types]
    \printacronyms[include-classes=reac.exist,name=Reactor Names]
    \printacronyms[include-classes=reac.term,name=Reactor Terms]


\end{document}

解决了

事实证明,在反应器的( )s中放置一个额外的元素会导致此错误。该类只是简单地调用。class name\printacronyms[include-classes=reactors,name=Reactor Types]reactor

答案1

您可以使用 KOMA-Script 的labeling环境作为底层列表环境。语法是

\begin{labeling}[<separator>]{<longest item>}
  \item[<item>] ...
  \item[<item>] ...
\end{labeling}

为了使用它,你必须将它包装在一个环境中没有参数并告诉acro与选项一起使用它list-type

\newenvironment{acronyms}
  {\labeling[--]{thelongestword}}
  {\endlabeling}
\acsetup{list-type=acronyms}

完整示例:

\documentclass{scrreprt}
\usepackage{acro}

% class `abbrev': abbreviations:
\DeclareAcronym{ny}{
  short = NY ,
  long  = New York ,
  class = abbrev
}
\DeclareAcronym{la}{
  short = LA ,
  long  = Los Angeles ,
  class = abbrev
}
\DeclareAcronym{un}{
  short = UN ,
  long  = United Nations ,
  class = abbrev
}

% class `nomencl': nomenclature
\DeclareAcronym{angelsperarea}{
  short = \ensuremath{a} ,
  long  = The number of angels per unit area ,
  sort  = a ,
  class = nomencl
}
\DeclareAcronym{numofangels}{
  short = \ensuremath{N} ,
  long  = The number of angels per needle point ,
  sort  = N ,
  class = nomencl
}
\DeclareAcronym{areaofneedle}{
  short = \ensuremath{A} ,
  long  = The area of the needle point ,
  sort  = A ,
  class = nomencl
}

\newenvironment{acronyms}
  {\labeling[--]{thelongestword}}
  {\endlabeling}
\acsetup{list-type=acronyms}

\begin{document}

\ac{ny}, \ac{la} \ac{ny} and \ac{un} are abbreviations whereas
\ac{angelsperarea}, \ac{numofangels} and \ac{areaofneedle} are part of the
nomenclature

\printacronyms[exclude-classes=nomencl]

\printacronyms[include-classes=nomencl,name=Nomenclature]

\end{document}

在此处输入图片描述

相关内容