Text Formattingtitlepage formating

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

titlepage formating

Post by Kaspars »

Hello,

Here is my code:

Code: Select all

\documentclass[12pt,a4paper,fleqn]{article}

\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{polyglossia}
\usepackage{appendix}
\setotherlanguages{english}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{titlepage}
\title{\LARGE{\textbf{School name}} 
\\ \LARGE{Faculty}
\\ \LARGE {institute}}
\vspace{50mm}
\author{\LARGE{\textbf{Name Surname}}}
\pagebreak
\end{titlepage}
\begin{document}
\maketitle
\tableofcontents
\begin{abstract}
\end{abstract}
\section{first section}
TEXT
\section{second section}
TEXT
\subsection{Subsection}
TEXT
\end{document}
1. In my program you can see, that in TOC there is:
2.1. subsection...............................1
but first section and second section is wihout dots:
1. first section __________________________ 1
So how, can I get these dots?

2. Is there in Latex function, so I can center all titles? I want to center all sections, subsections ect.

3. At the end about title page formating. Why I can't write just text, and use hsapce and vspace functions? My aim is to create title page, that looks like this:
http://www.annemini.com/wp-content/uplo ... e-page.jpg
So I could use flushright, flushleft, center, hspace, vspace ect.

4. And, the last one, How can I take off page numbering only prom title page? But keep numbering, so the second page number ir 2, not 1. I other words, I want to hide title page numbering.

Thanks for any help. :)
Last edited by Kaspars on Tue Mar 08, 2011 11:07 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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

titlepage formating

Post by meho_r »

1. Package: titletoc.
2. Package: titlesec.
3. You don't have to use titlepage environment. Just create a normal page and use all commands you like and consider appropriate.
4. Command: \thispagestyle{empty}.

Code: Select all

\documentclass[12pt,a4paper,fleqn]{article}

\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{polyglossia}
\usepackage{appendix}
\setotherlanguages{english}
\usepackage{graphicx}
\usepackage{amsmath}

\usepackage{titlesec,titletoc}


%%% Changing sectioning units in main text

\titleformat{\section}
	{\Large\bfseries\filcenter}% Title and number text formatting
	{\thesection}% Number formatting
	{1em}% Spacing between the number and the title
	{}% Command/text between the number and the title
	[]% Command/text after the title
	
\titleformat{\subsection}
	{\large\bfseries\filcenter}% Title and number text formatting
	{\thesubsection}% Number formatting
	{1em}% Spacing between the number and the title
	{}% Command/text between the number and the title
	[]% Command/text after the title


%%% Changing sectioning units in TOC

\titlecontents{section}
	[1.5em]% Left margin
	{\bfseries\vspace{1em}}% Text and number formatting
	{\contentslabel{1.5em}}% Number formatting
	{\hspace*{-1.5em}}% Formatting when there’s no number
	{\titlerule*[1pc]{.}\contentspage}% Filler and page number
	[]% Command/text after the title

\titlecontents{subsection}
	[2.3em]% Left margin
	{}% Text and number formatting
	{\hspace{1.5em}\contentslabel{2.3em}}% Number formatting
	{\hspace*{-2.3em}}% Formatting when there’s no number
	{\titlerule*[1pc]{.}\contentspage}% Filler and page number
	[]% Command/text after the title


\begin{document}


%%% Title page

\thispagestyle{empty}% Removes page numbers for this page only

\vspace*{30mm}

\begin{center}\LARGE

\textbf{School name}\\
Faculty\\
institute

\vspace{50mm}

\textbf{Name Surname}

\end{center}

\clearpage% or \cleardoublepage if you want TOC to be on the right page


%%% TOC

\tableofcontents


%%% Main text

\begin{abstract}

Abstract\ldots

\end{abstract}


\section{first section}

TEXT

\section{second section}

TEXT

\subsection{Subsection}

TEXT


\end{document}
west.logan
Posts: 87
Joined: Tue Sep 14, 2010 6:58 pm

titlepage formating

Post by west.logan »

See the code below, but a couple of things. All the packages you used were unnecessary for this example. I don't like to use a bunch of packages myself, I'm a minimalist.

3. the reason you couldn't use regular vspace and such is that you were declaring your titlepage environment before the "begin{document}". If you use the titlepage environment, then just go ahead and make your styles the way you want them without relying on the default "maketitle" spacing. The title page has been set up as your example.

Code: Select all

\documentclass[12pt,a4paper,fleqn]{article}

\makeatletter
%Make dotted line at sections in toc.
\renewcommand{\l@section}{\@dottedtocline{1}{0em}{1.5em}}
%change section to be centered.
\renewcommand\section{\@startsection {section}{1}{\z@}%
  {-3.5ex \@plus -1ex \@minus -.2ex}%
  {2.3ex \@plus.2ex}%
  {\centering\normalfont\Large\bfseries}}
%change subsection to be centered.
\renewcommand\subsection{\@startsection {subsection}{1}{\z@}%
  {-3.5ex \@plus -1ex \@minus -.2ex}%
  {2.3ex \@plus.2ex}%
  {\centering\normalfont\large\bfseries}}
%change subsubsection to be centered  
\renewcommand\subsubsection{\@startsection {subsubsection}{1}{\z@}%
  {-3.5ex \@plus -1ex \@minus -.2ex}%
  {2.3ex \@plus.2ex}%
  {\centering\normalfont\bfseries}}
\makeatother


\begin{document}
\begin{titlepage}
\centering
\LARGE
\textbf{School name}\\ 
Faculty\\
Institute\\ \vspace{50mm}
\textbf{Name Surname}
\vfill
\normalsize
\hfill\parbox[r]{5cm}{Contact:  \vspace{1em} \\
This is a parbox that you can type text in and it goes at the bottom of the page.}
%eliminate the page number and then go to next page
\thispagestyle{empty}
\end{titlepage}


\setcounter{page}{2}
\tableofcontents
\begin{abstract}
\end{abstract}
\section{first section}
TEXT
\section{second section}
TEXT
\subsection{Subsection}
TEXT
\subsubsection{Subsubsection}
TEXT
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

titlepage formating

Post by localghost »

For the points 1) and 2) of your list you've already got suggestions. For the rest I recommend to use the titlepage environment. But for the »article« class you have to explicitly turn it on by a document class option (see code below). This way you will have a title page you can create as you like it without a page number.

Code: Select all

\documentclass[11pt,a4paper,titlepage,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\begin{document}
  \begin{titlepage}
    \raggedleft
    Some information\\
    about the document\\

    \vfill
    \centering
    \large
    A Title\\[\baselineskip]
    \normalsize
    --- A subtitle ---\\[\baselineskip]
    by\\[\baselineskip]
    An Author\\[\baselineskip]

    \vfill
    \raggedleft
    \begin{minipage}{0.3\textwidth}
      \raggedright
      Contact:\\[\baselineskip]
      Company Name\\
      Art Department\\
      Street, Number\\
      City, Postal Code\\
      Phone Number\\
      \texttt{email.contact@address.com}
    \end{minipage}
  \end{titlepage}
\end{document}

Thorsten
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Re: titlepage formating

Post by Kaspars »

Thanks for your help, my problem is solved :)
Post Reply