0

I entered the default commands for pretitle and posttitle as defined by the documentation for titling to be:

\pretitle{\begin{center}\LARGE}
\posttitle{\par\end{center}\vskip 0.5em}
\preauthor{\begin{center}
           \large \lineskip 0.5em%
           \begin{tabular}[t]{c}}
\postauthor{\end{tabular}\par\end{center}}

Yet when I do this, I get errors in the form of the red X next to the line of text from Overleaf, stating

unexpected close group } after \begin{center}

for line 1 and

unexpected open group { after \end{center}
unexpected \end{center}
unexpected close group }

for line 2.

I also do not get the expected results when I edit the posttitle or preauthor commands. However, during compile, there are no error. Is this a problem? If so, how would I fix it?

My entire code is below.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{titling}

\pretitle{\begin{center}\LARGE }
\posttitle{\par\end{center}\vskip 0.1em}
\preauthor{\begin{center}
           \large \lineskip 0.5em%
           \begin{tabular}[t]{c}}
\postauthor{\end{tabular}\par\end{center}}
\title{title}
\author{author}
\date{}

\begin{document}
\maketitle
\section{Introduction}
\end{document}
11
  • Welcome to TeX SX! Could you please post a small, but complete, code? – Bernard Mar 19 '20 at 18:44
  • @Bernard I'm unsure what else was to be added so I tried to add code that was small and complete to the best of my ability. Please look above and tell me if this is what you were referring to. – user209429 Mar 19 '20 at 18:48
  • It is what we need (a compilable code) – except it compiles without error. Does this very code produce an error for you? – Bernard Mar 19 '20 at 18:57
  • @Bernard Correct, it produces the errors listed above. The only way I have found to get rid of the errors is to remove the pretitle, posttitle, preauthor, and postauthor fields altogether, which is extremely unhelpful. It is, however, error free other than the errors above. – user209429 Mar 19 '20 at 19:00
  • Just in case: is your installation up-to-date? – Bernard Mar 19 '20 at 19:03

Your Answer

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