Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a document, where I want two versions: one versions 10pt size and another version, 2 page to a side 12pt. So I currently have:

\documentclass[10pt,a4paper,oneside,openany,article]{memoir} 
\newif\ifprintver
%\printvertrue

\ifprintver
\usepackage{pgfpages}  
\pgfpagesuselayout{2 on 1}[a4paper,border shrink=1mm,landscape]
\fi

But I have to change the font size by hand. What can I put inside my \if that would change the font size document wide?

share|improve this question

4 Answers 4

up vote 6 down vote accepted

You can define your printver boolean before \documentclass and then use \documentclass inside an \ifprintver conditional:

\newif\ifprintver
%\printvertrue

\ifprintver
\documentclass[12pt,a4paper,oneside,openany,article]{memoir} 
\else
\documentclass[10pt,a4paper,oneside,openany,article]{memoir} 
\fi

% ... other code

\ifprintver
\usepackage{pgfpages}  
\pgfpagesuselayout{2 on 1}[a4paper,border shrink=1mm,landscape]
\fi

\usepackage{lipsum}

\begin{document}

\lipsum[1-100]

\end{document}
share|improve this answer
    
Nice solution, but you should swap 10pt and 12pt in your code example. –  lockstep Jan 22 '11 at 23:58
    
@lockstep: thanks for noticing, I've made the change. –  Philippe Goutet Jan 23 '11 at 8:59
    
I'm beginning to learn that "the first line in your .tex file must be a document class" is a LIE!!!! Thanks for this. –  Seamus Jan 23 '11 at 12:07

The KOMA-Script-classes feature the macro \changefontsizes which allows you to change the main font size mid-document. This macro is also part of the scrextend package, which can (or at least it seems so) be made compatible with the memoir class.

\documentclass[10pt,a4paper,oneside,openany,article]{memoir} 

\makeatletter
\let\@textsubscript\relax
\let\setfootnoterule\relax
\let\multiplefootnotemarker\relax
\makeatother

\usepackage{scrextend}

\newif\ifprintver
\printvertrue

\ifprintver
\usepackage{pgfpages}  
\pgfpagesuselayout{2 on 1}[a4paper,border shrink=1mm,landscape]
\changefontsizes{12}
\fi

\usepackage{blindtext}

\begin{document}

\blindtext

\end{document}
share|improve this answer

use a variable for the font size setting, e.g.

\documentclass[\FontSize, a4paper]{article}

and then run pdflatex with

pdflatex '\def\FontSize{12pt}\input{<your_file>.tex}'

now you can simply change the fontsize

share|improve this answer
    
You could also use pdflatex '\PassOptionsToClass{12pt}{article}\input{<your file>.tex}' –  Martin Scharrer Jan 30 '11 at 19:59

I am not sure if it is a good idea, just to set the font-size. There are more subtle differences, such as setting equation number sizing etc. What LaTeX does when processing the options is that it imports a file with the sizing and other related definitions with the extension .clo. You can try this:

\input{size12.clo}

For each class LaTeX uses slightly different conventions, for example in the book class, it uses bk10.clo.

share|improve this answer
2  
The .clo files use \newcommand, so you have to undefine all of the sizing commands before this works. –  Will Robertson Jan 23 '11 at 0:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.