diff options
author | Harish Badrinath | 2012-01-25 14:15:43 +0530 |
---|---|---|
committer | Harish Badrinath | 2012-01-25 14:15:43 +0530 |
commit | 113cc2c498d7d57e0487e4e11cdd61d6476e3472 (patch) | |
tree | b13b432abe7b234199c10108e2263dffbd0550fe /Latex/Latex3 | |
parent | 65f465db264ce040e534f8db6307bb224c9c8a4b (diff) | |
download | sdes-stscripts-113cc2c498d7d57e0487e4e11cdd61d6476e3472.tar.gz sdes-stscripts-113cc2c498d7d57e0487e4e11cdd61d6476e3472.tar.bz2 sdes-stscripts-113cc2c498d7d57e0487e4e11cdd61d6476e3472.zip |
Syncing LaTeX 3 scripts and slides with content in handout.
This is a an exercise in doing the best possible, as of today.
Diffstat (limited to 'Latex/Latex3')
-rw-r--r-- | Latex/Latex3/latex_basics.tex | 151 | ||||
-rw-r--r-- | Latex/Latex3/latex_basics_and_structure_script.rst | 51 |
2 files changed, 109 insertions, 93 deletions
diff --git a/Latex/Latex3/latex_basics.tex b/Latex/Latex3/latex_basics.tex index 04e7968..27142bf 100644 --- a/Latex/Latex3/latex_basics.tex +++ b/Latex/Latex3/latex_basics.tex @@ -1,5 +1,4 @@ \documentclass{beamer} -\usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{graphicx} @@ -45,8 +44,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % DOCUMENT STARTS \begin{document} - - \begin{frame} \begin{center} \vspace{12pt} @@ -79,12 +76,14 @@ \begin{frame}[fragile] \frametitle{A Very Basic {\LaTeX} document} - \begin{verbatim} - \documentclass{article} - \begin{document} - SAMPLE TEXT - \end{document} - \end{verbatim} + {\tiny + \begin{verbatim} + \documentclass{article} + \begin{document} + SciPy is open-source software for mathematics, science, and engineering. + \end{document} + \end{verbatim} + } \end{frame} \begin{frame}[fragile] @@ -140,30 +139,36 @@ \item Add title, author and date. \item Compile. \item Nothing changes. + \item use \lstinline$\date{}$, to insert todays date. \end{itemize} - \begin{verbatim} - \documentclass{article} - \title{My First LaTeX Document} - \author{Harish} - \begin{document} - Hello world! - \end{document} - \end{verbatim} + {\tiny + \begin{verbatim} + \documentclass{article} + \title{A Glimpse at Scipy} + \author{FOSSEE} + \date{June 2010} + \begin{document} + SciPy is open-source software for mathematics, science, and engineering. + \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} + {\tiny + \begin{verbatim} + \documentclass{article} + \title{A Glimpse at Scipy} + \author{FOSSEE} + \date{June 2010} + \begin{document} + \maketitle + SciPy is open-source software for mathematics, science, and engineering. + \end{document} + \end{verbatim} + } \end{frame} \begin{frame}[fragile] @@ -172,20 +177,20 @@ \item \typ{abstract} environment inserts abstract. \item Place it at the location where you want your abstract. \end{itemize} - {\small - \begin{verbatim} - \begin{document} + {\tiny + \begin{verbatim} \documentclass{article} - \title{My First LaTeX Document} - \author{Harish} + \title{A Glimpse at Scipy} + \author{FOSSEE} + \date{June 2010} \begin{document} \maketitle - Hello world! - \begin{abstract} - An Example Abstract - \end{abstract} - \end{document} - \end{verbatim} + \begin{abstract} + This document shows a glimpse of the features of Scipy that will be explored during this course. + \end{abstract} + SciPy is open-source software for mathematics, science, and engineering. + \end{document} + \end{verbatim} } \end{frame} @@ -200,7 +205,7 @@ {\tiny \begin{verbatim} \documentclass{article} - \author{Harish} + \author{FOSSEE} \date{31-February-2012} \begin{document} \maketitle @@ -224,11 +229,12 @@ \item Longer documents, use \lstinline{report} or \lstinline{book} class \item Chapter can be added using \lstinline{\chapter} command + \item Books \alert{do not} have the abstract environment. \end{itemize} {\tiny \begin{verbatim} \documentclass{book} - \title{My first Book} + \title{My first book} \begin{document} \chapter{My First Chapter} Main @@ -293,44 +299,39 @@ beginning of the document and the appendix at the end. \end{frame} \begin{frame}[fragile] -\frametitle{\typ{Excercise 1: Solution}} - \begin{center} - Note: File needs to be compiled twice - TODO: Please uncomment actual example and recompile - \end{center} + \frametitle{\typ{Excercise 1: Solution}} + \begin{center} + Note - This 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} + \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} @@ -355,8 +356,8 @@ beginning of the document and the appendix at the end. \begin{center} \begin{verbatim} \documentclass{book} - \title{My first Book} - \author{Harish} + \title{My book} + \author{FOSSEE} \date{31-February-2012} \begin{document} \maketitle diff --git a/Latex/Latex3/latex_basics_and_structure_script.rst b/Latex/Latex3/latex_basics_and_structure_script.rst index 968a4ee..09e8d2a 100644 --- a/Latex/Latex3/latex_basics_and_structure_script.rst +++ b/Latex/Latex3/latex_basics_and_structure_script.rst @@ -66,7 +66,8 @@ LaTeX and suggest you to complete the tutorial titled "Introduction to LaTeX". .. R4 -the text "SAMPLE TEXT" is illustrative and can be replaced replaced by a +We begin this tutorial with an example introduced in the previous tutorial. +The text in the document is illustrative and can be replaced replaced by a single alpha-numeric character, for example. When done so, the resulting document could be described as the shortest possible LaTeX input document, that creates an output file. It consists of 3 LaTeX commands and one line/character @@ -76,11 +77,11 @@ In our minimal example, document is an environment. Only the text enclosed by the begin and end commands is effected by the environment. The part of the file before the \begin{document} command is called the preamble, and is used to "configure" the LaTeX typesetter and change various parameters for typesetting. - +In our current example, the preamble is empty. We will add preamble content +in the later part of the tutorial. This is processed by a TeX processor that generates an output file. Now, we begin to look into each line in the example in more detail. - The first line reads .. L5 @@ -95,17 +96,21 @@ which more generally can be written as .. R6 -Where \documentclass is a LaTeX command. +Where documentclass is a LaTeX command. Parameters specify if you want to use a non default font size, for example. More specifically the parameters can be used to alter things like font size of -the document, paper size, two sided or single sided printing, etc. +the document, paper size, two sided or single sided printing, etc, for each +class, that is supported by LaTeX. + +The supported classes have a few differences, in how the content of the document is typeset. .. L7 .. R7 -This command instructs LaTeX to +We now look at a hypothetical documentclass command. +The command being shown on the screen, instructs LaTeX to Create a new document of class report. The available classes are article, proc, report, book, slides, letter. 12 pt: sets the font size of main font. Other are relatively adjusted. 10pt is @@ -130,13 +135,9 @@ command for accessing package documentation. .. R9 -We add the LaTeX commands, that specify the title and the author of the -document. When we compile the document shown to an output file and view it we -notice that output is, as seen no different from not adding the fields of title -and author. We need to add another command to actually show the title author -and date in the output document. The part of the file before the -\begin{document} command is called the preamble, and is used to "configure" the -LaTeX typesetter and change various parameters for typesetting. +We add the title, the author and the date to the document before the +\begin{document} directive. We compile the document to see if the details +appear in the document, but they donot. .. L10 @@ -170,6 +171,7 @@ behavior is to use numbered sections. We can use un-numbered sections appending * to section command. If you want to split your document without influencing the section or chapter numbering use the part command. + .. L13 .. R13 @@ -182,6 +184,7 @@ file shown in the slide we notice that subsections are not numbered. .. R14 + We can change this behavior with the command setcounter , calling it as shown in the slide. @@ -203,10 +206,22 @@ that sections are to be numbered as appendices. .. R16 Lets add a Table of content to the document. The LaTeX command to add a TOC to a -document is using \tableofcontents command. It is used at the point at which the -table of content is to be placed. You then have to compile the input file twice -to produce a text. -Any numbered section/chapter appear automatically in the table of content. +document is using \tableofcontents command and is placed at the point at which +the table of content is to be placed. + +Now, compile the document and look at the output document. It does not have the table of contents! + +We compile our LaTeX file as usual. On the first compilation only the "Contents" +heading appears in the document, but the actual table does not appear. You will +need to compile your document once more, for the actual table to appear in your +document. On the first run, LaTeX has gone through your document and generated +a temporary file (.toc), with the entries that should go into the table of +contents. These entries are made, when you compile your document for the second +time. + +Note that any section/block that has been numbered automatically appears in the +table of contents. It is possible to get un-numbered sections, for instance a +Preface or a Foreword section to appear in the Table of Contents. .. L17 @@ -216,7 +231,7 @@ Any numbered section/chapter appear automatically in the table of content. Un-numbered sections are added to TOC using \addcontentsline command. For example we use the command \addcontentsline{toc}{section}{Intro} -where intro is the text that you want to appear in the Table of contents. +where "Intro" is the text that you want to appear in the Table of contents. .. L18 |