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
60 votes
1 answer
86k 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 ...
Andre's user avatar
  • 739
21 votes
1 answer
11k 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?
An Cong Tran's user avatar
12 votes
1 answer
8k 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 ...
fuujuhi's user avatar
  • 191
11 votes
0 answers
8k 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 ...
A.Ellett's user avatar
  • 50.6k
10 votes
3 answers
34k views

How do I insert double blank pages

I can insert one blank page successfully with \afterpage{\null\newpage} But I need two?
user47970's user avatar
  • 101
8 votes
1 answer
3k 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{...
Ice0cean's user avatar
  • 1,646
8 votes
1 answer
2k 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 ...
Daniel's user avatar
  • 1,797
8 votes
1 answer
903 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 ...
Kousha's user avatar
  • 737
8 votes
1 answer
2k 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 ...
luke's user avatar
  • 269
7 votes
1 answer
3k 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 ...
Werner's user avatar
  • 604k
6 votes
1 answer
130 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{...
Christian's user avatar
  • 19.2k
5 votes
5 answers
3k 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} \...
Max's user avatar
  • 5,702
5 votes
1 answer
658 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 ...
Joakim's user avatar
  • 235
5 votes
1 answer
161 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 ...
Chris's user avatar
  • 123
4 votes
2 answers
2k 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 ...
ThomasD's user avatar
  • 111
4 votes
1 answer
150 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 ...
A.Ellett's user avatar
  • 50.6k
4 votes
1 answer
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 ...
SAKJ's user avatar
  • 43
3 votes
2 answers
140 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}. \...
Ethan Duckworth's user avatar
3 votes
1 answer
3k 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 ...
Geoarch's user avatar
  • 33
3 votes
1 answer
325 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 ...
djnavas's user avatar
  • 411
3 votes
2 answers
2k 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 } {...
aleksandr barakin's user avatar
3 votes
1 answer
808 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 ...
Fhurrur's user avatar
  • 33
3 votes
2 answers
1k 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 ...
A13's user avatar
  • 31
3 votes
1 answer
5k 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 ...
Rebel's user avatar
  • 251
3 votes
1 answer
881 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 ...
Void's user avatar
  • 195
3 votes
1 answer
2k 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} \...
porst17's user avatar
  • 1,467
2 votes
2 answers
621 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 \...
fauve's user avatar
  • 2,511
2 votes
1 answer
2k views

Remove header/footer on page with large figure

I have a question that is similar to this one, though the solutions proposed there do not work for me. I want to insert a large figure in a document that has headers (section titles) and footers (page ...
MPA's user avatar
  • 307
2 votes
1 answer
629 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} \...
Abdur Rahman's user avatar
2 votes
1 answer
1k 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 \...
Sämy's user avatar
  • 123
2 votes
1 answer
736 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 } \...
someonr's user avatar
  • 8,531
2 votes
1 answer
330 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 ...
oliversm's user avatar
  • 2,717
2 votes
1 answer
645 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 ...
Pablo Cosio's user avatar
2 votes
2 answers
1k 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 ...
JLDiaz's user avatar
  • 55.7k
2 votes
1 answer
389 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} \...
someonr's user avatar
  • 8,531
2 votes
1 answer
1k 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 ...
Martin's user avatar
  • 23
2 votes
4 answers
2k 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 ...
Marius Hofert's user avatar
2 votes
1 answer
528 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 ...
bcsikos's user avatar
  • 869
2 votes
1 answer
655 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" ...
Marcus Junius Brutus's user avatar
2 votes
3 answers
124 views

Two page panorama without \afterpage -- tables as well as figures

About one and a half decades ago I tried printing a panorama with LaTeX and found a version with several calls to \afterpage, that worked for me. Meanwhile, I found a much more elegant, shorter, and ...
ThorstenL's user avatar
  • 161
2 votes
1 answer
194 views

Strange problem using landscape, afterpage and split

I have a problem in Latex where \afterpage somehow seems to have problems with a split equation, so that the code does not compile. I use \afterpage to fill a page before a large landscape figure is ...
CarlJacobi's user avatar
2 votes
1 answer
1k 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 (...
Max's user avatar
  • 77
2 votes
1 answer
1k 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{ ...
Kreuvf's user avatar
  • 190
2 votes
0 answers
839 views

How to solve error - Illegal parameter number in definition of \AP@

I'm new to Latex and struggling to properly format a specific cover for my article. I have the following code that fulfils what is expected from it and even compiles. However, the "Illegal parameter ...
Diogo Sá's user avatar
2 votes
0 answers
232 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 ...
Shalu's user avatar
  • 319
2 votes
0 answers
300 views

Geometry: strange behaviour after \restoregeometry in afterpage environment (and longtable)

I have some strange problem tying place a "fake float" with large tables. Here is a MWE: \documentclass[twoside, a4paper]{scrbook} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{...
carlosv's user avatar
  • 305
1 vote
1 answer
377 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 ...
jdc's user avatar
  • 1,245
1 vote
2 answers
520 views

Is it possible to define a different page layout for every chapter title page for example?

I attempted to produce a book document that has the following specifications: A narrow content at the first page of each chapter, but the width of the chapter title is as wide as \textwidth. A sided ...
Muhammed Hashim's user avatar
1 vote
1 answer
1k views

\restoregeometry from inside afterpage

I want to create a twoside article as a booklet where the first page is centered, and the rest is not. Using \newgeometry and restoregeometry within the afterpage macro doesn't work for some reason. ...
henrikl's user avatar
  • 195
1 vote
1 answer
49 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 ...
Daniel Valencia C.'s user avatar