Closed DaftDogeee closed 2 years ago
\acspace
works inside of an acronym template or acronym definition. It depends on the setting of trailing/activate
and only has an effect if dash
has been activated:
\documentclass{article}
\usepackage{acro}
% \NewAcroTemplate{long-short}{%
% \acroiffirstTF{%
% \acrowrite{long}%
% \acspace(% <<<<<<< HERE
% \acroifT{foreign}{\acrowrite{foreign}, }%
% \acrowrite{short}%
% \acroifT{alt}{ \acrotranslate{or} \acrowrite{alt}}%
% \acrogroupcite
% )%
% }%
% {\acrowrite{short}}%
% }
% example from the manual
\DeclareAcronym{PU}{
short = PU ,
long = Polyurethan ,
long-plural = e
}
\DeclareAcronym{AB}{
short = A\acspace B ,
long = aaa\acspace bbb ,
}
\acsetup{trailing/activate = dash}
\begin{document}
\paragraph{No Space}
\ac{PU}-Hartschaum \ac{AB}-test
\acresetall
\paragraph{Space}
\ac{PU} \ac{AB}
\end{document}
Thanks for reply.
Based on your example, I make another try, and the example is listed as follow. I just wonder that why the comma is not activated.
\documentclass{article}
\usepackage{acro}
\DeclareAcronym{PU}{
short = PU ,
long = Polyurethan ,
long-plural = e
}
\DeclareAcronym{AB}{
short = A\acspace B ,
long = aaa\acspace bbb ,
}
\acsetup{trailing/activate = {comma,dash}}
\begin{document}
\paragraph{No Space}
\ac{PU}-Hartschaum \ac{AB},test
\acresetall
\ac{PU}-Hartschaum \ac{AB}-test
\acresetall
\paragraph{Space}
\ac{PU} \ac{AB}
\end{document}
Well, as I wrote it only reacts to dash
(and babel-hyphen
). That is, because I only know “real-life” examples (and only German ones, to be honest) in combination with a dash. But you can redefine \acro_space:
to react on comma
as well:
\cs_set:Npn \acro_space:
{ \acro_trailing_if_tokens:nF {dash,babel-hyphen,comma} { \c_space_tl } }
Many thanks.
I think now I completely understand how does \acspace
work.
The reason why I attempt to patch \acspace
is that I am working on the adaptation of acro
for Chinese. But, I think the core issue may exist in the ctex
. It may involve the joint typesetting problem of Chinese and English, such as #491.
Hi, Clemens,
The manual says that
\acspace
inserts a\space
if no dash or babel-hyphen follows.However, I make the following try, and
\acspace
is not still activated.May I have a wrong understanding for that?
A\acspace-B
A-\acspace{}B