0

my Problem is, as will be shown in the following 2 MWEs, that the custom column names i specified for my glossary, will be overwritten when babel ist loaded. The associated .bib file can be found at the end.

How can i prevent this behaviour? I already treid altering the position of the \renewcommand prompts.

First without babel loaded:

\documentclass[english, a4paper, 11pt, DIV=calc, headsepline, titlepage, bibliography=totocnumbered]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage[record, abbreviations, symbols, nonumberlist, hyperfirst=false, toc=false, stylemods={longextra}]{glossaries-extra}
\glsaddstoragekey{unit}{}{\glsentryunit}

\GlsXtrLoadResources[
    src={bibfiles/symbols}, % data in symbols.bib
    sort-field={name}, % sort by name field
    sort={letter-nocase}, % case-insensitive letter sort
    type=symbols, % put these terms in the symbols list
    field-aliases={unit=symbol},% convert unit key to symbol
    save-locations=false % don't save location lists
]
% change column headers:
\renewcommand{\entryname}{Symbol}
\renewcommand{\symbolname}{Unit}
\renewcommand{\glslongextraSymbolAlign}{l}

\begin{document}

\printunsrtglossary[type=symbols, style={long-name-sym-desc}]

\end{document}

The result is exactly how i want it to be:

enter image description here

Now when babel is activated as so:

\documentclass[english, a4paper, 11pt, DIV=calc, headsepline, titlepage, bibliography=totocnumbered]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{siunitx}
\usepackage[record, abbreviations, symbols, nonumberlist, hyperfirst=false, toc=false, stylemods={longextra}]{glossaries-extra}
\glsaddstoragekey{unit}{}{\glsentryunit}

\GlsXtrLoadResources[
    src={bibfiles/symbols}, % data in symbols.bib
    sort-field={name}, % sort by name field
    sort={letter-nocase}, % case-insensitive letter sort
    type=symbols, % put these terms in the symbols list
    field-aliases={unit=symbol},% convert unit key to symbol
    save-locations=false % don't save location lists
]
% change column headers:
\renewcommand{\entryname}{Symbol}
\renewcommand{\symbolname}{Unit}
\renewcommand{\glslongextraSymbolAlign}{l}

\begin{document}

\printunsrtglossary[type=symbols, style={long-name-sym-desc}]

\end{document}

i will get the following:

enter image description here

Associated bib file:

% Encoding: UTF-8

@symbol{alpha,
  unit= {\si{\radian\per\second\squared}},
  name = {\ensuremath{\alpha}},
  description = {angular acceleration}
}

@symbol{x,
  unit = {\si{m}},
  name = {\ensuremath{x}},
  description = {position}
}

@symbol{v,
  unit = {\si{\metre\per\second}},
  name = {\ensuremath{v}},
  description = {velocity}
}

@symbol{a,
  unit = {\si{\metre\per\second\squared}},
  name = {\ensuremath{a}},
  description = {acceleration}
}

@symbol{t,
  unit = {\si{s}},
  name = {\ensuremath{t}},
  description = {time}
}

@symbol{F,
  unit = {\si{N}},
  name = {\ensuremath{F}},
  description = {force}
}
4
  • babel overwrites at begin document. The proper method is to add your changes to the babel languagage via \addto\captionsenglish{ add your redefs here }
    – daleif
    Apr 8, 2021 at 13:15
  • 1
    Here is a relevant example: tex.stackexchange.com/a/373816/3929
    – daleif
    Apr 8, 2021 at 13:16
  • @daleif thanks a lot, that solved the Problem for me! I wish i could find the problem myself but at least i could narrow it down to babel.
    – blackdyn35
    Apr 8, 2021 at 14:18
  • 1
    Note that it is more polite to ask a commenter to write an answer if it solved your problem. Here I'd rather mark it as a duplicate of we can find the right one.
    – daleif
    Apr 8, 2021 at 14:19

1 Answer 1

0

User @daleif postet a working example to the comments.

I'll just copy it here for better readibility:

babel overwrites at begin document. The proper method is to add your changes to the babel languagage via \addto\captionsenglish{ add your redefs here }

Here is a relevant example: tex.stackexchange.com/a/373816/3929

Not the answer you're looking for? Browse other questions tagged .