Introduction to LaTeX - LaTeX Tutorial for Beginners

22 downloads 275839 Views 559KB Size Report
LATEX Tutorial for Beginners. Dr. K. Manoj. Assistant Professor ... Windows: TeXnicCenter, MiKTeX, Sumathra PDF, Adobe Reader. OS X: TeXShop, MacTeX or ...
Introduction to LATEX LATEX Tutorial for Beginners Dr. K. Manoj Assistant Professor Manonmaniam Sundaranar University [email protected] http://mylatexhelp.blogspot.in/

July 2016

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

1 / 23

Introduction about LATEX

What is LATEX?

LATEX is a typesetting program It is an extension of the original program TEX written by Donald Knuth. What is a typesetting program? The text is entered into the computer. The input text is formatted into lines, paragraphs and pages. The output text is displayed on the computer screen. The final output is printed.

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

2 / 23

Introduction about LATEX

Why LATEX?

It’s free. It’s available for many machines. TEX is to beautifully typeset technical documents especially those containing a lot of Mathematics. It is very difficult (sometimes even impossible) to produce complex mathematical formulas using a word processor. If you want your document to look really beautiful then LATEX is the natural choice.

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

3 / 23

Introduction about LATEX

Software Requirements for LATEX Typesetting

1

Text Editor

2

LATEX - Binaries

3

Output Viewer for PDF/DVI files

Editors & Viewers Windows: TeXnicCenter, MiKTeX, Sumathra PDF, Adobe Reader OS X: TeXShop, MacTeX or TeX-live Linux: Emacsen, gvim, Texmaker, Kile, TeX-live

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

4 / 23

Introduction about LATEX

A Sample LATEX Documents

Example Document Command \documentclass{article} \begin{document} This is some sample text. \end{document}

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

5 / 23

Introduction about LATEX

Parts of a LaTeX Document The basic LATEX Document classes: LATEX Command

Document Class \documentclass[options]{class} options = a4paper, 11pt, 12pt, 10pt, twocolumn, landscape,... class = {article},{report},{book},{letter}

Packages \usepackage{package name} epsfig = insert PS pictures into the document fancyhdr = easy definition of footer and header Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

6 / 23

Introduction about LATEX

Parts of a LaTeX Document: Environment LATEX Command Start with \begin{. . .} End with \end{. . .} \begin{document} ... \begin{equation} ...

\end{document} \end{equation}

Typesetting Text \\ or \newline and \newpage Bold - \textbf{} or \bf Italics \emph{} or \textit{} or \it Underline \underline{} or \ul

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

7 / 23

Introduction about LATEX

Sections

Sections \section{Introduction} - 1. Introduction \subsection{Introduction} - 1.1 Introduction \subsubsection{Introduction} - 1.1.1 Introduction \appendix - changes numbering scheme \chapter{...} - To be used with book and report

Title and Authors: \title{} \author{names} \footnote{Other Informations}{Manoj} - 1 Manoj

1

Other Informations

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

8 / 23

Introduction about LATEX

List Environment

INPUT COMMAND: \begin{itemize} \item Ram is a small boy. \item He lived in Tirunelveli. \end{itemize} OUTPUT: Ram is a small boy. He lived in Tirunelveli.

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

9 / 23

Introduction about LATEX

Cont... INPUT COMMAND: \begin{itemize} \item \end{itemize} \begin{enumerate} \item \end{enumerate} \begin{description} \item[label] description \end{description} \begin{list}{label}{spacing} \item \end{list}

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

10 / 23

Introduction about LATEX

How to use Symbols? Commands \theta \mu \gamma \emptyset \omega \eta \alpha \sigma \sigma \pi \Pi

Dr. K. Manoj (MS University)

Output θ µ γ ∅ ω η α σ Σ π Π

Introduction to LATEX

July 2016

11 / 23

Introduction about LATEX

Font Sizes Command \tiny Hello \scriptsize Hello \footnotesize Hello \small Hello \normalsize Hello \large Hello \Large Hello

Output Font Size

\LARGE Hello

Hello

\huge Hello

Hello

\Huge Hello

Hello

Dr. K. Manoj (MS University)

Introduction to LATEX

Hello

Hello

Hello

Hello

