Questions tagged [afterpage]

{afterpage} is a package that provides a means of running commands immediately after the current page is output.

Filter by
Sorted by
Tagged with
44
votes
1answer
40k views

How to set page geometry for a single page only?

I want to change the geometry for a single page only. I set the geometry for the whole document using: \usepackage[left=1cm,right=2cm,vmargin=2.5cm,footnotesep=0.5cm]{geometry} The geometry package ...
16
votes
1answer
6k views

Start a longtable in Latex at top of next page

I want to use the longtable environment for a table. However, I do not know how to place it at the top of the next page, as I can do with the table environment. Do you know how to do it?
9
votes
1answer
7k views

How can I solve “Float(s) lost” when using afterpage / minted packages?

I'm writing a document where I have a lot of long listings. I use the package minted to typeset the listings, which I always embed in a float. Since the listings are quite long, and LaTeX usually does ...
9
votes
0answers
4k views

Attempts to manually change \linewidth ignored by LaTeX [closed]

I was going to try to answer the question: How can I change the geometry of a page on the chapter header page only, and return to normal on the next page? It didn't seem like it should be too ...
8
votes
1answer
1k views

afterpage clashes with restoregeometry from the geometry package

I'm writing my thesis and have used the geometry package to control the size of the text body so that it follows 'good' typesetting practices as described in the KOMA-script documentation. Many of ...
7
votes
1answer
2k views

Page styles only work for \thispagestyle under afterpage

Using afterpage to set a page style after some page only works for \thispagestyle, but not for \pagestyle. Why is that? How can I make it work? \lipsum[1-20] produces 4 pages of text, Lorem Ipsum ...
7
votes
1answer
705 views

\label is Undefined when used in \afterpage?

I am trying to force a figure and an image to show up on the same page back to back. I read the solution of using the \afterpage which works great. Except now the \label is undefined and I cannot ...
6
votes
1answer
107 views

How do I manually split a paragraph without \afterpage?

So I wrote a LaTeX package that would give me full-page floats: https://tex.stackexchange.com/a/84312/13450 Unfortunately, it introduces hard page breaks. \documentclass[a5paper]{memoir} \usepackage{...
5
votes
5answers
1k views

Newgeometry and afterpage don't adjust the geometry

In the following sample, the geometry doesn't change even though I believe it should. What am I doing wrong and how can I fix it? \documentclass{article} \usepackage{lipsum} \usepackage{afterpage} \...
4
votes
2answers
16k views

How do I insert double blank pages

I can insert one blank page successfully with \afterpage{\null\newpage} But I need two?
4
votes
1answer
303 views

How to make figures appear landscape properly?

I know of two options to put figures in landscape. The first is to use the sidewaysfigure environment. This works very well when it comes to keeping the sequence of figures. However, it leaves the ...
4
votes
1answer
135 views

pst-abspos and afterpage not producing the effect I want: is there an aftereverypage?

I'm trying to create a document which looks like it's been printed on a ruled page. I know I can probably do this in tikZ, but I would like to be able to do this in pstricks. The option absolute for ...
4
votes
1answer
1k views

Landscape figure float obscuring text

I am trying to insert a figure float in landscape orientation within an otherwise portrait-oriented document. The figure is inserting as it should, but for some reason it is obscuring a page of text ...
3
votes
2answers
816 views

Order of footnotes with packages afterpage and footnote

I need to have footnotes in captions of figures and therefore use the afterpage package to keep the footnotes and the figure on the same page (also using package footnote for footnotes in figures). I ...
3
votes
2answers
91 views

after minipage like afterpage

Is it possible to define a command that works like \afterpage, but only applies to minipage environments? The usage I have in mind is as follows \begin{minipage} See the graph in Figure~\ref{foo}. \...
3
votes
1answer
1k views

Adding words figure and page to list of figures

This also applies to the table of contents and list of tables and is related to Add 'Page' above page numbers in Table of Contents, but when adding the words "Figure" and "Page" to the top of ...
3
votes
1answer
40 views

With afterpage the number of each section is not continuous

The following minimum example (MWE) based on this question: Section doesn't start from Landscape orientation page, includes a numbered section as the first instruction after the afterpage instruction ...
3
votes
2answers
883 views

