Theses, Books, Title pagesLegrand Orange: Cannot include appendix section

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
kishalay
Posts: 3
Joined: Mon Jan 23, 2017 6:46 am

Legrand Orange: Cannot include appendix section

Post by kishalay »

I have been using the Legrand Orange book template for my work, along with xelatex (texlive) on Ubuntu. Everything was fine when I was using normal chapters as given in the example main.tex file included with the template. But, when I tried to include Appendix chapters, it stopped working. I tried both \appendix as well as the appendix package (I added \usepackage[titletoc]{appendix} to the structure.tex file). Neither work and the compilation error is the same. My Notes.tex file (equivalent to the main.tex in the template) is shown below:

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% THIS DOCUMENT IS GENERATED USING TEXLIVE XETEX PACKAGE %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt,fleqn]{book}

% The main typesetting template for the book
\input{structure}

\begin{document}

%%%%%%%% DOCUMENT TITLE %%%%%%%%
\begingroup
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\coordinate [below=5.025in, left=-1in] (midpoint) at (current page.north); % position in the page where title box appears
\node at (current page.north west)
{\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (0,0) {\includegraphics[height=\paperheight,width=\paperwidth]{background}}; % Background image
\draw[anchor=north] (midpoint) node [fill=ocre!30!white,fill opacity=0.6,text opacity=1,inner sep=1.175in]
{\Huge\centering\bfseries\parbox[c][][t]{\paperwidth}
{\centering \textsc{Computer Science Notes \& Primers}\\[20pt] % Book title
{\huge My Name}}}; % Author name
\end{tikzpicture}};
\end{tikzpicture}
\vfill
\endgroup


%%%%%%%% TABLE OF CONTENTS %%%%%%%%
\chapterimage{chapter_head_2.pdf} % Table of contents heading image
\pagestyle{empty} % No headers
\tableofcontents % Print the table of contents itself
\cleardoublepage % Forces the first chapter to start on an odd page so it's on the right
\pagestyle{fancy} % Print headers again

%%%%%%%% DOCUMENT BODY %%%%%%%%

%\part{Algorithm and Data-Structure Notes}
%\input{Algorithms}

\part{Coding Questions}
\input{Coding}

%\part{Game Design Notes}
%\input{Gaming}

%\part{Linear Algebra Notes}
%\input{LinearAlgebra}

%\part{Finite Element Method}
%\input{FiniteElements}

\begin{appendices}
\part{Mathematical Concepts in Algorithms}
\input{AppendixAlgoMaths}
\end{appendices}

\end{document}
The AppendixAlgoMaths.tex is as follows:

Code: Select all

\chapter{Mathematical Concepts in Algorithms}
\markright{}
\label{algomaths}

\section{Summations}
\label{algo-summations}
When an algorithm contains iterative control constructs like \texttt{while} or \texttt{for} loops, we can express its running times in terms of sum of times spent in the loops. When we evaluate these summations, we obtain performance bounds ($O$, $\Theta$ or $\Omega$). This section contains some of the concepts of these summations. For a list of $n$ numbers $a_0, a_1, a_2, \dots, a_{n-1}$, we can designate their sum as $\sum\limits_{i=0}^{n-1} a_i$. When the sequence is infinite, the sum becomes $\sum\limits_{i=0}^{\infty} a_i$ or $$\lim_{i\to\infty}$$ $\sum\limits_{i=0}^{n-1} a_i$. If the limit exists, then the series \textbf{converges}; otherwise, it \textbf{diverges}.\\

\textbf{Linearity}\\
For any real number $c$ and finite sequences $a_0, a_1, a_2, \dots, a_{n-1}$ and $b_0, b_1, b_2, \dots, b_{n-1}$,
\begin{equation}
\sum\limits_{i=0}^{n-1} (ca_i + b_i) = c\sum\limits_{i=0}^{n-1} a_i + \sum\limits_{i=0}^{n-1} b_i
\end{equation}
The compilation error is as follows. I have included only the last few lines:

Code: Select all

No file Notes.ptc.
[21] [22] (./AppendixAlgoMaths.tex
Appendix A.
<use  "Pictures/chapter_head_2.pdf" >
! Missing number, treated as zero.
<to be read again> 
                   A
l.1 \chapter{Mathematical Concepts in Algorithms}
I looked up online and there are some known issues of compatibility between the babel/hyperref and appendix packages, specifically the order in which they are included. There were numerous suggestions, but none of them worked for me. I have included the appendix package before as well as after the babel package, as well as after the hyperref and bookmark packages in structure.tex, but the compilation error persists. I understand that there is some resetting counter that needs to be taken care of, but I have no idea what the exact commands or steps are.

If someone can shed some light on this, I would be much obliged.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Legrand Orange: Cannot include appendix section

Post by Johannes_B »

I don't see any problem. Please provide a minimal working example so we can reproduce the issue.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
kishalay
Posts: 3
Joined: Mon Jan 23, 2017 6:46 am

Legrand Orange: Cannot include appendix section

Post by kishalay »

I have provided a zipped folder containing a minimal example along with the (slightly modified) structure.tex I use.
Attachments
sample.zip
(159.96 KiB) Downloaded 178 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Legrand Orange: Cannot include appendix section

Post by Johannes_B »

line 519 in structure.tex reads \@Roman\thechapter. Make it just \thechapter.
I'll check if this is in the originla template and ping the people to change it.

EDIT: I checked, your mistake ;-)

If you want to have Roman chapter numbers in the main part, use \renewcommand{\thechapter}{\Roman{chapter}}.
That will collide with part numbers of the original template, though.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
kishalay
Posts: 3
Joined: Mon Jan 23, 2017 6:46 am

Legrand Orange: Cannot include appendix section

Post by kishalay »

That worked perfectly. Thank you very much Johannes. I was also able to reformat the chapter and section numberings, based on your last suggestion. I have been using latex a long time, but I am a neophyte when it comes to templating and formatting issues. That obviously bit me when I tinkered with the structure.tex file :)

Thanks again.
Post Reply