Hello

Hello

Hello

July 2016

12 / 23

Introduction about LATEX

How to write a equations? All the equations must contain between $ ... $ Symbols. Commands \sum_{i=1}^{n}{(x_i-\bar{x})} x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} \int_0^\infty \frac{\partial u}{\partial x} \int_{a}^{b} f(x)dx = F(b) - F(a)

Output Pn ¯) i=1 (xi − x x=

Rb a

√ −b± b2 −4ac R ∞2a 0 ∂u ∂x

f (x)dx = F (b) − F (a)

Equation Editor online: https://www.codecogs.com/latex/eqneditor.php http://www.hostmath.com/ https://www.latex4technics.com/ Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

13 / 23

Introduction about LATEX

Displaying equations types Input Equations in to anywhere in the paragraph text using $...$ Displaying equations in to center of the places using \[...\] Displaying equation with equation numbers using tag between \begin{equation} content... \end{equation} Pn

i=1

(xi − x ¯) n X

(xi − x ¯)

i=1 n X

(xi − x ¯)

(1)

i=1

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

14 / 23

Introduction about LATEX

How to Insert Images

INPUT COMMAND: \begin{figure} \centering \includegraphics [width=3cm, height=3cm] {CTAN-Lion-Logo} \caption{Lion Logo} \label{fig:Lion-logo} \end{figure}

Figure: Lion Logo

If you are using .eps files it requires \usepackage{epsfig}

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

15 / 23

Introduction about LATEX

Blocks of Highlighted Text

INPUT COMMAND: \begin{block}{Definition} Here put some text for definition or impartant text or Highlighted Text for show in a box. \end{block} OUTPUT: Definition Here put some text for definition or impartant text or Highlighted Text for show in a box.

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

16 / 23

Introduction about LATEX

Multiple Columns The ”c” option specifies centered vertical alignment while the ”t” option is used for top vertical alignment INPUT COMMAND: \begin{columns}[c] \column{.45\textwidth} % Left column and width \textbf{Heading} \begin{enumerate} \item Statement \item Explanation \end{enumerate} \column{.5\textwidth} % Right column and width Here put some of the texts \end{columns}

Dr. K. Manoj (MS University)

Here put some of the texts. Here put some of the texts. Here put some of the texts. Here put some of the texts

Introduction to LATEX

July 2016

17 / 23

Second Section

How to Create a Table INPUT COMMAND: \begin{table} \begin{tabular}{l l l} \toprule \textbf{Treatments} & \textbf{Response 1} & \textbf{Response 2}\\ \midrule Treatment 1 & 0.0003262 & 0.562 \\ Treatment 2 & 0.0015681 & 0.910 \\ \bottomrule \end{tabular} \caption{Table caption} \end{table}

Table: Table caption Treatments

Response 1

Response 2

Treatment 1 Treatment 2

0.0003262 0.0015681

0.562 0.910

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

18 / 23

Second Section

Theorem

INPUT COMMAND: \begin{theorem}[Mass--energy equivalence] $E = mc^2$ \end{theorem} Theorem (Mass–energy equivalence) E = mc2

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

19 / 23

Second Section

Citation

An example of the \cite command to cite within the presentation: This statement requires citation [Smith, 2012]. Example Document Command \begin{thebibliography}{99} \bibitem[Smith, 2012]{p1} John Smith (2012). Title of the publication, \emph{Journal Name} 12(3), 45 -- 678. \end{thebibliography}

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

20 / 23

Second Section

References

John Smith (2012). Title of the publication, Journal Name 12(3), 45 – 678.

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

21 / 23

Second Section

References Online Latex Tutorials https://www.latex-tutorial.com/tutorials/ https://www.sharelatex.com/blog/latex-guides/ beginners-tutorial.html http://www.pages.drexel.edu/~pyo22/students/ latexRelated/latexTutorial.html http://www.math.harvard.edu/texman/ Online Latex Table Generators http://www.tablesgenerator.com/ http://truben.no/table/old/ https://authortools.aas.org/LATEX/make-latex.html http://meluhha.com/tabular/ Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

22 / 23

Second Section

Thank You

Dr. K. Manoj (MS University)

Introduction to LATEX

July 2016

23 / 23