0

I don't understand which file has the missing brace. Can someone help me understand this error message? Is it complaining about the thesis.sta file?

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./thesis.ltx
LaTeX2e <2018-04-01> patch level 5
(/usr/local/texlive/2018/texmf-dist/tex/latex/extsizes/extreport.cls
Document Class: extreport 1996/10/08 v1.0 Non Standard LaTeX document class
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo)
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/exscale.sty))
(./usepackages.ltx
(/usr/local/texlive/2018/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/ifxetex/ifxetex.sty))

Package geometry Warning: Over-specification in `h'-direction.
    `width' (433.62pt) is ignored.


Package geometry Warning: Over-specification in `v'-direction.
    `height' (578.15999pt) is ignored.

(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/booktabs/booktabs.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/standalone/standalone.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/tools/shellesc.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2018/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2018/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/currfile/currfile.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/filehook/filehook.sty))
(./thesis.sta)
! Extra }, or forgotten \endgroup.
l.555   }
         %
? 

When I remove the thesis.sta file, it compiles fine. However, I don't see any error in the .sta file. Here is its content.

\standalonepreambles
\subpreamble{fig-3.tex}
\usepackage {tikz}\usetikzlibrary {arrows.meta, automata, bending, positioning, shapes.misc}\tikzstyle {automaton}=[shorten >=1pt, >={Stealth[bend,round]}, initial text=]\tikzstyle {accepting}=[accepting by arrow]
\endsubpreamble
\subpreamble{fig-7.tex}
\usepackage {tikz}\usetikzlibrary {arrows.meta, automata, bending, positioning, shapes.misc}\tikzstyle {automaton}=[shorten >=1pt, >={Stealth[bend,round]}, initial text=]\tikzstyle {accepting}=[accepting by arrow]
\endsubpreamble

I'm adding a MWE.

\documentclass{article}
\usepackage[subpreambles=true]{standalone}
\begin{document}
test
} %% this is an error, and will correctly cause compilation to fail, but remove it and complilation still failes until you remove the mwe.st
\end{document}

To reproduce this, compile using latexmk --pdf mwe.ltx. An error is reported because of too many closing } characters. Fix the error, and re-run latexmk, to see the error:

(./mwe.sta)
! Extra }, or forgotten \endgroup.
l.555   }
         %
1

1 Answer 1

2

If you copy that text into any editor and type a closing ) it should show you that the nearest unmatched ( is the line

(/usr/local/texlive/2018/texmf-dist/tex/latex/standalone/standalone.sty

so the error is detected at the } on line 555 of standalone.sty which is

\begingroup
  \setbox\@tempboxa\hbox{%
    \makeatother
    \InputIfFileExists{\jobname.sta}{}{\PackageInfo{standalone}{STA file not found!}{}{}}%
  }%

which matches what is shown in the log, just after \jobname.sta has been read as shown by

(./thesis.sta)

but that just means some code that you have earlier, possibly the code in thesis.sta is corrupt.

9
  • The problem almost always happens if latex can't find a file and asks me interactively for the correct file name. At that point I enter x, to exit, prepare the latex file with the correct spelling of the include file or correct extension, etc, then relaunch latexmk. It errors at the point explained above. The workaround is to remove the .pdf and the .sta, and try again. I was just wondering whether this is perhaps a real error that I should fix, or perhaps an error in some include file such as standalone.sty?
    – Jim Newton
    Commented Jul 19, 2018 at 11:38
  • @JimNewton you haven't shown an example that makes an error so hard to debug but it is almost certainly an error in your input not in standalone even though it is detected while processing standalone.sty Commented Jul 19, 2018 at 12:33
  • Here is the latex code which causes the problem. The code contains an error, an extra closing }. To reproduce, name the file mwe.ltx; compile it with latexmk --pdf mwe.ltx This causes an expected compilation error. Fix the error and re-run latexmk. ``` \documentclass{article} \usepackage[subpreambles=true]{standalone} \begin{document} test } %% this is an error, and will correctly cause compilation to fail, but remove it and complilation still failes until you remove the mwe.st \end{document} ```
    – Jim Newton
    Commented Jan 31, 2020 at 10:08
  • On running latexmk on the corrected file, I see the following error ``` (./mwe.sta) ! Extra }, or forgotten \endgroup. l.555 } % ```
    – Jim Newton
    Commented Jan 31, 2020 at 10:12
  • 2
    @JimNewton I don't know anything about latexmk, but it could know about .aux which is a standard latex thing but it would be surprising if it knows about .sta which is specific to the package you are using. But either way it's a question about latexmk unrelated to the specifics of latex, so you should ask a new question Sorry I can't help I have used tex for 30 years or so but only used latexmk a couple of times. Commented Jan 31, 2020 at 10:30

You must log in to answer this question.

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