I want to do something like in http://stackoverflow.com/questions/1465665/passing-command-line-arguments-to-latex-document.
For better explanation I'll show a minimal running example:
My test.cls:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{test}[2012/01/11 helper class]
\ifdefined\bastitwocolumns%
\LoadClass[DIV14,parskip=full,twocolumns,landscape]{scrartcl}%
\else
\LoadClass[DIV14,parskip=full]{scrartcl}%
\fi
and now my test.tex:
\listfiles
\def\bastitwocolumns{}
\documentclass{test}
%\ifdefined\bastitwocolumns\documentclass[DIV14,parskip=full,landscape,twocolumn] {scrartcl}\else\documentclass[DIV14,parskip=full]{scrartcl}\fi
\usepackage{polyglossia}\setdefaultlanguage[spelling=new,babelshorthands=true]{german}
\usepackage{blindtext}
\begin{document}
\blindtext\blindtext\blindtext\\
\blindtext
\par
\blindtext\blindtext\blindtext\\
\blindtext
\end{document}
Compiling with xelatex first the way the files are, results in a one column document a4. Activating line 4 and commenting out line 3 results in a two column (so sad portrait) a4 document.
The orientation problem might be ignored.
Can anyone explain, why I can not enable this two column setting in my class?
Okay, here is another minimal running example, which shows the problems more precise:
XeLaTeX-file:
\listfiles
\def\bastitwocolumns{}
\documentclass{ebelinguebung}
%\ifdefined\bastitwocolumns\documentclass[DIV14,parskip=full,landscape,twocolumn] {scrartcl}\else\documentclass[DIV14,parskip=full] {scrartcl}\fi\usepackage{beamerarticle}\usepackage{oldebelinguebung}
\usepackage{blindtext}
\begin{document}
\blindtext\\ \blindtext \par \blindtext
\end{document}
Class-file:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ebelinguebung}[2012/01/11 helper class]
\ifdefined\bastitwocolumns%
\LoadClass[DIV14,parskip=full,landscape,twocolumn]{scrartcl}%
\else
\LoadClass[DIV14,parskip=full]{scrartcl}%
\fi
\RequirePackage{beamerarticle}
\RequirePackage[l2tabu,orthodox]{nag}
\RequirePackage{polyglossia}\setdefaultlanguage[spelling=new,babelshorthands=true] {german}
\RequirePackage{hyperref}
Style-file:
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ebelinguebung}[2012/01/11]
\RequirePackage[l2tabu,orthodox]{nag}
\RequirePackage{polyglossia}\setdefaultlanguage[spelling=new,babelshorthands=true]{german}
\RequirePackage{hyperref}
And now switching active lines 3 or 4 I get different results (one portrait, one landscape), which I like to understand.
Okay, after many tries I found one solution - which I do not really understand - but by the way:
In the logfile for twocolumn compilation with my class typearea shows (of course) the portrait sizes for the paper. But in the logfile for the package solution, typearea also tells
Package typearea Info: You've used standard option `landscape'.
(typearea) This is correct!
(typearea) Internally I'm using `paper=landscape'.
(typearea) If you'd like to set the option with \KOMAoptions,
(typearea) you'd have to use `paper=landscape' there
(typearea) instead of `landscape', too.
First trying paper=landscape direct into the class options only removes those hint. Second trying to set \KOMAoptions{paper=landscape,twocolumn}% (and removing the class options) within the if clause did, what I wanted.
Can anyone explain that?