Page Layout ⇒ \previouspage command?
-
- Posts: 6
- Joined: Tue Mar 29, 2011 7:25 pm
\previouspage command?
Howdy,
I have a \documentclass[twocolumn]{article} that I'm using with pdflatex. The top half of the first page needs to be a single column. I have achieved this by \onecolumn. The bottom half of the first page and the rest of the document should be two columns. This is accomplished with the \twocolumn command, except that \twocolumn forces a pagebreak.
Is there a command akin to \previouspage or \undopagebreak that I can put in after \twocolumn so the bottom half of my first page is not blank?
I realize I could use a multicolumn environment, but the drawbacks in formatting floats outweigh its benefits. Alternatively, if someone can explain to me in detail (I'm a bit of a latex novice) how to later \twocolumn to suppress its inherent page break, that may help. I'm using Kile on Ubuntu, if that's relevant.
Thanks!
I have a \documentclass[twocolumn]{article} that I'm using with pdflatex. The top half of the first page needs to be a single column. I have achieved this by \onecolumn. The bottom half of the first page and the rest of the document should be two columns. This is accomplished with the \twocolumn command, except that \twocolumn forces a pagebreak.
Is there a command akin to \previouspage or \undopagebreak that I can put in after \twocolumn so the bottom half of my first page is not blank?
I realize I could use a multicolumn environment, but the drawbacks in formatting floats outweigh its benefits. Alternatively, if someone can explain to me in detail (I'm a bit of a latex novice) how to later \twocolumn to suppress its inherent page break, that may help. I'm using Kile on Ubuntu, if that's relevant.
Thanks!
Last edited by climatologist on Fri Apr 01, 2011 7:22 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\previouspage command?
Try another approach. Set up your document with a single column and use the multicol package. See code below for a short example. For more details refer to the package manual.
Best regards and welcome to the board
Thorsten
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{multicol}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{multicols}{2}
\blindtext
\end{multicols}
\end{document}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 6
- Joined: Tue Mar 29, 2011 7:25 pm
Re: \previouspage command?
Hi Thorsten,
Thank you for your response. Unfortunately, your suggested change results in a warning that floats are not allowed inside a multicols environment. My figures and floats are handled beautifully when I use the \onecolumn and \twocolumn combination, whereas I'd have to exit the multicols environment for every figure to manually place each one.
Any other tricks up your sleeve?
Thanks again,
Chad
Thank you for your response. Unfortunately, your suggested change results in a warning that floats are not allowed inside a multicols environment. My figures and floats are handled beautifully when I use the \onecolumn and \twocolumn combination, whereas I'd have to exit the multicols environment for every figure to manually place each one.
Any other tricks up your sleeve?
Thanks again,
Chad
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: \previouspage command?
You can insert floats that span both columns by using the starred versions of the known float environments.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 6
- Joined: Tue Mar 29, 2011 7:25 pm
Re: \previouspage command?
How about single-column floats?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\previouspage command?
You can place figures and tables inside a single column, but you can't use float environments. The caption package provides the \captionof command which allows to add captions outside float environments. In principal such objects inside a column could look like shown below.
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{multicol}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{multicols}{2}
\blindtext
\medskip
\noindent
\begin{minipage}{\linewidth}
\centering
\rule{0.75\linewidth}{0.5\linewidth}
\captionof{figure}{Dummy figure}\label{fig:dummy}
\end{minipage}
\medskip
\blindtext
\medskip
\noindent
\begin{minipage}{\linewidth}
\captionof{table}{Dummy table}\label{tab:dummy}
\centering
\rule{0.75\linewidth}{0.5\linewidth}
\end{minipage}
\medskip
\blindtext
\end{multicols}
\end{document}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 6
- Joined: Tue Mar 29, 2011 7:25 pm
Re: \previouspage command?
I don't know if we're zeroing in on a solution or getting further from it. Minipages won't float--they are placed exactly where they lie in the text. I suspect that the the \onecolumn and \twocolumn route still may be best for my article because multicols won't allow single-column floats. Manually placing a dozen figures after every revision of my article could add up to several days of tedium over the course of this paper.
Due to the pagebreak inherent with the \twocolumn command, following it with a command that would write overtop of the previous page would be a great solution. No such command?
Chad
Due to the pagebreak inherent with the \twocolumn command, following it with a command that would write overtop of the previous page would be a great solution. No such command?
Chad
\previouspage command?
You could try the flowfram package:
Regards
Nicola Talbot
Code: Select all
\documentclass{article}
\usepackage{flowfram}
\usepackage{lipsum}% dummy text for sample document
% Frames for page 1:
\twocolumntop[1]{flow}{0.5\textheight}
% set up 2 columns for page 2 onwards:
\twocolumn[>1]
\begin{document}
\lipsum[1-2]
% Needed to move to a columns with different width from
% the previous column:
\framebreak
\lipsum
\end{document}
Nicola Talbot
LaTeX Resources: http://www.dickimaw-books.com/latexresources.html
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
-
- Posts: 6
- Joined: Tue Mar 29, 2011 7:25 pm
\previouspage command?
Nicola,
This is a promising solution! Now how do I work with full page-width tables (see the image)? Also, this is causing issues with text not staying inside the column, as shown here:
Thoughts?
Chad
This is a promising solution! Now how do I work with full page-width tables (see the image)? Also, this is causing issues with text not staying inside the column, as shown here:
Thoughts?
Chad
\previouspage command?
You can't use the usual column spanning floats with flowfram as the columns have arbitrary numbers, dimensions and locations (as opposed to standard two column layout). The only way to achieve it is to create a different frame layout for the pages requiring the wide float and have a wide static or dynamic frame to put the table in. Modifying the example code I gave:climatologist wrote:Now how do I work with full page-width tables (see the image)?
Code: Select all
\documentclass{article}
\usepackage{flowfram}
\usepackage{lipsum}% dummy text for sample document
% Frames for page 1
\twocolumntop[1]{flow}{0.5\textheight}
\twocolumn[2-4,>5] % set up 2 columns for given page list
% Wide table on page 5:
\twocolumntop[5]{dynamic}{0.2\textheight}% adjust height to fit table
% Give dynamic frame a label to make it easier to identify:
\setdynamicframe{1}{label=table1}
\begin{document}
\lipsum[1-2]
% Needed to move to a columns with different width from
% the previous column:
\framebreak
\lipsum[3-22]
\setdynamiccontents*{table1}{%
\begin{statictable}
\centering
A very wide table
\caption{Sample table}
\end{statictable}
}
\lipsum[23-30]
\end{document}
This is a problem that will happen with narrow columns. The narrower the column, the harder it is for TeX to work out the best place to break the lines.Also, this is causing issues with text not staying inside the column, as shown here:
Regards
Nicola Talbot
LaTeX Resources: http://www.dickimaw-books.com/latexresources.html
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/