1

I get this error when trying to compile a pdf with Lyx 2.1:

This is pdfTeX, Version 3.1415926-2.6-1.40.14 (TeX Live 2014/dev) (format=latex 2015.4.2)  28 JUL 2015 12:45 entering extended mode  restricted \write18 enabled.  %&-line parsing enabled.
**rationale.tex (./rationale.tex LaTeX2e <2011/06/27> Babel <3.9h> and hyphenation patterns for 2 languages loaded.

(/usr/share/texlive/texmf-local/texmf-compat/tex/latex/evergent/article.cls

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation. Type  H <return>  for immediate help.  

...                                    

                                                   l.1 <
     script>window.googleJavaScriptRedirect=1</script><script>var m={navigat...

You're in trouble here.  Try typing  <return>  to proceed. If that doesn't work, type  X <return>  to quit."

Here is the output .tex file minimal example:

%% LyX 2.1.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\begin{document}
Test
\end{document}

It generates the same error for compilation.

9
  • The main error is: ! LaTeX Error: Missing \begin{document}. Check the latex file you are working on and make sure it contains \begin{document]
    – Leucippus
    Jul 28, 2015 at 19:02
  • @Leucippus He's using LyX, so it's impossible to avoid having \begin{document}, I think. Jul 28, 2015 at 19:36
  • deamondave: Have you added anything to the preamble, and if yes, what? Can you make a minimal example (basically make a copy of your file and remove as much content and custom setup as possible without removing the error), export that to LaTeX code, and add it to your question? Jul 28, 2015 at 19:39
  • yes. Lyx on Fedora 20.
    – daemondave
    Jul 28, 2015 at 19:39
  • 2
    latex didn't even finish reading article.cls. is there anything in the .tex file before the \documentclass line? something that includes a <script>, for instance? (i'm totally ignorant about lyx, but when the log complains about line 1, ...) Jul 28, 2015 at 19:53

1 Answer 1

2

The situation seems quite clear: the article.cls file is fetched from

/usr/share/texlive/texmf-local/texmf-compat/tex/latex/evergent/

while it should be in

/usr/share/texlive/texmf-dist/tex/latex/base/

Somebody or something installed some texmf-compat subtree under texmf-local and this is the cause of your problem. Possibly the cause is having installed LaTeX2HTML, which is an obsolete and unsupported program.

You must log in to answer this question.

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