Full page floating figure with TikZ overlay in twocolumn document?

I have a peculiar problem with my LaTeX document. I have a twocolumn document and would like to include a figure that is spread over an entire new page and contains a TikZ picture (where I can input a ...
3
votes
1answer
456 views

Longtable breaks afterpage

My problem is that I want to have a certain footer on the first, or the last, page. The solution I've tried with is by using fancyhdr together with afterpage. Here is a working example, without ...
3
votes
1answer
627 views

\afterpage not called after page break

In this example \documentclass{article} \usepackage[a6paper,landscape,margin=1cm,bottom=2cm]{geometry} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{afterpage,refcount,lastpage} \...
2
votes
1answer
459 views

empty page afterpage listings

I get an emptypage on multi page listings if I use listings with afterpage. \documentclass{scrartcl} \usepackage{listings} \usepackage{afterpage} \begin{document} \afterpage{% %some fancy stuff } \...
2
votes
1answer
102 views

Too many \restoregeometry required with afterpage and geometry packages

I have the following MWE where to get the desired output I need to issue two \restoregeometry commands in order to ensure the second page doesn't spill of the bottom and so that the first page adheres ...
2
votes
1answer
279 views

Page break problem after changing the page format

I have the following problem. I am writting my thesis and I need to change the page format from A4 to A3 to include a figure. After this, I would like to return to the original format. However, an ...
2
votes
2answers
520 views

how to put afterpage inside environment definition?

if i used \afterpage outside the my custom environment, it works fine: \documentclass{article} \usepackage{lipsum, afterpage} \newenvironment{myenv}{ some macros that manipulate page numbering } {...
2
votes
1answer
266 views

etoolbox patch lstlistings

This is a follow up question to empty page afterpage listings. I'm trying to work around a listings problem with etoolbox: \documentclass{scrartcl} \usepackage{listings} \usepackage{afterpage} \...
2
votes
1answer
2k views

How to leave the rest of a page empty after inserting a figure in latex?

I would like to insert a figure with its caption entirely in a page with the following code: \documentclass[a4paper,fleqn,usenatbib]{mnras} \usepackage{newtxtext,newtxmath} % Depending on your LaTeX ...
2
votes
1answer
511 views

How to get rotated landscape page in LaTeX without flushing other floats?

I would like the landscape tables to appear rotated in the pdf using pdflscape package. However I would still like the text AND figures to float around the table. As you can see in the portrait view ...
2
votes
4answers
871 views

Insert a blank page on every page break?

I have slides (slides.pdf; my own construction based on scrartcl) to teach from. Students asked to put in blank slides (to have space to put down notes). I first tried to write a shell script (getting ...
2
votes
1answer
627 views

Force figures and figures* to appear in order of appearance

I am using the MNRAS latex template to typeset a preprint. The MNRAS template is divided into two columns and I am using the figure and figure* environment to place graphs either into one column or ...
2
votes
1answer
385 views

why can't I get the A3 page where I want it (inside an A4 document) [duplicate]

I am using an A3 page within an A4 document. In the SSCCE example below, my plan was to get (in this order): "foo" on an A4 page "A3 stuff" on an A3 page "bar" on an A4 page Instead, I get: "foo" ...
2
votes
1answer
786 views

longtable - start on next page

The formatting guidelines that I am bound to require me to have tables either at the top or bottom of a page. Up to now, I used a longtable for every table - even if it does not span multiple pages (...
2
votes
1answer
648 views

How to fix misplaced \noalign on afterpage with \clearpage and too high longtable head?

TeX Live 2014 on Xubuntu 14.04 LTS. Minimal working example: \documentclass[11pt, oneside]{report} \usepackage{afterpage} \usepackage{booktabs} \usepackage{longtable} \begin{document} \afterpage{ ...
2
votes
1answer
563 views

How to create an environment to dump a longtable sideways after currentpage, which works under pandoc

Sorry for the long title (and even longer question), but this is a rather complex subject and requires a bit of elaboration. Goal: I want to define a pair of latex macros which I can write in the ...
2
votes
0answers
116 views

Table margin, white space problem and position problem

Table margin problem, extra space is appear in the margin of table (see landscape table 3), also table position is wrongly appearing(I have place the second table in last but it appears as second also ...
2
votes
0answers
104 views

Repeating top-level index entries on the next column (done right)

Yes, I want exactly the same thing as in this question. However, I'm trying to get rid of the following three issues with repeatindex/afterpage: afterpage causes loathsome small vertical space after ...
1
vote
2answers
179 views

A \beforepage command

I find recently the afterpage package which brings the \afterpage{<stuff>} command which puts the <stuff> part in the next page. But I was searching a reversed command, something like \...
1
vote
1answer
177 views

Two column article not adjusting with landscape table

I have a two-column article with a landscape table. Below is a working example of the article. \documentclass[10pt,twocolumn]{article} \usepackage{lipsum} \usepackage{lscape} \usepackage{afterpage} \...
1
vote
1answer
732 views

No page number after afterpage

Why is no page number shown on the page after the one generated by afterpage? \documentclass{article} \usepackage{afterpage, geometry, lipsum} \begin{document} \lipsum \afterpage{% \clearpage \...
1
vote
1answer
268 views

Including a matrix of math nodes in a TikZ figure in a minipage in a landscape in an afterpage

I want to include a TikZ figure, containing a matrix of math nodes, displayed in landscape mode on its own page in my thesis, in such a way that the nominally surrounding text, which is in fact on the ...
1
vote
1answer
19 views

How to organize the appearing of floats when afterpage is used?

earlier I asked how to rotate a page with a sidewaysfigure inside (question here). However I couldn't find a solution. I decided to use the landscape environment with afterpage, but when there's other ...
1
vote
1answer
326 views

Can I make the geometry of the first page different from other pages?

I want to make the top margin in the first page larger than other pages. The code I use is: \documentclass[12pt]{article} \usepackage{geometry} \geometry{ top=8cm, hmargin=1in, } \usepackage{...
1
vote
2answers
454 views

How to fix paragraph's run-in heading on a single page before \afterpage and the text being on the first page after \afterpage?

TeX Live 2014 on Xubuntu 14.04 LTS, compiling with xelatex. Minimal working example: \documentclass[11pt, twoside]{book} \usepackage{geometry} \geometry{a4paper, left=3.5cm, right=2.5cm, top=3.5cm, ...
1
vote
1answer
273 views

How to add verbatim in a float figure on right page?

I've discovered this post to define the command addfig{} to put figures on the right page. My problem is that it doesn't work if the figure is a verbatim element. Here is a minimal not working ...
1
vote
3answers
446 views

inserting an image after every page

I'd like to automatically insert an image on all even pages of a document, keeping the rest of the text flow unaltered. I know I can do this using something like pdftk after compilation, but is there ...
1
vote
1answer
215 views

How to prevent reordering float appearance?

Latex changes the order of floats in my document. It moves figure 2 before figure 1. Figure 1 occupies a whole page, therefore I set it to be inserted on a float page, in afterpage environment. How to ...
1
vote
2answers
71 views

Inserting different figures on even numbered pages

Sometimes a discussion on a figure spills over several pages and I want to insert a copy of the figure on every even numbered page while the discusses continues. There was a closely related question ...
1
vote
1answer
49 views

avoid extra page for a footnote when a paragraph is split by afterpage

I have a document where text should float around a landscape page that I insert with \afterpage{}. If (as is the case for me) a paragraph is 'broken' by afterpage (i.e. the paragraph starts before the ...
1
vote
1answer
383 views

How do I fix wrong numbering when using afterpage in appendix?

So I'm writing my thesis and was in need of a table in landscape mode as it was too big, and found a simple solution at How to place a table on a new page with landscape orientation without clearing ...
1
vote
1answer
37 views

Indexing material that appears inside \afterpage

My document contains some landscape-orientation tables that I set inside an \afterpage command. When I try to index material that appears inside these tables, I sometimes end up with duplicate index ...
1
vote
1answer
509 views

A figure-like environment that can contain many subfigures and break over pages: How to align double-column starts after the thing properly?

I have a problem similar to post 11059, i.e., I need a figure-like environment that can contain an arbitrary number of sub-figures. These may take so much space that the figure may span over multiple ...