TransWikia.com

How do I automatically have LaTeX have all the text on the first page in one column, and in two columns the rest of the document?

TeX - LaTeX Asked by Wibbo on January 8, 2021

As the title says, I want the first page of my document to be in a single column and the rest to be in two columns. That sounds easy, but I’d like to have a way for LaTeX to automatically make this break, instead (as I have until now) manually setting a breakpoint, either using mulitcol or just onecolumn twocolumn.

So, the first page would look something like
enter image description here

and the rest would look something like
enter image description here

I experimented with changing the firstpagestyle a bit but could not figure out how to do that without having to create a new environment in which I still needed to manually break the text up in two sections.

For the sake of completion, here’s a (very) MWE

documentclass[twocolumn]{article}
usepackage[utf8]{inputenc}

usepackage{lipsum}

title{test}
author{Thomas Jorna}
date{July 2020}

begin{document}
maketitle
section{Lorem}
lipsum[1-30]
end{document}

How do I do this while keeping the document text the same?

One Answer

Apologies to John Kormylo; I was spending a long time composing this and your comment appeared before I had finished, but I'm posting my answer anyway.

TeX typesets paragraph by paragraph and at the end of each paragraph checks whether there should have been a page break durung the paragraph. If so then it typesets the first part of the paragraph, inserts the page break and moves the rest of the paragraph without retypesetting to the next page. This means that if the page styles of the two pages differ the bottom part of the paragraph will retain the format for the first page, not change to that of the second page.

The memoir class provides a command parnopar which will invisibly force a new paragraph. Its definition, based on The TeXbook Exercise 14.15 is:

newcommand{parnopar}{parfillskip=0ptparparskip=0ptnoindent}

If you put this (enclosed in braces) after the last word on the fist page then the following text will be typeset on the next page according to its layout.

.... bottom line on the page {parnopar}
first line for the next page ...

I know of no way of doing this automatically. Process your document and look at the output. Then edit the document inserting the {parnopar} between the appropriate word pair in the awkward paragraph.

The following example is meant to show that the paragraph split is invisible in the typeset output.

% useparnopar.tex
documentclass{article}
newcommand{parnopar}{parfillskip=0ptparparskip=0ptnoindent}

begin{document}

This paragraph has many lines.
This paragraph includes many lines.
Many lines are typeset in this paragraph.
There are many lines in this paragraph.
This paragraph has many lines.
This paragraph includes many lines.
Many lines are typeset in this paragraph.
There are many lines in this paragraph. % {parnopar}
This paragraph has many lines.
This paragraph includes many lines.
Many lines are typeset in this paragraph.
There are many lines in this paragraph.

Now for another paragraph with verb|{parnopar}|!

This paragraph has many lines.
This paragraph includes many lines.
Many lines are typeset in this paragraph.
There are many lines in this paragraph.
This paragraph has many lines.
This paragraph includes many lines.
Many lines are typeset in this paragraph.
There are many lines in this paragraph. {parnopar}
This paragraph has many lines. 
This paragraph includes many lines.
Many lines are typeset in this paragraph.
There are many lines in this paragraph.

And something afterwards.

end{document}

Correct answer by Peter Wilson on January 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP