4

I would like to span \textit{} in several line in \author{} tag.

So far I know I can do this ( but here \LARGE will only affect the Name) :

% title
\title{\textbf{Cool title}}
\author{\LARGE Name\\
        \emph{University}\\
        \emph{Faculty}\\
        \emph{mail@mail.com}
        }
\date{}         % Do not print the date on the final paper!
\maketitle

But if I try to

\author{\LARGE{Name\\
        \emph{University\\ 
        Faculty\\ 
        mail@mail.com}
        }
        }

I get the following error :

There were errors in your LaTeX source

./main.tex:60: Missing } inserted. [\maketitle]
./main.tex:60: Missing } inserted. [\maketitle]
./main.tex:60: Missing \cr inserted. [\maketitle]
./main.tex:60: Missing \cr inserted. [\maketitle]
./main.tex:60: Misplaced \cr. [\maketitle]

EDIT

\author{\itshape Name\\
        University\\ 
        Faculty\\ 
        mail@mail.com
        }

This would only affect Name also.

EDIT

I use following the documentclass

\documentclass[a4paper,11pt]{article}
lockstep
  • 250,273
Patryk
  • 961
  • 1
    The reason this happens, I think, is that internally LaTeX typesets the author in a tabular environment. That is, article.cls includes a definition of \maketitle which includes \begin{tabular}[t]{c}@author\end{tabular} and so the font selection is "grouped" in the same way it is in any entry in a tabular. It is also why you get errors if you try to use e.g. \emph across lines. You would either need to redefine \maketitle or use a package which does so, I think. For example, you might look at the titling package. – cfr Jan 05 '14 at 20:37

4 Answers4

5

The typesetting of the address takes place in a one column tabular environment, so

\emph{First line\\
second line}

is illegal as it would be in

\begin{tabular}{c}
\emph{First line\\
second line
\end{tabular}

The simplest remedy is to use the package authblk:

\documentclass{article}
\usepackage{authblk}
\renewcommand{\Authfont}{\LARGE\normalfont}
\renewcommand{\Affilfont}{\normalsize\itshape}

\begin{document}

\title{Some title}
\author{Name}
\affil{University\\
  Faculty\\
  email@uni.edu}

\maketitle

\end{document}

enter image description here

egreg
  • 1,121,712
2

The reason this happens is that internally LaTeX typesets the author in a tabular environment. That is, article.cls includes a definition of \maketitle which includes

\begin{tabular}[t]{c}
\@author
\end{tabular} 

and so the font selection is "grouped" in the same way it is in any entry in a tabular. It is also why you get errors if you try to use e.g. \emph across lines.

The titling package can be used to redefine elements of the \maketitle command. This example adds a little space beneath your name before typesetting your affiliation and email details. It defines a new command \affiliation{} to hold these details which does not use the tabular environment. It also builds the font shape selection into the redefinition of \maketitle.

\documentclass[a4paper,11pt]{article}
\usepackage{titling}
  \pretitle{\begin{center}\LARGE\bfseries}
  \preauthor{\begin{center}
    \LARGE \lineskip 0.5em%
    \begin{tabular}[t]{c}}
  \postauthor{\end{tabular}\end{center}}
  \newcommand{\affiliation}[1]{%
    \gdef\affil{#1}}
  \renewcommand{\maketitlehookc}{%
    \centering\itshape \affil\par}


% title
\title{Cool title}
\author{Name}
\affiliation{University\\
        Faculty\\
        mail@mail.com
        }
\date{}         % Do not print the date on the final paper!

\begin{document}
\maketitle

\end{document}

Use of titling command to redefine aspects of \maketitle

cfr
  • 198,882
1

I struggled with this many times. I suggest you give up and do what I did: type \LARGE in each line again. If you need to change the line spacing, you can always use \renewcommand\baselinestretch to whatever number you need.

Yossi Gil
  • 15,951
  • 1
    Never give up if your desires are legal especially when you have this site up and running ;-) –  Jan 06 '14 at 00:04
1

With any KOMA-Script class or with the package scrextend in combination with a standard class the following works since recently published version 3.12. So, in your situation with the latter case you can do this:

\documentclass{article}
\usepackage[T1]{fontenc}

\usepackage[extendedfeature=title]{scrextend} % adds several KOMA-Script
                                              % specific features
\addtokomafont{author}{\Huge\em} % KOMA-Script command

\begin{document}
\title{\textbf{Cool title}}
\author{\textup{Name}\\
        University\\
        Faculty\\
        mail@mail.com
       }
\date{}
\maketitle
\end{document}

The KOMA-Script specific titling feature must explicitly activated in scrextend. Note, that I added \Huge\em (very huge just for making it more visible) for the whole entry and then switched back from emphasising only for the “Name”.

In all earlier KOMA-Script versions inclusive 3.11b the command \addtokomafont{author}{…} does not work. KOMA-Script also switches to the sans-serif font for all titles. If this is not appealing, one can add the following line before or after \addtokomafont…:

\setkomafont{disposition}{\rmfamily}
Speravir
  • 19,491