Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capitalization for words beginning with other characters than letters #10

Open
SamThilmany opened this issue Nov 15, 2019 · 2 comments
Open

Comments

@SamThilmany
Copy link

SamThilmany commented Nov 15, 2019

The bugs described here occur when compiling a document with acronym version 1.42 of November 11, 2019.


Capitalization is not compatible with other commands or strings that do not begin with a letter (e.g. chemical names). For example, if you define the acronym \acro{4'-OH ATX}[4'-OH ATX]{4'-hydroxy atomoxetine} and output it using \Ac{4'-OH ATX}, you will get

4'-hydroxy atomoxetine

instead of

4'-Hydroxy atomoxetine.

It would, therefore, be necessary to apply the use of \MakeUppercase to the first letter instead of the first character.

In addition, no other macros can be used within the acro macros. However, it would be partly necessary to write it in italics or to put the correct quotation marks by using the \enquote command (csquotes). For chemical substance names, the \iupac command (chemmacros) would be useful. None of these works.


MWE

\documentclass{article}

% Typeset Packages
\usepackage{parskip}
\usepackage[nohyperlinks, printonlyused, withpage]{acronym}
\usepackage{csquotes}

% Chemistry Packages
\usepackage{chemmacros}


\begin{document}

\section*{List of acronyms}

\begin{acronym}
    \acro{MTBE}[MTBE]{methyl tert-butylether}
    \acro{4'-OH ATX}[4'-OH ATX]{4'-hydroxy atomoxetine}
    \acro{3-APA}[3-APA]{\iupac{3-azidopropylamine}}
\end{acronym}


\section{Capitalization}

Let's use the \verb!\Ac! command to output the MTBE acronym:\\
\Ac{MTBE}

Let's test the same thing with the 4'-OH ATX acronym:\\
\Ac{4'-OH ATX}

As you see, the first letter of the MTBE output is, as we would expect, capitalized. For the 4'-OH ATX output, however, the output is not as expected.


\section{Use of macros}

As the last example, let's uncomment the \verb!\Ac{3-APA}! command, in order to view the error resulting from using a macro inside of the \verb!\acro! macro. Please note, that this does \textbf{not} happen with the \verb!\ac! command!

% \Ac{3-APA}

\end{document}
@marsmee
Copy link
Collaborator

marsmee commented Apr 2, 2020

Hello @SamThilmany,

I have done some research on this and found quite a few cases where such a behaviour would lead to erroneous results, e.g. something like \acro{80s}{1780s} or \acro{80s Synth}{80s synthesizer pop} would lead to "1780S" and "80S synthesizer pop". Likewise \acro{.280 British}{7\,mm NATO} or \acro{.280 British}{7×43mm} would be "7Mm NATO" and "7X43mm", both incorrect.

So I currently see three ways to solve this from within the acronym package.

  1. Add a new option that enables an extensive search for the first letter, but which would also produce wrong output when mixing e.g. chemicals and ammunition (sounds quite realistic to me).
  2. Add something like \acroupper{4'-OH ATX}{4'-hydroxy atomoxetine}{4'-Hydroxy atomoxetine} which would also have to be combined with \acroindefinite, so we need at least six new commands, I think.
  3. Provide alternate versions of all the available upper-case commands plus the starred ones; this should be around 20 new commands.

On the other hand, you could locally implement a small command that does the extensive search for the first letter, such as \Up{\ac{4'-OH ATX}} instead of \Ac{4'-OH ATX}. You can then use it at the places you consider useful.

At this point, my question is how the effort of enhancing the package relates to the benefit. In my opinion, this is definitely a niche issue and therefore I suggest to label it as wontfix. Nevertheless, I could imagine that such a command would fit well in some chemistry utility LaTeX package.

@SamThilmany
Copy link
Author

@marsmee,

I realize that it can quickly lead to incorrect outputs, but I still think that the implementation would make sense. In my experience LaTeX is mainly used by scientists. Chemists, as well as biologists and even physicists, often have to mention chemicals in their texts. So I would not say that this is a niche. I am also critical of the suggestion to put this into a chemistry-related utility package. Here we have a package that deals with abbreviations and acronyms, so why would you put a patch for a problem of this package into another package?

Besides, the second problem mentioned remains and at least with this one you have to admit that it is not a niche problem and it cannot be moved to other packages.

Stay healthy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants