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   }
         %
  • 2
    \tikzstyle is pretty weird and deprecated you could try tikzset instead https://tex.stackexchange.com/questions/174772/cant-find-the-documentation-for-tikzstyle-or-operator-in-tikz – David Carlisle Jul 18 '18 at 20:28

1 Answers1

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.

David Carlisle
  • 757,742
  • 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 Jul 19 '18 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 – David Carlisle Jul 19 '18 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 Jan 31 '20 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 Jan 31 '20 at 10:12
  • Not sure whether it is too late to revive this question, but I have added a MWE in the comment above. unfortunately I don't know how to make the code format correctly in the comment. Should I simply create a brand new question, with he concise MWE? – Jim Newton Jan 31 '20 at 10:23
  • @JimNewton posting code in comments doesn't really work, as you see, it is better to edit the question. But it is quite common that after an error you need to delete intermediate generated files (typically .aux but also package specific ones such as .sta) – David Carlisle Jan 31 '20 at 10:24
  • Thanks David, but it is my understanding that latexmk is supposed to be smart enough to handle that. I.e., it should know know that the .sta file depends on the .ltx file etc... – Jim Newton Jan 31 '20 at 10:27
  • 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. – David Carlisle Jan 31 '20 at 10:30
  • @DavidCarlisle I don;'t think this is related to latexmk it is more related to how the latex process is stopped, see Jims new question. Depending how you react yo the error \endstandalonepreambles is somethimes written to the .sta file and othertimes not. And everything goes wrong if that line is not present. – daleif Jan 31 '20 at 11:01