With v2.1 or newer there is a list style lof
and you can do the following:
\documentclass{article}
\usepackage{acro}[2015/09/05]
\acsetup{
list-style = lof ,
pages = first
}
\DeclareAcronym{bar}{ short = bar, long = {bar} }
\DeclareAcronym{foo}{ short = foo, long = {foo} }
\begin{document}
\printacronyms
\section{Blah blah}
\ac{foo}\newpage
\ac{bar}\newpage
\ac{foo}\newpage
\end{document}
Original answer:
With 1.6b (2015/05/10) your example works, inluding pages=first
and without endless warnings.
\documentclass{article}
\usepackage{longtable}
\usepackage{acro}
\DeclareInstance{acro-page-number}{dotfill}{default}{
punct = true ,
punct-symbol = \dotfill
}
\acsetup{
list-type = table ,
list-style = longtable ,
pages = first,
page-name = ,
pages-name = ,
page-ref = dotfill
}
\DeclareAcronym{bar}{ short = bar, long = {bar} }
\DeclareAcronym{foo}{ short = foo, long = {foo} }
\begin{document}
\printacronyms
\ac{foo}\newpage
\ac{bar}\newpage
\ac{foo}\newpage
\end{document}
A personal remark: while your initial question seems perfectly fine for TeX.sx both your first and you second update look more like bug reports to me. The acro
website (mentioned also in the manual) https://bitbucket.org/cgnieder/acro/ is much better suited for bug reports: a) I won't miss the report and b) I won't forget it. (Both happens with questions on TeX.sx quite easily...)
Here's a hack that changes the template for the tabular; I wasn't able to find a better solution, as the column types are hardcoded.
I'd say that an automatic solution is out of question, because it would need measuring all acronyms and set the width for the column. Maybe the package author can think to something better.
Adjust the length (now 2cm) where %<---
appears
\documentclass{article}
\usepackage{acro}
\usepackage{relsize}
\usepackage[hidelinks]{hyperref}
\DeclareAcronym{SALSAS}{
short = SALSAS ,
long = some are long some are short ,
class = long
}
\DeclareAcronym{HP}{
short = HP ,
long = help putting ,
class = long
}
\DeclareAcronym{S}
{ short = S ,
long = short ,
class = short}
\DeclareAcronym{C}
{ short = C ,
long = command ,
class = short}
\acsetup{list-heading=subsection*} %Means that the acronyms lists are classed as a subsection
\acsetup{list-style=tabular}
\ExplSyntaxOn
\DeclareTemplateInterface {acro-list} {table} {3}
{
table : tokenlist = longtable ,
table-spec : tokenlist = p{2cm}p{\l__acro_table_width_dim} ,%<---
foreign-sep : tokenlist = { ~ }
}
\DeclareInstance { acro-list } { tabular }
{ table }
{ table = tabular }
\ExplSyntaxOff
%\setlength{\tabcolsep}{10pt}
\begin{document}
\section*{Acronyms}
\printacronyms[include-classes=long,name={Long}]
\printacronyms[include-classes=short,name={Short}]
Acronyms are useful: \ac{SALSAS}. The \ac{S} ones are my favourite. Any \ac{HP} tables in the right \acp{C} would be gratefully received.
\end{document}
Update
With a newer version of acro
it's possible to act on the list without hacks.
\documentclass{article}
\usepackage{acro}
\DeclareAcronym{SALSAS}{
short = SALSAS ,
long = some are long some are short ,
class = long
}
\DeclareAcronym{HP}{
short = HP ,
long = help putting ,
class = long
}
\DeclareAcronym{S}
{ short = S ,
long = short ,
class = short}
\DeclareAcronym{C}
{ short = C ,
long = command ,
class = short}
\DeclareAcroListStyle{mytabular}{table}{
table=tabular,
table-spec=@{}p{2cm}p{\dimexpr\textwidth-2cm-2\tabcolsep}@{},
}
\acsetup{list-heading=subsection*} %Means that the acronyms lists are classed as a subsection
\acsetup{list-style=mytabular}
\begin{document}
\section*{Acronyms}
\printacronyms[include-classes=long,name={Long}]
\printacronyms[include-classes=short,name={Short}]
Acronyms are useful: \ac{SALSAS}. The \ac{S} ones are my favourite. Any \ac{HP} tables in the right
\acp{C} would be gratefully received.
\end{document}
Best Answer
You could change the environment used by
\printacronyms
fromdescription
(the default) tolongtable
from thelongtable
package. In\ac-setup
thelist-style
option controls this, to place it in alongtable
environment you can simply uselist-style=longtable
(or there are a number of alternative options).The
\DeclareAcroListStyle
even allows development of your own style to place the list in for further customisation as documented in theacro
manual.With
list-style=longtable
(extra O added to acronym to emphasise the alignment)