When I typeset my latex file with pdflatex, I get an output console with this error message:

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdftex)
restricted \write18 enabled.
entering extended mode.  restricted \write18 enabled. (./PaperOne-03-16-19.tex
! Undefined control sequence. 
l.6 \documentclass
  • 2
    You need to use the pdflatex (which loads the LaTeX format) executable, not pdftex (which loads pĺain). – Phelype Oleinik Mar 14 at 18:14
  • 1
    Welcome to TeX.SE. Please tell us which front-end program -- TeXworks, TeXshop, TeXmaker, TeXstudio, etc -- you employ to edit and typeset your LaTeX documents. – Mico Mar 14 at 18:20
  • you give us little in the way of clues looks like your using an old 2015 TeX Live on a file in a subdirectory ? and that file has ? five lines of directives before the class definition ? which is possibly a maths article If your running direct from command line it would help to know if you have a main.tex that's including a number of subfiles and what is FIRST error as shown in main.log plus any FIRST error if there is a /PaperOne….log – KJO Mar 14 at 18:56
  • @supa-mega-ducky-momo-da-waffle you should use a code block not a quote for error messages, line endings are vital to understand tex errors. – David Carlisle Mar 14 at 22:29
  • 1
    @SupaMegaDuckyMomodaWaffle tex error messages are not understandable if you lose the line breaks, eg the one above it is only by the linebreak after the command that shows which command is undefined., the first line shows the line read so far the linebreak is the point of the error and the indented second line is the rest of the source not yet read. if you show it using the quote format all information is lost. – David Carlisle Mar 15 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.