diff options
author | Harish Badrinath | 2012-01-18 15:24:25 +0530 |
---|---|---|
committer | Harish Badrinath | 2012-01-18 15:24:25 +0530 |
commit | 25a9d3be4de75462a1e140137a3c3ed0aae99cd2 (patch) | |
tree | 15a4a94d9e56d44a3e2afa439beac0ce8463b9fd /Latex/Latex3/latex_basics.tex | |
parent | 53ee0eaac626e87385141fef103350b72e0aa93d (diff) | |
download | sdes-stscripts-25a9d3be4de75462a1e140137a3c3ed0aae99cd2.tar.gz sdes-stscripts-25a9d3be4de75462a1e140137a3c3ed0aae99cd2.tar.bz2 sdes-stscripts-25a9d3be4de75462a1e140137a3c3ed0aae99cd2.zip |
(IMP: Need to uncomment Excercise1 solution in Late3 slideshow)
Minor changes to latex_intro.tex.
Added Latex3 slides,
Added excersise 1 to latex3 rst file along with misc changes.
Diffstat (limited to 'Latex/Latex3/latex_basics.tex')
-rw-r--r-- | Latex/Latex3/latex_basics.tex | 403 |
1 files changed, 403 insertions, 0 deletions
diff --git a/Latex/Latex3/latex_basics.tex b/Latex/Latex3/latex_basics.tex new file mode 100644 index 0000000..a93d2ad --- /dev/null +++ b/Latex/Latex3/latex_basics.tex @@ -0,0 +1,403 @@ +\documentclass{beamer} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{fixltx2e} +\usepackage{graphicx} +\usepackage{longtable} +\usepackage{float} +\usepackage{wrapfig} +\usepackage{soul} +\usepackage{textcomp} +\usepackage{marvosym} +\usepackage{wasysym} +\usepackage{latexsym} +\usepackage{amssymb} +\usepackage{hyperref} +\tolerance=1000 +\usepackage[english]{babel} \usepackage{ae,aecompl} +\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} +\usepackage{listings} +\lstset{ + language=TeX, + basicstyle=\ttfamily\bfseries, + commentstyle=\ttfamily\color{blue}, + stringstyle=\ttfamily\color{orange}, + showstringspaces=false, + breaklines=true, + postbreak = \space\dots +} + + +\mode<presentation> +{ + \usetheme{Warsaw} + \useoutertheme{infolines} + \setbeamercovered{transparent} +} + +\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} + +\newcommand{\typ}[1]{\lstinline{#1}} + +\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } +\title {{\LaTeX} basics and structure} +\author {FOSSEE} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% DOCUMENT STARTS +\begin{document} + + +\begin{frame} + \begin{center} + \vspace{12pt} + \textcolor{blue}{\huge {\LaTeX} basics and structure} + \end{center} + \vspace{18pt} + \begin{center} + \vspace{10pt} + \includegraphics[scale=0.95]{../images/fossee-logo.png}\\ + \vspace{5pt} + \scriptsize Developed by FOSSEE Team, IIT-Bombay. \\ + \scriptsize Funded by National Mission on Education through ICT\\ + \scriptsize MHRD,Govt. of India\\ + \includegraphics[scale=0.30]{../images/iitb-logo.png}\\ + \end{center} +\end{frame} + +\begin{frame} + \frametitle{Objectives} + \label{sec-2} + At the end of this tutorial, you will be able to, + \begin{itemize} + \item Understand basic structure of a LaTeX document, its various document classes and loading packages that add new features to the LaTeX system. + \item Create a LaTeX document with a title and an abstract. + \item Create numbered and non-numbered sections and subsections in a LaTeX document. + \item Create an appendix in a LaTeX document. + \item Create a table of content in a LaTeX document. + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{A Very Basic {\LaTeX} document} + \begin{verbatim} + \documentclass{article} + \begin{document} + SAMPLE TEXT + \end{document} + \end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{documentclass command}} + \begin{center} + \begin{verbatim} + \documentclass{article} + \end{verbatim} + \end{center} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{documentclass command}\ \ldots} + \begin{center} + \begin{verbatim} + \documentclass [parameters] {DocumentClass} + \end{verbatim} + \end{center} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{documentclass command}\ \ldots} + \begin{itemize} + \item Used to select the \emph{class} of our document + \item Some available classes - \typ{article}, \typ{proc}, + \typ{report}, \typ{book}, \typ{slides}, \typ{letter}. + \item For example: + \typ{\\documentclass\[12pt,a4paper,draft\]\{report\}}\\ + The parameters within \typ{\[ \]} are optional. + \begin{itemize} + \item \typ{12pt} -- sets the font size of main font and others are + relatively, adjusted. \typ{10pt} is the default. + \item \typ{a4paper} -- specify paper size + \item \typ{draft} -- marks hyphenation and justification problems in + typesetting with a square in the margin + \end{itemize} + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{usepackage command}} + \begin{center} + \begin{verbatim} + \usepackage[options]{...} + \end{verbatim} + \end{center} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{Top Matter}} + Let's add the title, author's name and the date. + \begin{itemize} + \item Add title, author and date. + \item Compile. + \item Nothing changes. + \end{itemize} + \begin{verbatim} + \documentclass{article} + \title{My First LaTeX Document} + \author{Harish} + \begin{document} + Hello world! + \end{document} + \end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{Top Matter}\ \ldots} + Now we add \alert{maketitle} command, which inserts the top-matter + \begin{verbatim} + \documentclass{article} + \title{My First LaTeX Document} + \author{Harish} + \date + \begin{document} + \maketitle + Hello world! + \end{document} + \end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{abstract command}} + \begin{itemize} + \item \typ{abstract} environment inserts abstract. + \item Place it at the location where you want your abstract. + \end{itemize} + {\small + \begin{verbatim} + \begin{document} + \documentclass{article} + \title{My First LaTeX Document} + \author{Harish} + \begin{document} + \maketitle + Hello world! + \begin{abstract} + An Example Abstract + \end{abstract} + \end{document} + \end{verbatim} + } +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{Sectioning}} + \begin{itemize} + \item \lstinline{\section}, \lstinline{\subsection} + \lstinline{\subsubsection} + \item Auto numbered sections! + \item \typ{*} to prevent numbering of a section + \end{itemize} + {\tiny + \begin{verbatim} + \documentclass{article} + \author{Harish} + \date{31-February-2012} + \begin{document} + \maketitle + Hello world! + \section{Numbered Section 1} + Section1 Text + \section{Numbered Section 2} + Section2 Text + \section*{Unnumbered Section 1} + Section3 Text + \section*{Unnumbered Section 2} + Section4 Text + \end{document} + \end{verbatim} + } +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{Creating Chapters}} + \begin{itemize} + \item Longer documents, use \lstinline{report} or \lstinline{book} + class + \item Chapter can be added using \lstinline{\chapter} command + \end{itemize} + {\tiny + \begin{verbatim} + \documentclass{book} + \title{My first Book} + \begin{document} + \chapter{My First Chapter} + Main + \section{Section1} + Section 1 Text + \subsubsection{My First Subsection} + Numbered-Section 1's Subsection Text + \section{Section2} + Numbered-Section 2 Text + \section*{Section3} + First un-numbered Section Text + \section*{Section4} + Second un-numbered Section Text + \chapter{So We say goodbye} + Thank you for reading dear reader + \end{document} + \end{verbatim} + } +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{Sectioning and numbering}} + \begin{itemize} + \item subsections do not get numbering + \item Change \lstinline{secnumdepth} + \end{itemize} + \begin{lstlisting} + \setcounter{secnumdepth}{3} + \end{lstlisting} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{Table of Contents [TOC]}} + \begin{itemize} + \item Our document is short, but let's learn to add a TOC + \item Add \lstinline{\tableofcontents} where you want TOC to + appear + \item Compile + \item Only headings appear. No page numbers + \item A \lstinline{.toc} file is generated + \item Re-compile + \item Any numbered section/block automatically appears + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{TOC}\ \ldots} + \begin{itemize} + \item Un-numbered sections are added to TOC using + \lstinline{\addcontentsline} + \item For instance, \lstinline+\addcontentsline{toc}{section}{Intro}+ + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{Exercise 1}} + \begin{center} + Write a LaTeX script that creates a document of type article, which contains both a table of content and an appendix. The table of content should be at the +beginning of the document and the appendix at the end. + The book should contain two chapters, with the first chapter containing two numbered and two un-numbered sections. The first un-numbered section should be present in the table of content. + \end{center} +\end{frame} + +\begin{frame}[fragile] +\frametitle{\typ{Excercise 1: Solution}} + \begin{center} + Note: File needs to be compiled twice + \end{center} + {\tiny + \begin{center} +% \begin{verbatim} +% \documentclass{article} +% \title{article with an appendix} +% \begin{document} +% \tableofcontents +% \pagebreak +% Main content +% \section{Numbered Section1} +% Section 1 Text +% \subsection{Numbered Subsection1} +% Numbered-Section 1’s Subsection Text. +% \section{Numbered Section2} +% Numbered-Section 2 Text +% \section*{Un-numbered Section3} +% \addcontentsline{toc}{section}{Numbered Subsection1} +% First un-numbered Section Text.\\This appears in the table of content +% \section*{Un-numbered Section4} +% Second un-numbered Section Text +% \appendix +% \section{Appendix - 1} +% \end{document} +% \end{verbatim} + \end{center} + } +\end{frame} + + + + + + +\begin{frame}[fragile] + \frametitle{\typ{Summary}} + \label{sec-8} + In this tutorial, we have, + \begin{itemize} + \item Gained an understanding of the basic structure of a LaTeX document, its various document classes and loading packages that add new features to + \item the LaTeX system. + \item Created a LaTeX document with a title and an abstract. + \item Created both numbered and non-numbered sections and subsections in a LaTeX document. + \item Created an appendix in a LaTeX document. + \item Created a table of content in a LaTeX document. + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{\typ{Evaluation}} + \label{sec-9} + {\small + \begin{enumerate} + \item Is the LaTeX code given below a valid input file (File compiles successfully and produces the intended result, that is to produce a book with two chapters and an appendix. + {\tiny + \begin{center} + \begin{verbatim} + \documentclass{book} + \title{My first Book} + \author{Harish} + \date{31-February-2012} + \begin{document} + \maketitle + \chapter{My First Chapter} + Main + \chapter{So We say goodbye} + Thank you for reading dear reader + \appendix + \section{First Appendix} + \end{document} + \end{verbatim} + \end{center} + } + \item subsection command can be placed at any arbitrary level. If they get numbered by default using the appropriate setcounter command and secnumdepth parameter, do they automatically appear in the table of content ?? + \end{enumerate} + } +\end{frame} + +\begin{frame}[fragile] +\frametitle{\typ{Solutions}} +\label{sec-10} +\begin{enumerate} +\item Although the given file looks syntactically valid, the output file is not what we expected. This is mainly because we are trying to use the section command to create sections in the appendix, for a document whose type is given as a book. +\vspace{15pt} +\item No, the \textbackslash tableofcontents command normally shows only numbered section headings, and only down to the level defined by the tocdepth counter. +\end{enumerate} +\end{frame} + +\begin{frame} + \begin{block}{} + \begin{center} + \textcolor{blue}{\Large THANK YOU!} + \end{center} + \end{block} + \begin{block}{} + \begin{center} + For more Information, visit our website\\ + \url{http://fossee.in/} + \end{center} + \end{block} +\end{frame} + +\end{document} + + |