2

Following the discussion started here and also related to this question, I'd like to know different opinions about what could be long document structures (books, PhD. theses, etc.), with focus on:

  1. relative locations in the document of:
    • introduction chapter,
    • ordinary chapters,
    • conclusion chapter,
    • appendix chapters,
  2. LaTeX strategies in case of unnumbered introduction and conclusion.

Below, I expose what sounds reasonable to my eyes and I hope other opinions will confirm or reverse mine.

IMO, the order should be:

〈introduction〉
〈ordinary chapters〉
〈conclusion〉
〈appendix chapters〉

and, particularly, 〈conclusion〉 should come before 〈appendix chapters〉 which may be very long.

Then arises the question of (un)numbering these stuffs. IMO, it is legitimate to want the introduction numbered or unnumbered but then, by symmetry, so should be the conclusion.

It is possible to achieve unnumbered introduction and conclusion by putting the former in the front matter and the latter in the back matter:

\frontmatter
...
〈introduction〉
\mainmatter
〈ordinary chapters〉
\backmatter
〈conclusion〉
\appendix
〈appendix chapters〉
...

Two problems with this:

  1. the introduction, conclusion (and appendix) chapters will be unnumbered but not their subsequent (sub(sub))sections,
  2. the appendix chapter will be unnumbered, which is not desirable in general (and, in this case, \appendix is completely useless).

I looked for a better way to achieve this but I wonder if there are even better strategies.

EDIT: It must be noticed that I could here make use of personal macros but I try to avoid them and keep (possibly patched) standard macros in order to keep the "structure" features of editors (RefTeX in Emacs, "Structure View" in TeXstudio, etc.)

  • There is no general rule about (unnumbered) portions of a document, it depends on rules the publisher demand. As for using unnumbered chapters or something like that in LateX: By redefinition of the counter formats or using it is possible to prevent the printing of section counters. – user31729 Feb 26 '14 at 18:01
  • @jon With standard classes, usual ways to make sections in a conclusion and/or introduction unnumbered have serious drawbacks IMHO (see the first link of my question). Unfortunately, I have to use the book class (the personal class I'm working on since months is based on it). And I don't forget other stuffs in the front (preface, acronyms, disclaimer, etc.) and back (bibliography, glossary, index, etc.) matters :) – Denis Bitouzé Feb 26 '14 at 18:07
  • @Christian I am aware of the redefinition of the counter formats, e.g. with tocvsec2 package (see the first link of my question) but egreg advised me to instead put unnumbered stuffs outside the main matter (which has drawbacks), hence the current question. – Denis Bitouzé Feb 26 '14 at 18:10
  • I think, appendices and conclusions shouldn't be part of the backmatter, which is in my opinion reserved for glossaries, index, bibliography, etc. – Henri Menke Feb 26 '14 at 19:27
  • 2
    @DenisBitouzé I normally use the KOMA classes, which offer the macros \addpart, \addchap and \andsec, which work like \chapter, etc. except that the are unnumbered. They thus produce both a running heading and an entry in the table of contents. – Henri Menke Feb 26 '14 at 21:07
2

I suspect you won't really like this answer in all its details, but, judging by your linked to question, I'd like to suggest that you are missing out on LaTeX' ability to abstract from generic commands, which is especially true when you define your own class and/or system of commands. If you don't like what \chapter, \chapter*, \section, and \section* do by default, why do you want to use the exact same command names in your own document?

I'd suggest instead: make meaningful commands that semantically indicate their function. Why not have a command like \introduction and \conclusion if their behaviour is supposed to be visibly different from a generic chapter? Since they should be unnumbered and yet appear in the ToC and in the header, let's just create commands that do that, rather than bending \chapter(*) to do all its normal things and also do the new things? The following is a very simple-minded implementation of this idea. It could be fine-tuned in several respects, I'm sure, but as I don't know the overall aesthetic look you are aiming for, I stick as much to the defaults as possible (aesthetically and package-wise).

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage[titletoc, page, header]{appendix}
\usepackage{hyperref}
% \usepackage{bookmark} % <-- offers a lot more flexiblity

