cgnieder / acro

acronyms for LaTeX
LaTeX Project Public License v1.3c
42 stars 9 forks source link

Insert optional word after acronym but before citation #154

Closed dbosk closed 4 years ago

dbosk commented 4 years ago

There are situations when an acronym is used as an adjective/adverb. An example is Universal Composability (UC) from the crypto area. It is usually used like "in the UC model" or "something is UC secure".

There are several issues (#132 dealt with forming things like "universally composably (UC) secure"). The one here is related to the citations. Consider, "we use the \ac{UC} model". With citations this would yield "we use the Universal Composability (UC) [1] model", which looks a bit ugly, "Universal Composability (UC) model [1]" would be preferable. It would be nice to be able to do "we use the \ac{UC}[model]" to yield "we use the Universal Composability (UC) model [1]" instead.

The trivial solution is to have an acro UCmodel which expands with the word "model", but that breaks as soon as one must also add UCsecure, and so on. One must use exponentially many \acifused combinations to solve it. It also results in "Universal Composability model (UC model)".

cgnieder commented 4 years ago

This is an interesting problem… I need to think about this.

cgnieder commented 4 years ago

This is implemented in version 3.0, albeit indirectly.

dbosk commented 4 years ago

Cool, thanks! I'll try to give it a try sometime soon.

cgnieder commented 4 years ago

An example :)

\documentclass{article}

\usepackage[version=3]{acro}

\NewAcroCommand\acx{mm}{\UseAcroTemplate{first}{#1}#2}

\DeclareAcronym{uc}{
  short = UC ,
  long = Universal Composability ,
  cite = xxx
}

\begin{document}

We use the \acx{uc}{ model} for\dots

\end{document}

image

dbosk commented 4 years ago

That's really neat! :-D Thanks again!

cgnieder commented 4 years ago

Maybe even

\RenewAcroCommand\ac{mO{}}{\UseAcroTemplate{first}{#1}#2}

and then

We use the \ac{uc}[ model] for\dots

which would give the same output.

dbosk commented 4 years ago

I really like that one!