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 would like frontmatter should be in single column (one column). After \maketitle contents should be in 3 columns. How do control in LaTeX class file?

My LaTeX file:

\documentclass{owns}
\begin{document}
\title{Book Title}
\author{Balaji, K.\/}
\maketitle
\begin{multicols}{3}
...
\end{multicols}
\end{document}

Class file code is:

\def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\large \@date}%
\end{center}%
\par
\vskip 1.5em
\begin{multicols}{3}  
}

\AtEndDocument{\end{multicols}}

But it's not working. How do achieve this?

share|improve this question
    
Why have you got a dangling \bgroup at the end of your definition of \@maketitle? And why do you have \multicols both in the macro and in the document body? –  Thruston Aug 26 '13 at 12:48
    
@Thruston: I have edited the questions and i have need bodymatters should print in 3 columns. –  Balaji Aug 27 '13 at 4:49

1 Answer 1

up vote 9 down vote accepted

If you want to apply multicols behind the scene and not add it as an environment to the document body, then you need to ensure that it is automatically started after \maketitle and closed before \end{document}.

The use of \AtEndDocument the way you tried it is fine, but your placement of \begin{multicols}{3} inside \@maketitleis wrong. I don't know how the code for \maketitle looks in your "owns" class, but if it was modeled after the definition in the standard classes, say book.cls then \@maketitle inside is called inside a group and that then generates errors. So the correct placement for the start is at the very end of \maketitle and not at the end of \@maketitle.

As an example with the book class:

\documentclass[notitlepage]{book}

\usepackage{etoolbox} % for the \appto cmd  

\appto\maketitle{\begin{multicols}{3}}

\AtEndDocument{\end{multicols}}

\usepackage{multicol}

\usepackage{lipsum}

\begin{document}
\title{Book Title\thanks{A class using multicols}}
\author{Balaji, K.\/\thanks{And some more thanks}}
\maketitle
\lipsum[1-2]
\end{document}

As a result you get:

enter image description here

share|improve this answer
    
Great Frank! Working fine. –  Balaji Aug 27 '13 at 9:46
    
It's possible environment should be multicolumn. Please refer <a href="tex.stackexchange.com/questions/113682/… possible?</a> –  Balaji Aug 28 '13 at 6:00

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.