3

The following code demonstrates two types of errors, which I think are fundamentally the same. The code should format as is; now remove the % in front of \usepackage{semantic}. Reformatting fails to produce a PDF file. Now re-comment \usepackage{semantic} and un-comment \usepackage{titling}. Reformatting gives en error involving the footnote in a title. Unfortunately, I need both packages in my document.

\documentclass[book]{combine}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{filecontents}
\usepackage{alltt}
%\usepackage{semantic}
%\usepackage{titling}

% The input articles
\begin{filecontents*}{inputDoc1.tex}
\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{alltt}
\@ifclassloaded{combine}
  {\let\@begindocumenthook\@empty}
  {}
\makeatother
\begin{document}
\title{First article\footnote{my footnote}}
\author{Author of first article}
\maketitle

\section{first section}
\blindtext[3]
\begin{alltt} \(10\sp{-6}\) \end{alltt}\end{document}
\section{Second section}
\end{document}
\end{filecontents*}

\begin{filecontents*}{inputDoc2.tex}
\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{alltt}
\@ifclassloaded{combine}
  {\let\@begindocumenthook\@empty}
  {}
\makeatother
\begin{document}
\title{Second article}
\author{Author of second article}
\maketitle
\section{first section}
\blindtext[1]
\begin{alltt}
 \textbf{deterministic} \textbf{assume}(|A - A'| < \(10\sp{-6}\) and
                      |B - B'| < \(10\sp{-6}\)) \{
   C = parallel_matrix_multiply_float(A, B);\vspace{3pt}
 \} \textbf{assert}(|C - C'| < \(10\sp{-6}\));
\end{alltt}
\end{document}
\end{filecontents*}


% Define abstract to be used in book class (or use report)
% http://tex.stackexchange.com/questions/51483/how-to-write-abstract-and-acknowledgement-in-book-format

% The main document
\begin{document}
\title{The collection}
\author{A. N. Editor}
\date{\today}
\maketitle

\chapter{First chapter}
\section{Introduction}
\ldots
\begin{papers}[]
    \coltoctitle{First article}
    \coltocauthor{Author of first article}
    \import{inputDoc1}
\end{papers}

\chapter{Second chapter}
\section{Introduction}
\ldots
\begin{papers}[]
    \coltoctitle{Third article}
    \coltocauthor{Author of third article}
    \import{inputDoc2}
\end{papers}

\end{document}
3

Problem 1

If you include the titling package, you get an error to do with the footnote in the title. This has to do with the \footnote command being "fragile". A fix is to put

\usepackage[stable]{footmisc}

in your preamble. An explanation is given here.

Use the footmisc package, with package option stable — this modifies footnotes so that they softly and silently vanish away if used in a moving argument."

Problem 2

The source of the error when the semantic package is the minus-signs inside the alltt environments. As Herbert explains here,

it is an endless loop between the math ligature definition of semantic and the handling of \( ...\) of package alltt.

If you turn off the math ligatures using mathligsoff, all is fine.

Fixed code

\documentclass[book]{combine}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{filecontents}
\usepackage{alltt} 
\usepackage{semantic} \mathligsoff
\usepackage[stable]{footmisc}
\usepackage{titling}

% The input articles
\begin{filecontents*}{inputDoc1.tex}
\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{alltt} \mathligsoff
\@ifclassloaded{combine}
  {\let\@begindocumenthook\@empty}
  {}
\makeatother
\begin{document}
\title{First article\footnote{my footnote}}
\author{Author of first article}
\maketitle

\section{first section}
\blindtext[3]
\begin{alltt} \(10\sp{-6}\) \end{alltt}\end{document}
\section{Second section}
\end{document}
\end{filecontents*}

\begin{filecontents*}{inputDoc2.tex}
\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{alltt} \mathligsoff
\@ifclassloaded{combine}
  {\let\@begindocumenthook\@empty}
  {}
\makeatother
\begin{document}
\title{Second article}
\author{Author of second article}
\maketitle
\section{first section}
\blindtext[1]
\begin{alltt}
 \textbf{deterministic} \textbf{assume}(|A - A'| < \(10\sp{-6}\) and
                      |B - B'| < \(10\sp{-6}\)) \{
   C = parallel_matrix_multiply_float(A, B);\vspace{3pt}
 \} \textbf{assert}(|C - C'| < \(10\sp{-6}\));
\end{alltt}
\end{document}
\end{filecontents*}


% Define abstract to be used in book class (or use report)
% https://tex.stackexchange.com/questions/51483/how-to-write-abstract-and-acknowledgement-in-book-format

% The main document
\begin{document}
\title{The collection}
\author{A. N. Editor}
\date{\today}
\maketitle

\chapter{First chapter}
\section{Introduction}
\ldots
\begin{papers}[]
    \coltoctitle{First article}
    \coltocauthor{Author of first article}
    \import{inputDoc1}
\end{papers}

\chapter{Second chapter}
\section{Introduction}
\ldots
\begin{papers}[]
    \coltoctitle{Third article}
    \coltocauthor{Author of third article}
    \import{inputDoc2}
\end{papers}

\end{document}
  • Using negative numbers in \sb does not cause a problem. – Tom Price May 20 '13 at 1:55

Your Answer

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

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