% NOTE: the formatting will need to be changed for the \mark* stuff;
% perhaps with fancyhdr
\newcommand{\introduction}[1]{%
  \chapter{#1}%
  \markboth{#1}{#1}}

\newcommand{\Chapter}[1]{%
  \chapter*{#1}%
  \markboth{#1}{#1}%
  \addcontentsline{toc}{chapter}{#1}}

\newcommand{\Section}[1]{%
  \section*{#1}%
  \markright{#1}%
  \addcontentsline{toc}{section}{#1}}

\newcommand{\conclusion}[1]{%
  \chapter*{#1}%
  \markboth{#1}{#1}%
  \addcontentsline{toc}{chapter}{#1}}


\begin{document}

\frontmatter

\tableofcontents

\introduction{Introductory Information}
\lipsum[1-10]

\Section{Introductory section}
\lipsum[1-10]

\mainmatter

\chapter{Numbered chapter}
\lipsum[1-10]
\section{Numbered section}
\lipsum[1-10]

\chapter{Numbered chapter (bis)}
\lipsum[1-10]
\section{Numbered section (bis)}
\lipsum[1-10]

\chapter*{Unnumbered chapter}
% this will not appear in ToC or the header, by default
\lipsum[1-10]
\section{Numbered section in unnumbered chapter}% <-- obviously this makes no sense; it thus appears in the 'wrong' place in the ToC
\lipsum[1-10]


\Chapter{Unnumbered chapter (bis)}
% this is (questionably) defined to appear in ToC and header...
\lipsum[1-10]
\section{Numbered section in unnumbered chapter (bad idea)}% <-- obviously this makes no sense; it thus appears in the 'wrong' place in the ToC
\lipsum[1-10]


%\backmatter % <--- this adds little benefit in my opinion

\conclusion{Concluding Remarks}
\lipsum[1-10]
\Section{Concluding section}
\lipsum[1-10]

\begin{appendices}

\chapter{Further Details}
\leftmark{Appendices}
\lipsum[1-10]
\section{Appendix section (no star)}

\lipsum[1-10]

\chapter{Yet Further Details}
\lipsum[1-10]
\Section{Unnumbered appendix section}
\lipsum[1-10]

\end{appendices}

\end{document}

Of course, if you need the long and short versions for \introduction, etc., it gets more tricky (although not very if we can use xparse). But first things first.

  • Sorry, I should have mentioned this in my questions: what you suggest is exactly what I did (based on the titleps package for the headers). I worked a lot on it, it worked pretty well and then I started to see how my class behaves with LaTeX IDEs as TeXstudio (I'm usually working on Emacs). And, unfortunately, the "structure" feature of such editors need the structure commands to be the usual ones (see my feature request). Hence my first question patch the usual macros. – Denis Bitouzé Feb 27 '14 at 6:13
  • @DenisBitouzé -- Ah I see. That is a very different issue I guess; or perhaps one that operates on a different level in so far as it can indeed become an editor problem then. (I've only reluctantly used anything other than Emacs, however, so I can't help there.) You are certainly more generous with your efforts than I would be to adapt my LaTeX practices to the requirements (or expectations) of a less than optimal IDE/editor!! – jon Feb 27 '14 at 6:40
  • I fully agree that Emacs is much more powerfull but it needs to be frankly acknowledged that the TeXstudio's deficiencies #2 and #3 pointed out in my feature request do exist with Emacs (AUCTeX C-= shortcut) as well ;) – Denis Bitouzé Feb 27 '14 at 14:25
  • @DenisBitouzé -- Hmm, true. I guess I never/rarely use the TOC feature of AUCTeX, so I didn't bother to look what it does. Anyway, I'm certainly no elisp master, but the defaults seem easy to change. Look at TeX-outline-mode and especially LaTeX-section-list-add-locally. But I guess 'fixing' every editor would get tedious ... though I still think 'fixing' \chapter so it does everything is not the right LaTeX approach. – jon Feb 27 '14 at 16:01
  • I don't claim the class in which I want to redefine the \chapter command will be as nice as memoir or KOMA (by far ;). But I guess these classes, and probably several packages, 'fix' all the structure commands by redefining them (deeply or not). Hence I don't see your point when you say it is "not the right LaTeX approach". – Denis Bitouzé Feb 27 '14 at 16:14

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.