Text FormattingTitle is long, no spacing when go to the next line.

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
yan
Posts: 3
Joined: Sun May 09, 2010 9:33 am

Title is long, no spacing when go to the next line.

Post by yan »

Hi Everyone,

Need help on title page. I build my own .sty for modify the titlepage.
When my title is too long, it should go the next line with some spacing but it doesnt spacing in my case. I use report.cls.

Code: Select all

\def\@id{\relax}
\newcommand{\id}[1]{\gdef\@id{#1}}
\def\@years{\relax}
\newcommand{\years}[1]{\gdef\@years{#1}}

\renewcommand{\maketitle}{
\null
\vfill
\thispagestyle{empty}
\begin{center}
{\rmfamily\LARGE \bf \@title}\\
\vspace{4cm}
{\rmfamily\LARGE \@author}\\
\vspace{1cm}
{\rmfamily\LARGE \@id}\\
\vspace{4cm}
{\rmfamily\LARGE \@years}\\
\vspace{1cm}
{\rmfamily\LARGE FACULTY OF ENGINEERING}\\
\vspace{1cm}
{\rmfamily\LARGE MULTIMEDIA UNIVERSITY}\\
\vspace{1cm}
{\rmfamily\LARGE \@date}\\
\vspace{1cm}
\end{center}
\cleardoublepage
\vfill
\null
}
Put the "\\" inside--->{\rmfamily\LARGE \bf \@title\\}, but dun know why?
Attachments
tex.png
tex.png (16.79 KiB) Viewed 1581 times
Last edited by yan on Mon May 10, 2010 6:11 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Title is long, no spacing when go to the next line.

Post by frabjous »

Don't ask me why, but for me it works better when you use paragraph breaks rather than manual breaks, e.g., something like:

Code: Select all

\renewcommand{\maketitle}{
\null
\vfill
\thispagestyle{empty}
\begin{center}
{

\rmfamily\LARGE \bfseries \@title

\mdseries\vspace{4cm}%
\@author

\vspace{1cm}%
\@id

\vspace{4cm}%
\@years

\vspace{1cm}%
FACULTY OF ENGINEERING

\vspace{1cm}%
MULTIMEDIA UNIVERSITY

\vspace{1cm}%
\@date

\vspace{1cm}
}
\end{center}
\cleardoublepage
\vfill
\null
}
But probably both methods are non-ideal, and someone will come along and tell us why soon enough.
Post Reply