TeX - LaTeX Asked by stefanct on August 5, 2021
I have a term that does not exist in singular form (i.e., a plurale tantum) that I would like to abbreviate like ordinary acronyms. How should such a thing be handled properly in glossaries (if at all)? Probably the best thing would be to make the singular form of it raise an error so that only the plural forms can be used. Is there a viable way to do that (i.e., without redefining any of the glossaries functions)?
The term in question is single-event multiple upsets (SEMUs).
I could of course simply define it normally (i.e. with a wrong singular) with newacronym{SEMU}{SEMU}{single-event multiple upset}
and then always use the plural forms like acp{SEMU}
… and that’s what I do for now. But I was wondering if there is a better way.
I tried with the following and that works fine while referencing it in the text but fails to print the glossary at the end, of course… I presume because glossentry
non-surprisingly uses the singular…
newacronym[longplural={single-event multiple upsets},shortplural={SEMUs}]{SEMU}{errmessage{SEMUs is always plural}}{}
A MWE that shows the latter problem:
documentclass{article}
usepackage[nomain,acronym,shortcuts]{glossaries}
newacronym[longplural={single-event multiple upsets},shortplural={SEMUs}]{SEMU}{errmessage{SEMUs is always plural}}{}
makeglossaries
begin{document}
acp{SEMU}
printglossary[type=acronym]
end{document}
If you're not gonna fill in the blanks for singular definitions, you can use the plural definitions both for singular and plural. An attempt of solution using xparse
:
usepackage{xparse}
DeclareDocumentCommand{PluraleTantum}{o m m m}{
IfNoValueTF{#1}{%
newacronym[longplural={#4},shortplural={#3}]{#2}{#3}{#4}%
}{%
newacronym[longplural={#4},shortplural={#3},#1]{#2}{#3}{#4}%
}
}
PluraleTantum{SEMU}{SEMUs}{single-event multiple upsets}
As PluraleTantum
does not redefine anything, acp
and other glossaries
commands still work. Unless you have more fine-grained needs, the code above will work.
Answered by user193767 on August 5, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP