2

I am new to latex. This is my document. And my code is as follows:

\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}

\title{Symplectic Geometry in Classical Mechanics}

\author{}

\date{}

\begin{document}

\maketitle
\chapter{Lecture 1}
\chapter{Basics of Manifolds}\\*
It is a mathematical formalism underlying\\*
\begin{itemize}\\*
\item Geometrical Optics\\  
\item Classical Mechanics\\
\item General Relativity\\
\item Quantum Mechanics\\
\end{itemize}

Such a unifying formalism help us to solve problems in one area of physics
by using ideas from another areas.
It doesn't work for systems with loss, friction or noise.

\end{document}

Actually I want three titles in this document.

First - "Symplectic Geometry in Classical Mechanics"

Second - "Lecture 1"

Third - "Basics of Manifolds"

I want all the three to be in different lines at the centre. But the above code is not giving it properly. How to do it?

Khushal
  • 267

2 Answers2

3

You could define your own subtitle and subsubtitle commands with the help of the titling package as shown in the following example:

\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}

\usepackage{titling}
\newcommand{\subtitle}[1]{%
  \posttitle{%
    \par\end{center}
    \begin{center}\Large#1\end{center}
   }%
}



\newcommand{\subsubtitle}[1]{%
  \preauthor{%
    \begin{center}
    \large #1 \vskip0.5em
    \begin{tabular}[t]{c}
    }%
}


\title{Symplectic Geometry in Classical Mechanics }
\subtitle{Lecture 1}
\subsubtitle{Basics of Manifolds}
\author{}
\date{}

\begin{document}

\maketitle

It is a mathematical formalism underlying
\begin{itemize}
\item Geometrical Optics  
\item Classical Mechanics
\item General Relativity
\item Quantum Mechanics
\end{itemize}

Such a unifying formalism help us to solve problems in one area of physics
by using ideas from another areas.
It doesn't work for systems with loss, friction or noise.

\end{document}

enter image description here


To remove the white space below the subtitle (that is 'reserved' for author and date, you could use the following:

\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}

\usepackage{titling}
\newcommand{\subtitle}[1]{%
  \posttitle{%
    \par\end{center}
    \begin{center}\Large#1\end{center}
   }%
}



\newcommand{\subsubtitle}[1]{%
  \preauthor{%
    \begin{center}
    \large #1 \vskip0.5em
    %\begin{tabular}[t]{c}
    }%
}
  \postauthor{%
    \end{center}
    }%
\predate{}
\postdate{}

\title{Symplectic Geometry in Classical Mechanics }
\subtitle{Lecture 1}
\subsubtitle{Basics of Manifolds}
\author{}
\date{}

\begin{document}

\maketitle

It is a mathematical formalism underlying
\begin{itemize}
\item Geometrical Optics  
\item Classical Mechanics
\item General Relativity
\item Quantum Mechanics
\end{itemize}

Such a unifying formalism help us to solve problems in one area of physics
by using ideas from another areas.
It doesn't work for systems with loss, friction or noise.

\end{document}

enter image description here

A more 'quick and dirty' approach would be the following example, where is used \author for the subtitle and \date for the subsubtitle:

\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}


\title{Symplectic Geometry in Classical Mechanics }
\author{Lecture 1}
\date{Basics of Manifolds}

\begin{document}

\maketitle

It is a mathematical formalism underlying
\begin{itemize}
\item Geometrical Optics  
\item Classical Mechanics
\item General Relativity
\item Quantum Mechanics
\end{itemize}

Such a unifying formalism help us to solve problems in one area of physics
by using ideas from another areas.
It doesn't work for systems with loss, friction or noise.

\end{document}

enter image description here

leandriis
  • 62,593
  • There is to much space between basics of manifolds and the starting sentence. Is there a way to reduce it. – Khushal Jun 10 '18 at 11:18
  • @Khushal: This white space is kind of reserved for the author and date. Do you want to use them in your actual document? – leandriis Jun 10 '18 at 11:26
  • Yeah but what if I don't want to put author's name and date, can't I just remove that space? – Khushal Jun 10 '18 at 13:39
  • @Khushal: I have edited my answer to include two different possibilities on how to remove the white space between the subsubtitle and the first line of text. – leandriis Jun 10 '18 at 14:12
3

A variant with \maketitlehookb from titling:

\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage{titling}

\title{Symplectic Geometry in Classical Mechanics}

\author{I. Ego}

\date{\today}

\newcommand{\subtitle}[1]{%
\gdef\subT{#1}}
\newcommand{\subT}{}
\renewcommand{\maketitlehookb}{%
\par\Large\centering\noindent \subT}
\subtitle{Lecture1\\[1ex] Basics of Manifolds\vskip 2em}

\begin{document}

\maketitle

It is a mathematical formalism underlying%\\*
\begin{itemize}%\\*
\item Geometrical Optics%\\
\item Classical Mechanics%\\
\item General Relativity%\\
\item Quantum Mechanics%\\
\end{itemize}

Such a unifying formalism help us to solve problems in one area of physics
by using ideas from another areas.
It doesn't work for systems with loss, friction or noise.

\end{document} 

enter image description here

Bernard
  • 271,350