在每列上方添加列描述(缩写、首字母缩略词列表)

在每列上方添加列描述(缩写、首字母缩略词列表)

谢谢https://tex.stackexchange.com/a/253466/188437以及acro packagehttps://mirror.informatik.hs-fulda.de/tex-archive/macros/latex/contrib/acro/acro_en.pdf)我得到了以下缩写列表:

在此处输入图片描述

然而我必须在每列上方添加列描述, 像这样: 在此处输入图片描述

意思是我想在其他条目上方以粗体添加“Abkürzung”和“Erläuterung”。有人知道怎么做吗?提前谢谢大家!

\documentclass[12pt]{report}

\usepackage{acro}
\usepackage{enumitem}

\newlength\myitemwidth
\setlength\myitemwidth{5em}

\newlist{listabbrev}{description}{1}
\setlist[listabbrev]{
    labelindent = 0pt,
    labelsep    = 0pt,
    leftmargin  = \myitemwidth,
    labelwidth  = \myitemwidth,
    format      = \normalfont
    }

\DeclareAcroListStyle{styleabbrev}{list}{list = listabbrev}

\acsetup{list-style = styleabbrev,
         list-heading = chapter*,
         list-name = Abkürzungen
         }

\DeclareAcronym{EEG}{
  short = EEG,
  long  = Erneuerbare-Energien-Gesetz,
}

\DeclareAcronym{dbms}{
  short = DBMS,
  long  = Database Management System,
}

\begin{document}

\printacronyms
\acuseall

\end{document}

答案1

在 thymaro 的帮助下我得到了想要的结果:

\documentclass[12pt]{report}
\usepackage{acro}
\usepackage{enumitem}

\newlength\myitemwidth
\setlength\myitemwidth{114pt}

\newlist{listabbrev}{description}{1}
\setlist[listabbrev]{
    labelindent = 0pt,
    labelsep    = 0pt,
    itemsep     = -2pt plus .2pt,
    leftmargin  = \myitemwidth,
    labelwidth  = \myitemwidth,
    format      = \normalfont
    }

\DeclareAcroListStyle{styleabbrev}{list}{list = listabbrev}

\acsetup{list-style   = styleabbrev,
         list-heading = chapter*,
         list-name    = Abkürzungsverzeichnis
         }

\DeclareAcronym{00000Header}{ % \ac{00000Header}
  short = \textbf{Abkürzung},
  long  = \textbf{Erläuterung},
}

\DeclareAcronym{EEG}{ % in text by use of \ac{EEG}
  short = EEG,
  long  = Erneuerbare-Energien-Gesetz,
}


\begin{document}

\printacronyms
\acuse{00000Header}
\acuseall

\end{document}

在此处输入图片描述

答案2

开发人员向acro package我提供了以下 MWE - 谢谢!:

\documentclass{article}
\usepackage{acro}

\DeclareAcronym{EEG}{
  short = EEG ,
  long = Erneuerbare-Energien-Gesetz ,
  list = \underline{E}rneuerbare-\underline{E}nergien-\underline{G}esetz
}

\NewAcroTemplate[list]{ueberschrift}{%
  \AcroNeedPackage{array,longtable}%
  \acronymsmapF{%
    \AcroAddRow{%
      \acrowrite{short}%
      \acroifT{alt}{/}\acrowrite{alt}%
      &
      \acrowrite{list}%
      \acroifanyT{foreign,extra}{ (}%
      \acrowrite{foreign}%
      \acroifallT{foreign,extra}{, }%
      \acrowrite{extra}%
      \acroifanyT{foreign,extra}{)}%
      \acropagefill
      \acropages
        {\acrotranslate{page}\nobreakspace}%
        {\acrotranslate{pages}\nobreakspace}%
      \tabularnewline
    }%
  }
  {\AcroRerun}%
  \acroheading
  \acropreamble
  \par \noindent
  \begin{longtable}{lp{.7\linewidth}}
    \bfseries Abkürzung & \bfseries Erläuterung \\
    \endhead
    \AcronymTable
  \end{longtable}
}

\usepackage{array,longtable}

\acsetup{list/template=ueberschrift}

\begin{document}

\ac{EEG}

\printacronyms

\end{document}

答案3

肮脏的解决方案:

\documentclass[12pt]{report}

\usepackage{acro}

\acsetup{
    list-style        = tabular    ,     % <-------------
    sort              = true       ,     % <-------------
    list-heading      = chapter*   ,
    list-name         = Abkürzungen
}

\DeclareAcronym{aaaaa}{                  % <-------------
    short        = Abkürzung   ,         % <-------------
    short-format = {\bfseries} ,         % <-------------
    long         = Erläuterung ,         % <-------------
    long-format  = {\bfseries} ,         % <-------------
}                                        % <-------------

\DeclareAcronym{EEG}{
  short = EEG,
  long  = Erneuerbare-Energien-Gesetz,
}

\DeclareAcronym{dbms}{
  short = DBMS,
  long  = Database Management System,
}

\begin{document}

\printacronyms
\acuse{aaaaa}                            % <-------------
\acuseall

\end{document}

相关内容