When compiling a subfile, the packages used in the main file's preamble cannot see the options passed to the main file's \documentclass. They see the only option (the main file's path) of the subfiles class instead. Some packages (e.g., geometry, typearea, translator, babel) process these global options and will thus behave differently when a subfile and the main file are compiled, respectively.
Expected behaviour: When compiled with pdflatex main and pdflatex sub, both PDFs contain “Kapitola 1” (Slovak for “Chapter 1”).
Actual behaviour: sub.pdf contains “Chapter 1” and “LaTeX Warning: Unused global option(s): [slovak].” is issued during compilation. However, main.tex is compiled without warnings and main.pdf contains “Kapitola 1”.
Options given to the first class loaded are stored in the \@classoptionslist macro. The first class is detected by the test \ifx\@classoptionslist\relax in LaTeX source file N, line 385 (in version v1.3i). So one possible fix would be to add
When compiling a subfile, the packages used in the main file's preamble cannot see the options passed to the main file's
\documentclass
. They see the only option (the main file's path) of thesubfiles
class instead. Some packages (e.g.,geometry
,typearea
,translator
,babel
) process these global options and will thus behave differently when a subfile and the main file are compiled, respectively.main.tex
:sub.tex
:Expected behaviour: When compiled with
pdflatex main
andpdflatex sub
, both PDFs contain “Kapitola 1” (Slovak for “Chapter 1”).Actual behaviour:
sub.pdf
contains “Chapter 1” and “LaTeX Warning: Unused global option(s): [slovak].” is issued during compilation. However,main.tex
is compiled without warnings andmain.pdf
contains “Kapitola 1”.Options given to the first class loaded are stored in the
\@classoptionslist
macro. The first class is detected by the test\ifx\@classoptionslist\relax
in LaTeX source file N, line 385 (in version v1.3i). So one possible fix would be to addjust before
in line 8 of
subfiles.cls
.