0

My minimum code necessary to replicate the error is just three lines:

\input{report_template.cls}

\begin{document}

\end{document}

I suspect its a problem with the "report_template.cls" however, this is the template we are required to use. Is there an easy work around for this type of error?

Error output in Overleaf:

Extra \endgroup.

\document ->\endgroup \document@inithook \true@sw {}\UseOneTimeHook {begindo... l.3 \begin{document}

LaTeX Error: Missing \begin{document}.

No \begin{document} command was found. Make sure you have included \begin{document} in your preamble, and that your main document is set correctly.

l.3 \begin{document}

The template ".cls" file contains the following code:

\NeedsTeXFormat{LaTeX2e}

%\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}} %\ProcessOptions\relax

%\LoadClass[a4paper,11pt]{report}

\documentclass[% reprint, amsmath,amssymb, aps, floatfix ]{revtex4-2}

\RequirePackage{PRL-lab} \usepackage[caption=false]{subfig} \usepackage{natbib} \bibliographystyle{WLreferences}

\endinput

physBa
  • 31
  • Not without knowing what's in report_template.cls! – Ian Thompson Dec 14 '21 at 13:49
  • 5
    Erh, one does not \input a class try \documentclass{report_template} – daleif Dec 14 '21 at 13:49
  • please provide a test that produces the error, the above produces ! LaTeX Error: File \report_template.cls' not found.but using\inputwith a.cls` file looks wrong. – David Carlisle Dec 14 '21 at 14:19
  • @DavidCarlisle I have fixed my post to include the error message – physBa Dec 14 '21 at 14:26
  • That is still no use to anyone trying to help. why are you using \input with a .cls file? that is almost certainly wrong. every other .cls file in the tex distribution is used as \documentclass{file} not \input{file.cls} But if you want people to reproduce the error as you say in the question you need to show the report_template.cls file. – David Carlisle Dec 14 '21 at 14:34
  • That said it is possible that your question is a duplicate of https://tex.stackexchange.com/questions/568112/document-endgroup-error – David Carlisle Dec 14 '21 at 14:36
  • @DavidCarlisle I have added the code for the .cls file. I'm unsure why it's included in that way, this is all from the default file we are supplied by my university as a template for our reports – physBa Dec 14 '21 at 14:38
  • so it is a duplicate of the linked one, reference an updated revtex (and tell whoever maintains that template to rename it to .tex !!!) – David Carlisle Dec 14 '21 at 14:44
  • I've tried renaming it to .tex. What do you mean by referencing an updated revtex? It is referencing 4-2 which I think is the latest version – physBa Dec 14 '21 at 14:49
  • yes but (most likely) you are using an older version of revtex4-2 as the current version was updated to fix this check your log for the revtex version, it should say 2020/10/03 4.2e – David Carlisle Dec 14 '21 at 14:55

0 Answers0