Hot answers tagged

19

\documentclass[pagenumber=footright, DIV=20, fontsize=16]{scrartcl} \usepackage[automark]{scrlayer-scrpage} \pagestyle{scrheadings} \ihead{} \ofoot[\pagemark]{\pagemark} \chead{} \cfoot[]{} \ohead{} \begin{document} \def\x{\ifnum\value{page}<501\mbox{}\clearpage\expandafter\x\fi} \x \end{document}


19

Use a primitive \loop with \repeat and \unless testing. \documentclass[pagenumber=footright, DIV=20, fontsize=16]{scrartcl} \usepackage[automark]{scrlayer-scrpage} \pagestyle{scrheadings} \ihead{} \ofoot[\pagemark]{\pagemark} \chead{} \cfoot[]{} \ohead{} \newcounter{loopcntr} \begin{document} \loop\unless\ifnum\value{loopcntr}=500 \mbox{} \newpage \...


13

A variant with package multido (50 bytes): \documentclass[DIV=20, fontsize=16]{scrartcl} \usepackage{lmodern} \usepackage[automark]{scrlayer-scrpage} \pagestyle{scrheadings} \cfoot{} \ofoot[\pagemark]{\pagemark} \usepackage{multido} \begin{document} \multido{}{500}{\null\newpage} \end{document}


12

With expl3: \documentclass[pagenumber=footright, DIV=20, fontsize=16]{scrartcl} \usepackage[automark]{scrlayer-scrpage} \usepackage{expl3} \pagestyle{scrheadings} \ihead{} \ofoot[\pagemark]{\pagemark} \chead{} \cfoot[]{} \ohead{} \begin{document} \ExplSyntaxOn \prg_replicate:nn { 500 } { \mbox{}\newpage } \ExplSyntaxOff \end{document} With no ...


5

zref's abspage module provides access to an "absolute page number" property. Together with the lastpage module, you can extract the last absolute page number using \zref[abspage]{LastPage}. Here is a minimal example: \documentclass{article} \usepackage[paper=a5paper]{geometry}% Just for this example \usepackage[abspage,user,lastpage]{zref} \begin{...


5

The package xassoccnt provides a mean to force a stepping of an associated counter each time a driver counter is stepped as well -- the driver counter is page here. This has an advantage over the totcount or lastpage packages, since the associated counter realpage (any name will do, but section etc. is unwise, of course ;-)) is not reset (unless explicitly ...


4

The problem is that the file containing the reference information is not read until \begin{document}. You need to defer setting the variable until then. \documentclass{article} \usepackage{expl3} \usepackage{blindtext} % For this example \usepackage{fancyhdr,refcount} % For this example \pagestyle{fancy} \ExplSyntaxOn \AtEndDocument{\label{last-page}} \...


4

The following is how I'd do it. It's very similar to David Carlisle's answer, but in a way which makes the recursion slightly clearer to me (trying to remember how \expandafter works always gives me a headache!). \begin{document} \def\x{\ifnum \count0>500 \let\next\relax \else \null\clearpage \let\next\x \fi \next} \x \end{document} ...


4

The book class uses headings as the default page style. This page style provides only headers and no footer (not using twoside, as in your case): \def\ps@headings{% \let\@oddfoot\@empty \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% \let\@mkboth\markboth \def\chaptermark##1{% \markright {\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne ...


3

Here is what I understood of your requirements: \documentclass[12pt, a4paper, oneside]{book}% \usepackage[top=4cm,bottom=2.5cm,right=2.5cm,left=4cm, headheight=15pt, showframe]{geometry} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fourier} \usepackage{lipsum,setspace } \usepackage[pagestyles, clearempty]{titlesec} \newpagestyle{myps}{% ...


3

The memoir class provides two macros, namely \lastpage and \lastsheet which will print the page number of the last page and the number of sheets of paper required for printing the document single sided. To date I have not heard of any problems with these. They can be used like this: \documentclass[a4paper,...]{memoir} ... \begin{document} ... The last page ...


2

This is cause by using \vfill in an attempt to create new pages, which it really doesn't do. It is used for instance if you want some content on the top of a page, and some other content on the bottom, with some space between. Then you would apply \vfill here. For creating new pages, you could use \clearpage, \newpage or \pagebreak. Also, in the class ...


2

The 'problem' is the definition of \titlepage in book.cls, having \thispagestyle{empty}% \setcounter{page}\@ne The first command will apply the 'empty' pagestyle whereas the second one resets the page counter (\@ne is LaTeX core command for being '1' -- think of \@ne = \one ;-)) This can be removed by redefinition of \titlepage or by a patch. The ...


2

apa6 defines titlepage and otherpage style with fancyhdr settings. A redefinition just clears \rhead{} and sets \cfoot{\thepage} The \maketitle uses the call \pagestyle{titlepage} then, so most likely both titlepage and otherpage have to be modified slightly and keeping the other settings as they are. \documentclass[man,12pt,apacite,natbib,noextraspace]{...


2

Naturally there is a counter. \c@page (which is defined as \count0) and you can access its value: \documentclass[a5paper, 11pt]{scrbook} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \begin{document}\makeatletter Seite \the\value{page}--\the\c@page --\the\count0 \newpage Seite \the\value{page}--\the\c@page --\the\count0 \end{document} But you ...


2

[p!] is equivalent to [p] and will allow the figure to be placed after the next page break if it meets the constraints, if it is being held to the end the most likely constraint that is failing is \floatpagefraction if the figure is smaller than \floatpagefraction then it will be held back to avoid float pages being too empty, but then if that float and the ...


1

I do not really understand what the required result is, but it should be possible with package scrlayer-scrpage. This package defines its page styles using layers. So it is possible to define new layers and add them to page styles. \documentclass[a4paper ,twoside ]{article} \usepackage{blindtext}% dummy text \usepackage{graphicx} \usepackage[markcase=...


1

First of all: If this should be submitted to Springer, they will not accept the page number on the first page, most likely, but here you go... \maketitle uses \thispagestyle{empty} (many document classes do so!), so either \renewcommand{\maketitle} → tedious Trick \ps@empty to be \ps@fancy → has to be undone later on! Use \xpatchcmd from xpatch package ...


1

Here is another suggestion using package afterpage: \documentclass{article} \usepackage{graphicx} \usepackage{lipsum} \usepackage{afterpage} %\usepackage{caption} \begin{document} \lipsum \lipsum \afterpage{ \centering \addtocounter{page}{-1} \thispagestyle{empty} \parbox[c][\textheight][c]{\textwidth}{ \includegraphics[width=\textwidth]{...


1

The problem is actually twofolded: To prevent the page counter from increasing, one can use the afterpage package in front if the figure. For controlling the pagestyle of the float page the package floatpag provides the \thisfloatpagestyle{empty} command. The \renewcommand{\floatpagefraction}{0.1} is just for this example to ensure that the figure is ...


1

Something like this? A \clearpage after the float page is necessary, in my point of view, as well as a \newpage\thispagestyle{empty} before the figure environment. \documentclass{article} \usepackage{blindtext} \usepackage{graphicx} \begin{document} \blindtext[50] \clearpage \thispagestyle{empty} \begin{figure} \includegraphics[scale=0.8]{ente} \...


1

B5 paper at twelve point size with enlarged leading is a guarantee for bad typesetting and, indeed, the result is among the worst I've seen. Anyway, if you have to use a class, why bother with changing its setup? \documentclass[openright,twoside,b5paper,12pt,fleqn]{psd_thesis} \linespread{1.5}\selectfont % the class does the wrong thing \usepackage{...



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