I'm experiencing LaTeX errors while formatting documentation for a
software project.
LaTeX is called via make; make stops with a ''! LaTeX Error: There's no
line here to end.'' This is really annoying since the make command often
runs unattended.
The problem seems to be related to the fancyhdr-package I introduced
recently.
I'm using teTeX 0.3.3pl8 on Linux.
The following LaTeX Source causes the error:
--------------------------------------------
\documentclass[10pt]{report}
\usepackage{german}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{vmargin}
\usepackage{longtable}
\usepackage{html}
\usepackage{graphicx}
\usepackage{makeidx}
\sloppy
\def\datum{04.05.98}
\def\version{1.3}
\def\doctype{Design Specification}
\def\docstatus{DRAFT}
\def\datei{\textsf{foo/bar.tex}}
\def\descr{FOO BAR Specification}
\pagestyle{fancy}
% ''vmargin.sty'' defs
\setpapersize{A4}
% begin ''fancyhdr'' defs
\renewcommand{\headrulewidth}{0.5pt}
\lhead{\footnotesize{Version {\bf \version}}\\\footnotesize{vom/of
\datum}\\\datei}
\chead{}
\rhead{\nouppercase{\footnotesize{\descr\\\leftmark\\\rightmark}}}
\renewcommand{\footrulewidth}{0.5pt}
\lfoot{\tiny{Foo Bar Institute\\M"onchebergstr. 19, D-34123 Kassel\\Tel.
+49-561-804-1223}}
\cfoot{\tiny{All rights reserved for this document.\\Not to be published
in any way\\
without written permission.}}
\rfoot{\footnotesize{Seite/Page {\bf \thepage}\\ von/of
\pageref{LastPage}}}
% end ''fancyhdr'' defs
\title{\doctype\\\descr\\Version \version\\\docstatus}
\author{Daniel Bischof, PAP-E\\\texttt{dan...@ap-kas.ie.philips.com}}
\date{\datum}
\begin{document}
\maketitle
\begin{center}
\begin{footnotesize}
\begin{tabular}{|l|l|l|l|}
\hline
\multicolumn{3}{|c|}{{\bf Versionstabelle}}\\ \hline \hline
{\bf 26.11.97} & {\bf Version 1.0} & {\bf first version}\\\hline
{\bf 20.02.98} & {\bf Version 1.1} & {\bf second version}\\\hline
{\bf 09.04.98} & {\bf Version 1.2} & {\bf third version}\\\
{\bf 04.05.98} & {\bf Version 1.3} & {\bf fourth version}\\\hline
\hline
\end{tabular}
\end{footnotesize}
\end{center}
\tableofcontents
\end{document}
-------------------------------------------------------------------
When commenting out the lines between the begin/end ''fancyhdr'' defs,
the error
vanishes.
Any ideas?
Regards,
D.B.
+=====================+======================================+
| Daniel Bischof | e-mail: dan...@ap-kas.ie.philips.com |
| Philips | phone: +49-561-501-1736 |
| Automation Projects | dept: +49-561-501-1223 |
| Kassel, Germany | fax: +49-561-501-1688 |
+=====================+======================================+
PGP fingerp = BE 96 53 49 60 60 ED 5B A2 66 21 71 D7 B0 88 06
-=> Escape the Gates of Hell - http://www.linux.org/ <=-
Take care! I've forged my e-mail address because of spam. Please use the
address
stated in my .signature.
DB> Dear people at comp.text.tex,
DB> I'm experiencing LaTeX errors while formatting documentation for a
DB> software project.
DB> LaTeX is called via make; make stops with a ''! LaTeX Error: There's no
DB> line here to end.'' This is really annoying since the make command often
DB> runs unattended.
You can make it less annoying by using \batchmode.
DB> The problem seems to be related to the fancyhdr-package I introduced
DB> recently.
DB> \rhead{\nouppercase{\footnotesize{\descr\\\leftmark\\\rightmark}}}
^^^^^^^^^^^^
The \leftmark sometimes is empty (like on the table of contents). So that
gives the errormessage. This can be solved by inserting something
invisible, like a space, empty box or empty rule.
\rhead{\nouppercase{\footnotesize{\descr\\\leftmark\ \\\rightmark}}}
By the way, you will have to increase \headheight:
\setlength{\headheight}{31pt}
--
Piet van Oostrum <pi...@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: Piet.van...@pi.net
Hey, it works!
Thank you for your support!
Thanassi Protopapas
prot...@scilearn.com
Piet van Oostrum wrote:
>
> >>>>> Daniel Bischof <hu...@nospam.com> (DB) writes:
>
> DB> Dear people at comp.text.tex,
> DB> I'm experiencing LaTeX errors while formatting documentation for a
> DB> software project.
> DB> LaTeX is called via make; make stops with a ''! LaTeX Error: There's no
> DB> line here to end.'' This is really annoying since the make command often
> DB> runs unattended.
>
> You can make it less annoying by using \batchmode.
>
> DB> The problem seems to be related to the fancyhdr-package I introduced
> DB> recently.
>
> DB> \rhead{\nouppercase{\footnotesize{\descr\\\leftmark\\\rightmark}}}
> ^^^^^^^^^^^^
>
> The \leftmark sometimes is empty (like on the table of contents). So that
> gives the errormessage. This can be solved by inserting something
> invisible, like a space, empty box or empty rule.
>
> \rhead{\nouppercase{\footnotesize{\descr\\\leftmark\ \\\rightmark}}}
>
AP> To get around a similar situation I inserted a \strut in my header
AP> definition
AP> so that it would not end up completely empty in case the macro in it was
AP> empty.
AP> Is this somehow inappropriate, dangerous, or not preferable?
None of these. My suggestions were:
inserting something invisible, like a space, empty box or empty rule.
And a \strut is just an empty rule. Just typing \strut is more characters
to type than \ , so that's why I choose the latter. Of course this reply
costs me more typing than what I had saved :=)