I'm trying to get started writing in LaTeX and have the following simple document skeleton:



\title{Test Document}
\author{Test Author}
\date{April 2018}


\chapter {Chapter 1}


However, documentclass, frontmatter, date, maketitle and mainmatter are all displayed in red and do not work properly. In particular, \documentclass{book} should create a new title page by default but does not. \documentclass[titlepage]{book} and \documentclass[titlepage]{article} do not. newpage and pagebreak do not do anything no matter where I put them. Even copying the example book layout from Wikibooks produces this behavior.

Where have I gone wrong with such a simple document and how do I fix it? I'm using Debian Buster if it matters.

  • 3
    Welcome to TeX.SE! First of all, is this an April joke? If not, how do you compile your snippet? When I compile it with pdflatex, everything seems fine. Nothing is red (no joke ;-). – user121799 Apr 1 '18 at 1:38
  • 4
    Works fine for me. – John Kormylo Apr 1 '18 at 1:38
  • 1
    Works fine for me as well. – Mico Apr 1 '18 at 2:02
  • 3
    @klasdfjasdf I would be very interested where you found the advice to use pandoc test.tex -o test.pdf. You are the second person in a few days reporting issues with this. – Henri Menke Apr 1 '18 at 5:10
  • 4
    I'm voting to close this question as off-topic because pandoc is not a TeX engine. – Henri Menke Apr 6 '18 at 5:15

The problem is that you are trying to process the file with pandoc instead of a LaTeX engine. So what you think the workflow is, is


but the actual workflow is

LaTeX ⇒ (pandoc internal structure ⇒ LaTeX) ⇒ PDF

Unfortunately, the pandoc internal structure is not as feature rich as LaTeX and basically everything about your document gets lost in the process.

You can actually see what kind of LaTeX code pandoc emits by using

pandoc test.tex -s -o pandoc-gen.tex

My version of pandoc ( generates something which has hardly anything in common with the input LaTeX:

\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\else % if luatex or xelatex
% use upquote if available, for straight quotes in verbatim environments
% use microtype if available
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
            pdftitle={Test Document},
            pdfauthor={Test Author},
            pdfborder={0 0 0},
\urlstyle{same}  % don't use monospace font for urls
}{% else
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em}  % prevent overfull lines
% Redefines (sub)paragraphs to behave more like sections

\title{Test Document}
\author{Test Author}
\date{April 2018}




\section{Chapter 1}\label{chapter-1}


  • 1
    I appreciate your knowledge and explanation, but I think you have to replace "LaTeX" with "pdflatex" just for non-familiar future users of LaTeX. So that they will not get confused when the output will be .dvi instead of .pdf (+1) – koleygr Apr 1 '18 at 8:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.