0

I'm trying to achieve a specific behavior between global and local options within my own class. The example below does not work as intended. Other attempts also failed.

\begin{filecontents*}[overwrite]{foo.cls}
\ProvidesClass{foo}[2022/07/30 v1.0.0 class foo (RN)]
\PassOptionsToPackage{english,ngerman}{babel}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions*\relax
\LoadClass{article}
\RequirePackage{babel}
\endinput
\end{filecontents*}
\documentclass[12pt,english]{foo}%  (1)
%\documentclass[12pt,ngerman]{foo}%  (2)
%\documentclass[12pt]{foo}%          (3)
%\documentclass[12pt,french]{foo}%   (4)
\begin{document}
  \typeout{************ The language is: \languagename}
\end{document}

I want to achieve the following:

  • (1) Main language: english, secondary language: ngerman
  • (2) Main language: ngerman, secondary language: english
  • (3) Main language: ngerman, secondary language: english
  • (4) Main language: french, secondary language: english, (possibly further secondary language: ngerman)

Thanks for your help.

rolfn
  • 939
  • 4
  • 13
  • you are not passing the language to babel, the options passed to article are not added as class options. See also https://tex.stackexchange.com/q/147243/2388 – Ulrike Fischer Jul 30 '22 at 19:29
  • @Ulrike Fischer: Many Thanks. Your experience with the problem helps me. I can now close the request. – rolfn Jul 30 '22 at 20:02

0 Answers0