1

The following code makes use of the chappg package to define the page numbers as chapter numbers.

\documentclass[openany]{book}
\usepackage{lipsum}
\usepackage[noauto]{chappg}
\renewcommand*{\thepage}{\arabic{chapter}}

\begin{document} \LARGE \chapter{} %\chapter{1} \setcounter{chapter}{1} \lipsum[1-4] \chapter{} %\chapter{2} \setcounter{chapter}{2} \lipsum[1-2] \chapter{} %\chapter*{3} \setcounter{chapter}{3} \lipsum[3-4] \end{document}

And it works quite nicely, except that the word "Chapter" appears to the left of the chapter number; e.g.,

enter image description here

I know that using, say, \chapter*{1} will print out only the number 1; \chapter*{2} only the number 2; and so forth... but when I replace each \chapter{} with \chapter*{number}, the pagenumbering is thrown out of whack and displays only zeros.

The following (cumbersome) code corrects this and gives me what I am looking for:

\begin{document}
\LARGE
%\chapter{} 
\chapter*{1} \setcounter{chapter}{1}
\lipsum[1-4]
%\chapter{} 
\chapter*{2} \setcounter{chapter}{2}
\lipsum[1-2]
%\chapter{} 
\chapter*{3} \setcounter{chapter}{3}
\lipsum[3-4]
\end{document}

enter image description here

However, to keep specifying \setcounter{chapter}{#} will become unwieldy when there are a lot of chapters in the document.

QUESTION: What is an optimal way to have (i) the chapters indicated by their numbers only, and (ii) the page numbers represent those chapter numbers---without resorting to the continual use of \setcounter{chapter}{#} each time a new chapter is introduced? Is it possible to avoid also, the continual use of \chapter*{#} and replace it with something analogous to \chapter{} as in the MWE? (\chapter*{} does not work)?

Thank you.

DDS
  • 8,816
  • 4
  • 9
  • 36
  • 1
    you are not using the package. And how to format a chapter title is quite unrelated to page numbering. – Ulrike Fischer Sep 24 '21 at 14:02
  • @Ulrike Fischer \usepackage[noauto]{chappg} is used in the MWE; also, the formatting of the chapter title adversely affects the code in the MWE, thus necessitating a much more complicated and laborious approach to accomplishing what the MWE does, with the only change being the formatted title. Thus I ask, how may \chappg be used (most) efficiently in this case. – DDS Sep 24 '21 at 14:19
  • yes, I know that you load the package. But you are not using it. The main purpose of the package is to provide \pagenumbering{bychapter}. – Ulrike Fischer Sep 24 '21 at 14:30
  • and to get chapter number without prefix the easiest it to switch the class, e.g. scrbook does this by default, and with memoir you get it with \chapterstyle{section}. – Ulrike Fischer Sep 24 '21 at 14:36
  • @Ulrike Fischer The trouble is that the larger document in which the new pagenumbering is to be applied is in book class. Based on what you say about \pagenumbering{bychapter}, I will probably reread some of the documentation on chappg; and in particular, [auto] vs. [noauto] for starters. Thank you for your comments. – DDS Sep 24 '21 at 16:33
  • then look for one of the various packages which redefine chapter titles https://ctan.org/topic/headings. or redefine \@makechapterhead e.g. https://tex.stackexchange.com/q/299102/2388 – Ulrike Fischer Sep 24 '21 at 16:42
  • @Ulrike Fischer Thanks again. It seems if I can easily eliminate the word "chapter" from each occurrence, there will be no need for chappg. – DDS Sep 24 '21 at 16:46

0 Answers0