6

I'm writing my PhD thesis in my mother language (Slovene). I would like to create a Glossary that would contain the slovene versions of the terms along with their english counterparts. The descriptions would be in slovene.

What I would like to achieve is best demonstrated with a small example:

\documentclass{article}

\begin{document}

On its first use, the acronym would look something like: \textit{slovene
translation of the expanded acronym} (angl. \textit{expanded acronym in
english, ACR}), where \textit{ACR} is the english acronym.
On second use, it would look like: ACR.

For ordinary glossary entries, the first occurence would look like:
\textit{slovene translation of the term} (angl. \textit{english term}).
Further occurences would look like: slovene translation of the term.

\vspace*{24pt}

The Glossary would contain something along the lines below:

\section*{Glossary}

\textbf{ACR} \quad Expanded acronym in english. See: slovene translation of the
expanded acronym.

\vspace*{12pt}

\noindent\textbf{\textit{slovene translation of the expanded acronym} (angl.
\textit{expanded acronym in english}, ACR)} \quad Slovene description of the
acronym.

\vspace*{12pt}

\noindent\textbf{\textit{slovene translation of the term} (angl.
\textit{english term})}
\quad Slovene description of the term.

\end{document}

The above example produces: enter image description here

Note that the entry for the acronym is listed twice: one occurrence lists the english acronym (e.g. ACR) with an expanded english version and a reference to the slovene entry, the other is an ordinary entry with slovene translation of the expanded acronym, expanded acronym in english and the english acronym itself.

I would be happy to see even a partial answer.

  • The acronym part is similar to Using the glossaries package for English acronyms in German documents. The other part (terms rather than acronyms) is similar to the example document sample-langdict.tex that comes with the glossaries package, except that you have the English and Slovene entries in the same glossary. – Nicola Talbot Aug 15 '13 at 9:28
  • @NicolaTalbot, thanks for your help. I also looked at Using the glossaries package for English acronyms in German documents and I'm able to modify the answer to solve the part on how it would display on its first occurence. – tjanez Aug 15 '13 at 17:13
  • @NicolaTalbot, however, I'm not sure the approach in sample-langdict.tex is the right one for the second part. I only want to have one glossary where entries have an additional field with a foreign (i.e. english) version of the term. And I want to modify the display of the terms in the glossary to also include this field appropriately. – tjanez Aug 15 '13 at 17:21
3

Here's a solution for the second part of your query:

\documentclass{article}

\usepackage{glossaries}

\makeglossaries

% syntax: \addterm[options]{label}{Slovene}{Slovene
% plural}{English}{English plural}{Slovene description}

\newcommand{\addterm}[7][]{%
  \newglossaryentry{#2}{name={\textit{#3} (angl.\ \textit{#5})},
     first={\textit{#3} (angl.\ \textit{#5})},
     firstplural={\textit{#4} (angl.\ \textit{#6})},
     text={#3},
     plural={#4},
     sort={#3},
     description={#7},#1}%
}

\addterm
 {sample}% label
 {slovene translation of the term}%
 {plural form of slovene translation of the term}%
 {english term}%
 {plural english term}%
 {slovene description of the term}

\begin{document}

For ordinary glossary entries, the first occurrence would look like:
\gls{sample}.
Further occurrences would look like: \gls{sample}.

Reset and try plural forms:\glsreset{sample}

For ordinary glossary entries, the first occurrence would look like:
\glspl{sample}.
Further occurrences would look like: \glspl{sample}.


\printglossaries

\end{document}

(Note, I think it would be better to use \emph rather than \textit in case the first use occurs in italic surroundings, for example an italic abstract or theorem.)

The above example produces:

Image of resulting document

0

Building on the answer of Nicola Talbot, I figured a rather simple way of fulfilling the other two requirements of the question:

  • Having bi-lingual support for acronyms (in a simpler way than explained here)
  • Listing the acronym twice: one occurrence listing the english acronym with its long version and a reference to the slovene entry, the other occurrence listing an ordinary entry with the slovene long version, english long version and the english acronym itself.

Here is the code covering the whole question:

\documentclass{article}

\usepackage[hidelinks]{hyperref}

\usepackage{glossaries}

\makeglossaries

% A new command that enables us to enter bi-lingual (Slovene and English) terms
% syntax: \addterm[options]{label}{Slovene}{Slovene first use}{English}{Slovene
% description}
\newcommand{\addterm}[6][]{
  \newglossaryentry{#2}{
    name={#3 (angl.\ #5)},
    first={\emph{#4} (angl.\ \emph{#5})},
    text={#3},
    sort={#3},
    description={#6},
    #1 % pass additional options to \newglossaryentry
  }
}

% A new command that enables us to enter (English) acronyms with bi-lingual
% (Slovene and English) long versions
% syntax: \addacronym[options]{label}{abbreviation}{Slovene long}{Slovene first
% use long}{English long}{Slovene description}
\newcommand{\addacronym}[7][]{
  % Create the main glossary entry with \newacronym
  % \newacronym[key-val list]{label}{abbrv}{long}
  \newacronym[
    name={#4 (angl.\ #6,\ #3)},
    first={\emph{#5} (angl.\ \emph{#6},\ \emph{#3})},
    sort={#4},
    description={#7},
    #1 % pass additional options to \newglossaryentry
    ]
    {#2}{#3}{#4}
  % Create a cross-reference from the abbreviation to the main glossary entry by
  % creating an auxiliary glossary entry (note: we set the label of this entry
  % to '<original label>_auxiliary' to avoid clashes)
  \newglossaryentry{#2_auxiliary}{
    name={#3},
    sort={#3},
    description={\makefirstuc{#6}},
    see=[See:]{#2}
  }
}

% Change the text of the cross-reference links to the Slovene long version.
\renewcommand*{\glsseeitemformat}[1]{\emph{\acrlong{#1}}.}

\addterm
 {sample} % label
 {slovene translation of the term}
 {first use of the slovene translation of the term}
 {english term}
 {slovene description of the term}

\addacronym
 {sample_acronym} % label
 {ACR} % abbreviation
 {slovene long version of the acronym}
 {first use of the slovene long version of the acronym}
 {english long version of the acronym}
 {slovene description of the term}

\begin{document}

For ordinary glossary entries, the first occurrence would look like:
\gls{sample}.
Further occurrences would look like: \gls{sample}.

For acronyms, the first occurrence would look like:
\gls{sample_acronym}.
Further occurrences would look like: \gls{sample_acronym}.

\printglossaries

\end{document}

The example produces: enter image description here

Note that the reason for two entries: Slovene and Slovene first use is that Slovene language has six noun cases. I find it a bit too much trouble to handle all six of them automatically, so I hard-coded the first use case into the term definition. Unfortunately, this means I have to manually check for the first occurrence and change the Slovene first use entry accordingly. If anyone has a better solution, please let me know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.