dan-weiss / apa7-latex-cls-source

Source code for apa7 class
LaTeX Project Public License v1.3c
49 stars 13 forks source link

Fails on empty maketitle field #62

Open avidseeker opened 3 months ago

avidseeker commented 3 months ago

apa7.cls warns when a variable among \title, \shorttitle, \author, \course, \professor is not set. However, it also fails showing LaTeX Error: There's no line here to end.

Class apa7 Warning: Due date not defined.

! LaTeX Error: There's no line here to end.

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

l.15 \maketitle

mwe.tex this compiles

\documentclass[stu,a4paper,12pt,nofontenc]{apa7}

\title{test}
\shorttitle{This document compiles}
\author{author}
\course{course}
\professor{professor}
\affiliation{}
\keywords{}

\begin{document}
\maketitle

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod

\end{document}

but clearing any of these values result in the aforementioned error

\documentclass[stu,a4paper,12pt,nofontenc]{apa7}

\title{test}
\shorttitle{shorttitle}
\author{}
\course{course}
\professor{professor}
\affiliation{}
\keywords{}

\begin{documtheseent}
\maketitle

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod

\end{document}