So I have a list of acronyms defined with the glossaries package, like such:
\newacronym{mac}{MAC}{Medium Access Control}
but also some of these:
\newcommand{\mk}{Master Key}
because the latter one shall not be abbreviated but I don't want to type it all the time (can that be achieved with the glossaries package? Would be neat).
What I'm trying to achieve is, that both usecases print the word on first usage in italic. The acronyms (\newacronym
) are then supposed to print the abbreviation (as it is per default) and the other like they are.
Any suggestions on how to do that in the glossaries package? And something more elegant for the other macros then toggles for each one?
Edit:
I ended up defining meta commands
\newcommand*{\firstit}[3][]{\it{#3#1}\expandafter\gdef\csname#2\endcsname{#3}}
\newcommand*{\firstitacr}[4][]{{\it{#4#1} (#3)}\expandafter\gdef\csname#2\endcsname{#3}}
which are used to define the acronyms and proper names
\newcommand*{\mk}[1]{\firstit[#1]{mk}{Master Key}}
\newcommand*{\mac}[1]{\firstitacr[#1]{mac}{MAC}{Medium Access Control}}
these can then be used like this:
First usage of proper name: \mk{}
Second usage: \mk{}
First usage of acronym: \mac{}
Second usage: \mac{}
which would be rendered to something like this
First usage of proper name: Master Key
Second usage: Master KeyFirst usage of acronym: Medium Access Control (MAC)
Second usage: MAC
I'm pretty sure, that there is a more elegant solution, but this works for me.
glossaries
for the second one? Just use\newcommand\mk{\textit{Master Key}\gdef\mk{Master Key}}
and it will be italic for the first time and every following usage will just print it in the current font.\gls
italic, and I still want to use\glsreset
Any ideas?glossaries
, it's the same what I'd do. You can change the definition of\mk
to\newcommand\mkFormatting[1]{\textit{#1}\gdef\mkFormatting#1{#1}}\newcommand\mk[1][]{\mkFormatting{Master Key#1}}
. After that you can use\mk[s]
to get "Master Keys" in the correct formatting.