我想要一份完整的首字母缩略词列表。
利用longtabu
该tabu
包装,可以将longtable
和tabularx
构造的功能结合起来:
\begin{longtabu}to\linewidth{@{}lX@{}} ... \end{longtabu}
但是我不知道如何为acro
包实现该功能。
\documentclass{article}
\usepackage{tabu,longtable}
\usepackage{acro}
\usepackage{showframe}
\DeclareInstance{acro-page-number}{dotfill}{default}{
punct = true ,
punct-symbol = \dotfill
}
\acsetup{
list-type = table ,
list-style = longtable,
list-table-width=\linewidth,
pages = first,
page-name = ,
pages-name = ,
page-ref = dotfill
}
\ExplSyntaxOn
\DeclareTemplateInterface {acro-list} {table} { 3 }
{
table : tokenlist = longtable ,
table-spec : tokenlist = @{}l@{\hspace{10pt}}p{\l__acro_table_width_dim}@{} ,
foreign-sep : tokenlist = { ~ }
}
\DeclareInstance { acro-list } { longtable }
{ table }
{ table = longtable }
\ExplSyntaxOff
\DeclareAcronym{bar}{ short = bar, long = {barbar} }
\DeclareAcronym{foo}{ short = foo, long = {foofoo} }
\begin{document}
%\noindent
\printacronyms
\noindent
\ac{foo}\\
\ac{bar}\\
\ac{foo}
\end{document}
答案1
我于 2015-08-16 将 v2.0 发送至 CTAN。有了它,以下功能现在可按预期运行:
首先声明一个
acro-list
实例longtabu
:\DeclareInstance{acro-list}{longtabu}{table}{ table = longtabu , table-spec = @{}>{\bfseries}lX@{} }
设置选项
list-style
以使用新实例:\acsetup{ list-type = table , list-style = longtabu }
完整示例:
% http://tex.stackexchange.com/q/258646/
\documentclass{article}
\usepackage{tabu,longtable}
\usepackage{acro}[2015/08/16]
\usepackage{showframe}
\DeclareInstance{acro-page-number}{dotfill}{default}{
punct = true ,
punct-symbol = \dotfill
}
\DeclareInstance{acro-list}{longtabu}{table}{
table = longtabu ,
table-spec = @{}>{\bfseries}lX@{}
}
\acsetup{
list-type = table ,
list-style = longtabu ,
pages = first ,
page-name = ,
pages-name = ,
page-ref = dotfill
}
\DeclareAcronym{bar}{ short = bar, long = {barbar} }
\DeclareAcronym{foo}{ short = foo, long = {foofoo} }
\begin{document}
\printacronyms
\ac{foo} \par
\ac{bar} \par
\ac{foo}
\end{document}