gsalzer / subfiles

class and package for multi-file projects in LaTeX
LaTeX Project Public License v1.3c
25 stars 1 forks source link

Subfiles version 2 produces error when compiled #14

Closed raholler closed 3 years ago

raholler commented 3 years ago

OS: Windows 10 tex-distribution: miktex gui: texstudio and texmaker

Minimal working example:

main.tex:

\documentclass[11pt, a4paper, leqno]{article}

\usepackage{subfiles}

\begin{document}

\subfile{test.tex}
\end{document}

test.tex:

\documentclass[main.tex]{subfiles}

blabla

log file

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11) (preloaded format=pdflatex 2020.11.2)  2 NOV 2020 17:53
entering extended mode
**./main.tex
(main.tex
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-10-27> xparse <2020-03-03>
(C:\Users\radostwork\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(C:\Users\radostwork\AppData\Local\Programs\MiKTeX\tex/latex/base\leqno.clo
File: leqno.clo 2016/12/29 v1.2b Standard LaTeX option (left equation numbers)
)
(C:\Users\radostwork\AppData\Local\Programs\MiKTeX\tex/latex/base\size11.clo
File: size11.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
)
\c@part=\count175
\c@section=\count176
\c@subsection=\count177
\c@subsubsection=\count178
\c@paragraph=\count179
\c@subparagraph=\count180
\c@figure=\count181
\c@table=\count182
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(C:\Users\radostwork\AppData\Local\Programs\MiKTeX\tex/latex/subfiles\subfiles.
sty
Package: subfiles 2020/09/07 v2.0 Multi-file projects (package)

(C:\Users\radostwork\AppData\Local\Programs\MiKTeX\tex/latex/import\import.sty
Package: import 2020/04/01  v 6.2
))
(C:\Users\radostwork\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backen
d-pdftex.def
File: l3backend-pdftex.def 2020-09-24 L3 backend support: PDF output (pdfTeX)
\l__kernel_color_stack_int=\count183
\l__pdf_internal_box=\box47
) (main.aux)
\openout1 = `main.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
 (test.tex)
Runaway argument?
! File ended while scanning use of \subfiles@tmp.
<inserted text> 
                \par 
l.7 \subfile{test.tex}

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

)
! Emergency stop.
<*> ./main.tex

*** (job aborted, no legal \end found)

Here is how much of TeX's memory you used:
 462 strings out of 479832
 8765 string characters out of 2868698
 269798 words of memory out of 3000000
 17496 multiletter control sequences out of 15000+200000
 535388 words of font info for 30 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 52i,0n,59p,128b,100s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!
gsalzer commented 3 years ago

When I rewrite your file test.tex to

\documentclass[main.tex]{subfiles}
\begin{document}
blabla
\end{document}

your example typesets without errors.

gsalzer commented 3 years ago

If this was just an error in your MWE, please try version 2.1 (subfiles.sty and subfles.cls in the top directory of this repository).

raholler commented 3 years ago

Thank you for the quick response, so far it worked without the the document environment. My bad for not trying this. This worked.