Hot answers tagged

6

The page number is typeset by adding it to the token list \footline. By default the page number is preprocessed by the macro \folio, which outputs a roman numeral if the page number is negative. Below you can find the default definitions of plain TeX. \footline={\hss\tenrm\folio\hss} \def\folio{\ifnum\pageno<0 \romannumeral-\pageno \else\number\pageno ...


5

The problem with \maketitle is, that it is a command that disables itself after being called by using \global\let\maketitle\relax (the same is true for \title, \author etc. This can be disabled either be redefining \maketitle or using \xpatch and removing the relevant code. This will prevent the restart of the pagenumbering anyway. The next culprit is ...


5

I'm lazy. If somebody else has already done the work and I can use theirs, I figure there's no need for me to spend time poring over different designs for the newfangled invention they call a 'wheel'. I would use etoolbox to patch the titlepage environment which book uses for titles by default, and let titling do the rest. \usepackage{etoolbox,titling} ...


5

If you don't want to load hyperref, you can use refcount instead. You can use the lastpage package to get the length of the last chapter. \documentclass{report} \usepackage{hyperref}% defines \getpagerefnumber \begin{document} Chapter 1 has [\the\numexpr\getpagerefnumber{c2}-\getpagerefnumber{c1}\relax] pages in it. \chapter{Chapter 1}\label{c1} Text... ...


4

Now it's working -- with automatic section title setting and hyperlinks, if needed. \documentclass{article} \usepackage[lmargin=1.5cm,rmargin=1.5cm]{geometry} \usepackage{blindtext} \usepackage{array} \usepackage{longtable} \usepackage{tabularx} \usepackage{xpatch} \usepackage{xparse} \newif\ifhyperrefloaded \usepackage[hypertexnames=true]{hyperref} ...


3

If I understand your objective correctly, it may be achieved by using \pageref instructions to point to the page numbers where various \section instructions occur. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[russian]{babel} \usepackage{tabularx} % fonts for sectioning headers \usepackage{sectsty} ...


3

\thepage is never reliable, but the label/ref mechanism is: \documentclass{article} \usepackage{exercise} \usepackage{lipsum} \begin{document} \begin{Exercise} \lipsum[1-8] \label{currentpg}\pageref{currentpg} \end{Exercise} \end{document} Or, by means of a user command \insertCurrPgNum which maintains labels automatically. ...


3

The appearing of page numbers are determined by \pagestyle{...} and \thispagestyle{...}. If you not define otherwise, the document class book use in page with chapters title \thispagestyle{plain} (as part of chapter style definition) and on others page (regardless if they are empty or not) default book page style (where the page numbers are on outside page ...


2

You're probably also issuing \maketitle, which issues \thispagestyle{plain}. The plain page style inserts the footer only (as \thepage). As such, you can override this and issue \thispagestyle{empty} immediately after \maketitle: \documentclass{article} \usepackage{fancyhdr,lipsum} \fancyhf{} \lhead{something here} \cfoot{Page \thepage} ...


2

By default, \section* adds nothing to the ToC. You have to add it manually: \documentclass{article} \begin{document} \pagenumbering{roman} \section*{Abstract} \addcontentsline{toc}{section}{Abstract} \clearpage \section*{Acknowledgment} \addcontentsline{toc}{section}{\protect\numberline{}Acknowledgement} \clearpage \tableofcontents \clearpage ...


2

It seem like the command \righttoleft reverse the order of numbers in header, you can maintain \pagenumber to be written from left to right as follows \let\Pagenumber\pagenumber \def\pagenumber{\hbox{\textdir TLT\Pagenumber}} or \let\Pagenumber\pagenumber \def\pagenumber{\hbox{\lefttoright\Pagenumber}} Code \mainlanguage[arabic] ...


2

The whole issue is that the wrong pagestyle was used. Explicit \clearpage\pagestyle{fancy} just before the \tableofcontents or even `\pagestyle{plain} helps to cure this problem. I've deleted all unnecessary code for this solution \documentclass[11pt,twoside]{book} \usepackage{fancyhdr} \fancyhf{} % sets both header and footer to nothing ...


2

Assuming book class the standard is that chapters start on the right side, i.e. the odd-numbered page (recto page). This will lead to empty even-numbered pages (verso page) occur of course, if there's not enough typesetting content to fill the last page before a new chapter starts. The openany documentclass option to book allows chapters to start on verso ...


2

It thinks that the year of your degree is 1 because you've not told it any different. If you tell it differently, it will use the year you tell it. Even if that year is no more likely than the default 1. \documentclass[PhD,single]{uclathes} \degreeyear{1066} \begin{document} \makeintropages \end{document} In general, you are likely to get bizarre ...


1

Pagenumbering changes are only effective after a \clearpage. If the Table of Contents shouldn't be numbered with roman numbers, remove the second \clearpage before \tableofcontents. But \section* will not make an entry to the ToC at all. Better use \section{Abstract} etc. and suppress the numbering with \secnumdepth{-1}. \documentclass[11pt]{article} ...


1

In ConTeXt \setuppagenumbering[location={footer,center}] \setupfootertexts[Page \currentpage\ of \lastpage]


1

It also works completely without hyperref. You first have to declare a \newcounter in the preamble. Then, instead of setting the PDF page labels at the first numbering change, you set the counter. You then set the PDF page labels at the second numbering change, using the counter's value for the start of the second entry. \documentclass{report} ...


1

Following code shortens navigation line and includes page number on left side. Is this what you want? \documentclass[t]{beamer} \usetheme{Frankfurt} \usecolortheme{dove} \setbeamercolor{titlelike}{parent=structure} \usefonttheme{structuresmallcapsserif} \setbeamercolor{frametitle}{bg=light-gray} \definecolor{light-gray}{gray}{0.80} ...


1

This isn't quite what you wanted, but you might warm up to it. It moves all the floats to the end of the document. \documentclass{article} \usepackage[nofiglist,nomarkers]{endfloat} \usepackage{lastpage} \usepackage{mwe} \makeatletter \def\ps@float{\ps@plain \def\@oddfoot{\hfil Float \thepage{ of }\pageref{LastPage}\hfil}% \let\@evenfoot=\@oddfoot} ...



Only top voted, non community-wiki answers of a minimum length are eligible