slatex / sTeX

A semantic Extension of TeX/LaTeX
49 stars 9 forks source link

figurename not loaded (babel misbehaves). #338

Open kohlhase opened 2 years ago

kohlhase commented 2 years ago

When we removed hwexam.cls, we also lost the language handling in the class. So I am currently using

\documentclass{article}
\usepackage[lang=de,12pt,pts,notes,hints,multiple]{hwexam}

for exams. But the lang= option is never handled. I have already tried passing the lang option to stex.sty, but that does not seem to help either.

I am testing this on MathHub/MiKoCourses/IWGS/source/SS22/exam.tex to see whether babel is loaded, and currently it is not.

I need this for the IWGS exam next week.

kohlhase commented 2 years ago

Maybe a better (more consistent) way of doing things is to let problem.sty handle the lang option, since it loads the stex package.

kohlhase commented 2 years ago

Currently I manually load babel in the exam file. That needs to be commented out for testing.

Jazzpirate commented 2 years ago

might be fixed now (just pushed); please test

kohlhase commented 2 years ago

Almost: babel.sty and babel-ngerman.sty are loaded, but not hwexam-ngerman.ldf. Also we get the error:

Package babel Warning: \figurename not set for 'ngerman'. Please,
(babel)                define it after the language has been loaded
(babel)                (typically in the preamble) with:
(babel)                \setlocalecaption{ngerman}{figure}{..}
(babel)                Reported on input line 20.

and indeed the figure is not correct (this is very weird).

Screenshot 2022-07-21 at 10 40 06
Jazzpirate commented 2 years ago

turns out, the standalone package for some reason load graphicx, and standalone is laoded before babel is. I switched that around, but that doesn's solve the problem either. I have no idea which package would be responsible for setting the locales for the babel language. All packages loaded before babel/ngerman.ldf:

article.cls l3keys2e keyval amssymb amsfonts ltxcmds xspace

...I'm almost sure none of them are responsible, except maybe article.cls, but since \usepackage{babel} generally works after \documentclass{article}, I'm at a loss...

The missing .ldf files are fixed (push coming)

kohlhase commented 2 years ago

The missing .ldf files are fixed (push coming)

very good. This is the important thing.

The figurename we should keep in mind though.

...I'm almost sure none of them are responsible, except maybe article.cls, but since \usepackage{babel} generally works after \documentclass{article}, I'm at a loss...

can't you see this from the log file? That should tell us what is loaded when.

Jazzpirate commented 2 years ago

can't you see this from the log file? That should tell us what is loaded when.

Yes, that's where I got the above list from

Jazzpirate commented 2 years ago

Turns out, \figurename is defined in the official babel-provided ngermanb.ldf already. I'm even more confused now

kohlhase commented 2 years ago

Actually that only defines \@namedef{@captionsngerman}{%, which in turn defines \figurename. Maybe that is not triggered? Or overwritten later?

Jazzpirate commented 2 years ago

It has to be triggered, given that babel explicitly complains about no figurename existing for specifically ngerman. So as far as I can tell, the whole suite of ngerman-keywords would have to be loaded. No idea how that works internally though. I'll put it on my long-term stack of things-to-investigate