Search code examples
visual-studio-codelatex

Is there a way to disable a specific problem warning in LatexWorkshop?


Recently I've started to experience a problem with LatexWorkshop (an extension of VScode), where the problem warning \include should only be used after \begin{document}. started to appear. My code example is:

\include{configurations.tex}

\begin{document}

   \title{title} 
   \author
   {
      \textbf{Joe}
   }
   \date{\today}
   \maketitle

\end{document}

I keep my configurations in the file configurations.tex to keep the code clean, thus I can't move it inside the \begin function, therefore I'm searching for a way to suppress or disable this specific problem notification.


Solution

  • You shouldn't disable or suppress this warning, you should fix the problem!

    \include is made to include junks of the document body, it will do some magic like automatically starting a new page. What you are looking for is the \input macro:

    \input{configurations}
    
    \begin{document}
    
       \title{title} 
       \author
       {
          \textbf{Joe}
       }
       \date{\today}
       \maketitle
    
    \end{document}