1

Following this question about setting up a Japanese-English glossary (which will in fact be a Japanese-French one, but that doesn't change much), I need to define a new style for this glossary. For now, the altlong4col-booktabs seems to be the closest to what I'd like the result to be. However, I need to add a few changes :

  1. Remove the "Page List" column,
  2. Rename the headers,
  3. Make the first column ("Notation") bold,
  4. And invert the positions of the "Description" and "Symbol" columns.

Here is what I have for now :

\documentclass[a4paper, 12pt]{article}

\usepackage{xunicode}
\usepackage{polyglossia}
\usepackage{xeCJK}
\usepackage[automake, style=index, nonumberlist]{glossaries-extra} 
\usepackage{glossary-longbooktabs}

\setmainlanguage{french}
\setCJKmainfont{AozoraMinchoRegular.ttf}

\makeglossaries
\glossarystyle{altlong4col-booktabs}

%syntax: \newterm[options]{romaji}{original}{translation}
\newcommand{\newterm}[4][]{%
  \newglossaryentry{#2}{%
    name={#2},% romanized version
    symbol={#3},% original
    description={#4},% translation
    #1% extra options
  }%
}

\newcommand{\glsxtrpostlinkgeneral}{%
  \ifdefempty\glscustomtext
  {%
    \glsxtrifwasfirstuse
    {%
      \ifglshassymbol{\glslabel}{\space(\glsaccesssymbol{\glslabel},
        «~\glsaccessdesc{\glslabel}~»)}{}%
    }%
    {}%
  }%
  {}%
}

% use \emph in the document (but not in the glossary)
\renewcommand*{\glsxtrregularfont}[1]{\emph{#1}}

\newterm{bakumatsu}{幕末}{fin du shogunat}

\begin{document}   
The \gls{bakumatsu} era.  

Next use: \gls{bakumatsu}.

\printglossary[title=Glossaire des termes japonais]
\end{document}

This prints the following result :

Main text Glossary

The glossary style I would like to define should look like this somehow (don't mind the font) : Desired glossary style

How should I proceed ?

1

Here's a style that creates a three-column glossary. (You still need to load glossary-longbooktabs which defines \glspatchLToutput and also loads booktabs and longtable.)

\newglossarystyle{romaji}{%
  \glspatchLToutput
  \renewenvironment{theglossary}%
    {\begin{longtable}{>{\raggedright}p{.33\textwidth}p{.33\textwidth}>{\raggedright}p{.33\textwidth}}}%
    {\end{longtable}}%
% Table header:
  \renewcommand*{\glossaryheader}{\toprule\bfseries Transcription en
  caractères latins (\emph{rōmaji}) &
  \bfseries Ecriture japonaise &
  \bfseries Traduction\tabularnewline\midrule\endhead\bottomrule\endfoot}%
% No letter group headings:
  \renewcommand*{\glsgroupheading}[1]{}%
% Top-level (no parent) entries:
% (#1 is the entry's label)
% (#2 is the numberlist which is ignored here)
  \renewcommand{\glossentry}[2]{%
% Romanized name (in bold):
    \glsentryitem{##1}\glstarget{##1}{\textbf{\glossentryname{##1}}} &
% Original Japanese:
    \glossentrysymbol{##1} &
% Translation:
    \glossentrydesc{##1}\tabularnewline
  }%
% Sub-level (has parent) entries (just do the same as top-level):
  \renewcommand{\subglossentry}[3]{\glossentry{##2}{##3}}%
% Gap between letter groups (governed by nogroupskip package option):
  \ifglsnogroupskip
    \renewcommand*{\glsgroupskip}{}%
  \else
    \renewcommand*{\glsgroupskip}{ & & & \tabularnewline}%
  \fi
}

Use \setglossarystyle rather than the deprecated \glossarystyle:

\setglossarystyle{romaji}

or use the style key in \printglossary (which will localise the patch introduced with \glspatchLToutput):

\printglossary[title=Glossaire des termes japonais,style=romaji]

I've made all three columns equal width using:

\begin{longtable}{>{\raggedright}p{.33\textwidth}p{.33\textwidth}>{\raggedright}p{.33\textwidth}}

You may need to adjust these settings.

If I add the above style to the code in your question (and substitute the CJK font with one installed on my computer) I get:

image of document with three-column glossary

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.