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?

6
  • 3
    There's no \chapter in the article class. It can't compile.
    – Bernard
    Jun 10 '18 at 9:43
  • 2
    Furthermore your use of \\* seems quite strange. You should simply remove them.
    – TeXnician
    Jun 10 '18 at 9:44
  • Then what class should I choose for writing lecture notes. Also if I want to go to next line, then what should I use instead of \*.
    – Khushal
    Jun 10 '18 at 10:03
  • You can find some useful information on how to start a new line here: When to use \par and when \\, or blank lines and here: What does \* do?
    – leandriis
    Jun 10 '18 at 10:25
  • You'll probably want to use book or report (see this answer). You should rarely have to explicitly tell LaTeX to skip to the next line because it automatically begins things like chapter titles, itemize items etc. on separate lines. Note that paragraphs should be sepaparted by an empty line (or a \par). Jun 10 '18 at 10:26
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

4
  • 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

3
  • What if I have to add a heading before the paragraph? The heading is " Why Symplectic Geometry?"? Do I have to insert it as a title or should I put it in the body?
    – Khushal
    Jun 10 '18 at 11:20
  • You mean a heading, not a section title? Centred too?
    – Bernard
    Jun 10 '18 at 11:25
  • Actually a section title. It should be on the left.
    – Khushal
    Jun 10 '18 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.