使用带有首字母缩略词包的表格(或 xtab)

使用带有首字母缩略词包的表格(或 xtab)

我不想生成缩略词列表,而是想制作一个能够跨页的缩略词表。我有一个部分解决方案,但它使用多列将缩略词列表强制为单个表格段落条目。

\documentclass{article}
\usepackage[printonlyused]{acronym}
\usepackage{booktabs}
\usepackage{xtab}

\makeatletter
\renewenvironment{AC@deflist}[1]%
{\ifAC@nolist\else%
  \raggedright\begin{list}{}%
    {%
      \setlength{\labelwidth}{#1}%
      \setlength{\leftmargin}{\labelwidth}%
      \addtolength{\leftmargin}{\labelsep}%
      \renewcommand{\makelabel}{\AC@makelabel}}%
    \fi}%
  {\ifAC@nolist\else\end{list}\fi}%
\makeatother

\begin{document}

\section*{John and Joe}
Hey there goes \acs{JOHN} and \acs{JOE}.\\
Who?\\
You know, \ac{JOHN} and \ac{JOE}.

\section{Notation}

\tablefirsthead{\toprule Abbrevation & Meaning \\ \midrule} 
\tablehead{\toprule Abbrevation & Meaning \\ (cont.) & (cont.)\\ \midrule}
\tabletail{\midrule\multicolumn{2}{c}{continued on next page}\\\bottomrule}
\tablelasttail {\bottomrule}

\begin{xtabular}{p{.2\textwidth}p{.7\textwidth}}\\
  \multicolumn{2}{p{0.9\textwidth}}{
    \begin{acronym}[0.2\textwidth]
      \acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}
      \acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}
    \end{acronym}}\\
\end{xtabular}

\end{document}

答案1

\documentclass{article}
\usepackage[printonlyused]{acronym}
\usepackage{booktabs}
\usepackage{xtab}

\makeatletter
\renewenvironment{AC@deflist}[1]%
{\ifAC@nolist\else%
    \raggedright\begin{list}{}%
        {%
            \setlength{\labelwidth}{#1}%
            \setlength{\leftmargin}{\labelwidth}%
            \addtolength{\leftmargin}{\labelsep}%
            \renewcommand{\makelabel}{\AC@makelabel}}%
        \fi}%
    {\ifAC@nolist\else\end{list}\fi}%
\def\Acro#1[#2]#3{%
    \vspace{-\normalbaselineskip}\acronym[\dimexpr0.2\textwidth]\acro{#1}[#2]{#3}\endacronym
     \vspace{-2\normalbaselineskip}}
\makeatother

\begin{document}


\section*{John and Joe}
Hey there goes \acs{JOHN} and \acs{JOE}.\\
Who?\\
You know, \ac{JOHN} and \ac{JOE}.

\section{Notation}

\tablefirsthead{\toprule \makebox[.2\textwidth][l]{Abbrevation}  Meaning \\ \midrule} 
\tablehead{\toprule \makebox[.2\textwidth][l]{Abbrevation} Meaning \\ 
    \makebox[.2\textwidth][l]{(cont.)}  (cont.)\\ \midrule}
\tabletail{\midrule\multicolumn{1}{c}{continued on next page}\\\bottomrule}
\tablelasttail {\bottomrule}

\begin{xtabular}{p{0.9\textwidth}}
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
            \Acro{JOHN}[John]{John Jacob Jingleheimer Schmidt}\\
            \Acro{JOE}[Joe]{Joey Jo-Jo Junior Shabadoo}\\
    \end{xtabular}

\end{document}

在此处输入图片描述

相关内容