GeneralOpenright style document with article

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Ikkath
Posts: 4
Joined: Tue Oct 21, 2008 1:59 am

Openright style document with article

Post by Ikkath »

Hi guys,

I am trying to create a simple standalone article (no cover, etc) that will run to 10 or so pages. I require it to be printed two sided and am having a few issues that I dont think I have come across before.

\documentclass[a4paper,twoside,openright,12pt]{article}

Does not shift the document as intended (apparently openright is not supported with article) - so here is my question: How do I get conventional article formatting and have odd pages openright? It seems like quite a common thing to want, but I can't find anyway to do it!

Thanks in advance,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10312
Joined: Mon Mar 10, 2008 9:44 pm

Openright style document with article

Post by Stefan Kottwitz »

Hi Ikkath,

welcome to the board!
To achieve that sections will be starting at odd-numbered (right) pages you could redefine \section this way:

Code: Select all

\newcommand*\stdsection{}
\let\stdsection\section
\renewcommand*\section{%
\clearpage\ifodd\value{page}\else\mbox{}\clearpage\fi
\stdsection}
Stefan
LaTeX.org admin
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Openright style document with article

Post by Juanjo »

The openright and openany options only are defined in classes having chapters (report and book). They only affect to the definition of \part and \chapter, which include a \cleardoublepage command if openright is in effect, and \clearpage, otherwise. In an article of 10 pages long, with, say, three or four sections, the simplest solution is to add \cleardoublepage whenever you want to start in an odd page.

Edited: Stefan, I've just seen your post. I've been late. Anyway, even simpler:

Code: Select all

\let\stdsection\section
\renewcommand*\section{\cleardoublepage\stdsection}
(Before \let, \newcommand is not neccesary)
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10312
Joined: Mon Mar 10, 2008 9:44 pm

Re: Openright style document with article

Post by Stefan Kottwitz »

Hi Juanjo,

indeed, the \newcommand is not necessary, I know that. I like to use \newcommand before \let because LaTeX would warn then if accidently an existing command would be overwritten by \let without notice. It's just to prevent errors. What do you think about this in general, when redefining other macros?

Stefan
LaTeX.org admin
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Openright style document with article

Post by Juanjo »

Sorry about my comment. I should have supposed that you knew it. Concerning \newcommand, you are right. It allows to detect if a command has already been defined. However, it may yield error messages that seem weird to unawared people. Try \newcommand{\endocrinology}{} ;) .

In short pieces of code, like many ones in the forum, I don't find really necessary to be so careful. We usually manage well known macros or macros that, prior to be defined, we know they have never been used (as \stdsection) or are not essential. For more complex code, instead of a check with \newcommand, I would suggest to rely on conditionals (\ifx\undefined or \@ifundefined, depending on cases), since they allow to control the flow of the compilation, instead of stopping it (which is what a failed \newcommand does).
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Ikkath
Posts: 4
Joined: Tue Oct 21, 2008 1:59 am

Re: Openright style document with article

Post by Ikkath »

Thanks guys, but perhaps I was not quite clear.

I should have specified that I am using a titlepage and abstract with the article and as such those need to be aligned to the right starting with the first page also...

Furthermore I would like to keep the conventional article stlye and not insert extra page breaks into the flow of the sections.

I think I am missing something here, but shouldn't the default for a twoside article be that the first page be right aligned? I can't think where I have seen an article start on the left...


Cheers for the help so far guys and the welcome to the board!

edit: Could I just not flip how the odd and even margins are defined? (this just came to me, but I am unable to test atm)

- Ikk
User avatar
Stefan Kottwitz
Site Admin
Posts: 10312
Joined: Mon Mar 10, 2008 9:44 pm

Openright style document with article

Post by Stefan Kottwitz »

Hi Ikk,

odd pages are right pages.
Some explanation concerning the margins: imagine you're having a twosided document open before you. The visible inner whitespace should match the outer whitespace, that's why the inner margin of a page should be half of the outer margin. Just open some books and compare inner and outer margins. Do you really want to exchange that? Do you like for instance 2cm on the left, the left text block, 8cm in the middle, the right text block and again 2cm margin?
If a binding correction is needed that's another issue that could be solved, but at the moment we don't talk about possible space loss yet.

Nevertheless, with the geometry package you could set margins as you like. I prefer typarea with its interface for typographically good page layout including binding correction.

Does this answer your question? Feel free to ask if you're having questions.

Stefan
LaTeX.org admin
Ikkath
Posts: 4
Joined: Tue Oct 21, 2008 1:59 am

Openright style document with article

Post by Ikkath »

Aaah I see what you mean.

It does make sense that the margins either side of the text frame it equally on both pages when taking into account the sum of the central whitespace.

I guess the correct way to achieve what I want is with some kind of binding offset so that I can shift odd pages to the right and even pages to the left by some fixed delta so that with those taken into account the whitespace is still "equal".

Something like:

Code: Select all

\usepackage[bindingoffset=1cm,margin=2cm, includeheadfoot]{geometry}
Though this doesn't seem to preseve the equality of the resulting margins as well as using the default margins from the article class (in fact it seems to ignore it entirely ?).

Is this the "best" approach to this "problem"?

Many thanks so far guys,

Ikk
User avatar
Stefan Kottwitz
Site Admin
Posts: 10312
Joined: Mon Mar 10, 2008 9:44 pm

Openright style document with article

Post by Stefan Kottwitz »

geometry has a lot of options, just find out what's best for you. There's no "best" approach, I think, there are just different ways. If somebody just wants a very good layout without much calculation or programming he could use typearea to get an automatically calculated good layout with binding correction. The documention explains a lot. If one knows exactly what he wants to achieve geometry would be the choice to set exact adjustments.

Stefan
LaTeX.org admin
Ikkath
Posts: 4
Joined: Tue Oct 21, 2008 1:59 am

Re: Openright style document with article

Post by Ikkath »

Ok, cheers for the help.

I will take a look at the typearea package for completeness sake.

Nice work on this community btw.


- Ikk
Post Reply