diff options
author | Harish Badrinath | 2012-01-24 15:50:13 +0530 |
---|---|---|
committer | Harish Badrinath | 2012-01-24 15:50:13 +0530 |
commit | a5156445125ead612522ad3eddb739c4ed1dfa5a (patch) | |
tree | 556005859ba1a16dab205b1d7c8a00da989d1f25 /Latex/Latex2 | |
parent | 32734b8a299ba0c5b30d1738a98d302a29a99942 (diff) | |
download | sdes-stscripts-a5156445125ead612522ad3eddb739c4ed1dfa5a.tar.gz sdes-stscripts-a5156445125ead612522ad3eddb739c4ed1dfa5a.tar.bz2 sdes-stscripts-a5156445125ead612522ad3eddb739c4ed1dfa5a.zip |
Added iitb-logo.png so that we can compile LaTeX slides sucessfully.
Syncing handout content with scripts and slides for LaTex2.
Diffstat (limited to 'Latex/Latex2')
-rw-r--r-- | Latex/Latex2/latex_intro.tex | 129 | ||||
-rw-r--r-- | Latex/Latex2/latex_intro_script.rst | 118 |
2 files changed, 146 insertions, 101 deletions
diff --git a/Latex/Latex2/latex_intro.tex b/Latex/Latex2/latex_intro.tex index 722281e..2bb0314 100644 --- a/Latex/Latex2/latex_intro.tex +++ b/Latex/Latex2/latex_intro.tex @@ -119,60 +119,67 @@ At the end of this tutorial, you will be able to, \begin{frame}[fragile] \frametitle{Advantages of using \LaTeX } \begin{itemize} - \item Easy availablity of professional templates. - \item Typesetting complex formulae in a convenient environment. - \item Can start typesetting with very little effort. - \item Presence of a lot of add-on packages. - \item Encourages creation of well structured texts. + \item Easy availablity of professional templates. + \item Typesetting complex formulae in a convenient environment. + \item Can start typesetting with very little effort. + \item Presence of a lot of add-on packages. + \item Encourages creation of well structured texts. \end{itemize} \end{frame} \begin{frame}[fragile] \frametitle{Disadvantages of using \LaTeX } \begin{itemize} - \item Designing whole new layout is difficult. + \item Designing whole new layout is difficult. + \item LaTeX is not a word processor. \end{itemize} \end{frame} \begin{frame}[fragile] \frametitle{\LaTeX \ input file format} \begin{itemize} - \item \LaTeX takes ASCII text file as input. - \item We can compile \LaTeX files into DVI,Postscript or PDF files. - \item \alert{Note:} \typ{latex} vs. \typ{pdflatex} + \item \LaTeX takes ASCII text file as input. + \item We can compile \LaTeX files into DVI,Postscript or PDF files. + \item \alert{Note:} \typ{latex} vs. \typ{pdflatex} \end{itemize} \end{frame} - - \begin{frame}[fragile] - \frametitle{Commands, Comments and Special Characters } + \frametitle{Commands,Comments\&Special Characters } \begin{itemize} - \item {\LaTeX} is case sensetive. - \item Commands begin with a \typ{\\} - \item Environments have a \typ{\\begin} and \typ{\\end} - \item Any content after the \typ{\\end\{document\}} is ignored + \item {\LaTeX} is case sensetive. + \item Commands begin with a \typ{\\} + \item Environments have a \typ{\\begin} and \typ{\\end} + \item Any content after the \typ{\\end\{document\}} is ignored \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Commands,Comments\&Special Characters \ldots} \begin{itemize} - \item Anything that follows a \typ{\%} symbol till end of the line - is a comment - \item Special characters (\typ{\~ \# \$ \^ \& \_ \{ \}}) are escaped by a - \typ{\\} - \item \typ{\\} symbol is inserted using \typ{\\textbackslash} - command + \item Anything that follows a \typ{\%} symbol till end of the line + is a comment + \item Special characters (\typ{\~ \# \$ \^ \& \_ \{ \}}) are escaped by a + \typ{\\} + \item \typ{\\} symbol is inserted using \typ{\\textbackslash} + command + %\item \textbackslash newline or \textbackslash \textbackslash\ is used to insert newlines. + \item \typ{\\newline} or \typ{\\\\} is used to insert newlines. \end{itemize} \end{frame} \begin{frame}[fragile] \frametitle{Typesetting a minimal document} Write the sample code into the file \typ{temp.tex} - \begin{verbatim} - \documentclass{article} - \title{My First LaTeX Document} - \begin{document} - Hello world! - \end{document} - \end{verbatim} + \vspace{8pt} + {\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] @@ -185,7 +192,10 @@ At the end of this tutorial, you will be able to, \begin{frame}[fragile] \frametitle{Compiling to PDF } \begin{center} - \alert{pdflatex temp.tex} + \alert{pdflatex temp.tex} + \end{center} + \begin{center} + \em Note: Throughout this course, we shall use pdflatex to compile our documents. \end{center} \end{frame} @@ -195,57 +205,60 @@ At the end of this tutorial, you will be able to, In this tutorial, we have learnt, \begin{itemize} -\item About LaTeX. -\item why we prefer LaTeX. -\item about the advantages and disadvantages of typesetting documents using the LaTeX approach. -\item A description, of a typical work flow; which uses LaTeX to typeset documents. -\item The ability to recognize and differentiate between LaTeX commands, LaTeXcomments and special characters, spacing and actual document content. -\item Created and compiled a very simple LaTeX document. + \item About LaTeX. + \item why we prefer LaTeX. + \item about the advantages and disadvantages of typesetting documents using the LaTeX approach. + \item A description, of a typical work flow; which uses LaTeX to typeset documents. + \item The ability to recognize and differentiate between LaTeX commands, LaTeXcomments and special characters, spacing and actual document content. + \item Created and compiled a very simple LaTeX document. \end{itemize} \end{frame} + + \begin{frame}[fragile] \frametitle{Evaluation} \label{sec-9} - - \begin{enumerate} -\item Convert the temp.dvi created during the course of this tutorial to temp\_1.ps using the dvips command. Verify that the two files indeed look the same. -\vspace{8pt} -\item Convert the temp.dvi created during the course of this tutorial to temp\_1.pdf using the dvipdfm command. Verify that the two files indeed look the + \item Convert the temp.dvi created during the course of this tutorial to temp\_1.ps using the dvips command. Verify that the two files indeed look the same. + \vspace{8pt} + \item Convert the temp.dvi created during the course of this tutorial to temp\_1.pdf using the dvipdfm command. Verify that the two files indeed look the same. \end{enumerate} \end{frame} -\begin{frame} - +\begin{frame} \frametitle{Solutions} \label{sec-10} \begin{enumerate} -\item We can use the following command to convert temp.dvi to temp\_1.ps\\ -\begin{center} -dvips -o temp\_1.ps temp.dvi -\end{center} -\vspace{15pt} -\item We can use the following command to convert temp.dvi to temp\_1.pdf\\ -\begin{center} -dvipdfm \-o temp\_1.pdf temp.dvi -\end{center} + \item We can use the following command to convert temp.dvi to temp\_1.ps\\ + \begin{block}{} + \begin{center} + dvips -o temp\_1.ps temp.dvi + \end{center} + \end{block} + \vspace{15pt} + \item We can use the following command to convert temp.dvi to temp\_1.pdf\\ + \begin{block}{} + \begin{center} + dvipdfm -o temp\_1.pdf temp.dvi + \end{center} + \end{block} \end{enumerate} \end{frame} -\begin{frame} + +\begin{frame} \begin{block}{} \begin{center} - \textcolor{blue}{\Large THANK YOU!} + \textcolor{blue}{\Large THANK YOU!} \end{center} \end{block} \begin{block}{} \begin{center} - For more Information, visit our website\\ - \url{http://fossee.in/} + For more Information, visit our website\\ + \url{http://fossee.in/} \end{center} \end{block} \end{frame} -\end{document} - +\end{document} diff --git a/Latex/Latex2/latex_intro_script.rst b/Latex/Latex2/latex_intro_script.rst index 398907d..115f26b 100644 --- a/Latex/Latex2/latex_intro_script.rst +++ b/Latex/Latex2/latex_intro_script.rst @@ -75,15 +75,16 @@ LaTeX began as TeX, a computer program originally created by Donald E. Knuth. Its was designed mainly to aid typesetting of text and mathematical formulae. -LaTeX is a document preparation system for high quality type -setting. It is based on the TeX typesetting language or certain -extensions. +LaTeX is a typesetting program that produces excellently typeset documents. +Typesetting is placing text onto a page with all the style formatting defined, +so that content looks as intended. It is extensively used for producing high +quality scientific and mathematical documents. It may also be used for +producing other kinds of documents, ranging from simple one page articles to +complete books. LaTeX is pronounced Lah-tech or Lay-tec. TeX is pronounced Tech. TeX is also the first syllable in the Greek word for technology. -LaTeX allows authors to typeset and print their content at the highest -typographical quality, using predefined, professional layouts. .. L5 @@ -128,6 +129,8 @@ of the document. Some of the disadvantages of using LaTeX approach to typesetting is (1) Designing a whole new layout is difficult. +(2) LaTeX is not a word processor, that is the document author is not expected +to worry about presentation details like the size of font, for example. .. L8 @@ -154,66 +157,95 @@ The resultant PDF files can be viewed using standard tools on most platforms .. R9 -LaTeX, like most utilities in Linux is case sensitive. Commands begin with a -backslash.LaTeX environments have a begin and end marker. Any content after -\end{document} is ignored. +LaTeX, like most utilities in Linux, LaTeX is case sensitive. Commands begin +with a backslash.LaTeX environments have a begin and end marker. The begin and +end document commands, mark the beginning and the end of the content of the +LaTeX document. The text in between the begin and end commands is typeset in +the output document.Any content after \end{document} is ignored. The type of +document that is being currently typeset in LaTex, is identified with the +documentclass command. LaTeX then, typesets the document accordingly. -Anything that follows a percentage sign (%) till the end of that line is a -comment. Special characters like tilde or hash,etc have to be escaped by a -backslash. If you have to insert a backslash into a LaTeX output file, you have -to use the LaTeX command \textbackslash. +All the commands in LaTeX begin with a \. An environment begins with a begin +command and ends with an end command. -Normally LaTeX automatically spaces the given input optimally. But, sometimes we -have to insert manual line breaks. This is achieved using the \\ command. +So, as expected LaTeX ignores anything that is written after the \end{document} +command. Essentially, anything written after the \end{document} command turns +out to be a comment. But, how do we write comments with in the document. % is +the character to indicate comments. Anything written after a % symbol in a +line, is ignored. -We can also start a new paragraph using an empty line. +.. L10 -It must be noted that multiple spaces/empty lines are automatically compressed -to a single space/line. -.. L10 +.. R10 + +But what if we wanted to insert the % symbol in the document? We can do so by +escaping it with a \ (backslash). % is one of the many special characters in +LaTeX. The others are, ~ # $ ^ & _ { } \. All of them, except the \ itself, can +be inserted by escaping it with a \. To insert a \ in our document, we use the +command \textbackslash. + +What would happen if we escape a \ with a \? +A double backslash is actually another command. It inserts a new line in the +typeset document. Normally LaTeX automatically spaces the given input optimally. +But, sometimes we have to insert manual line breaks. The \\ command or \newline +command is used to insert a newline in the output document. Line breaks in the +input document, do not translate into line breaks in the output document. A +single line break in the input document, doesn't cause any change in the output. + +A single empty line causes a change in paragraphs in the output. (Multiple +empty lines are equivalent to a single empty line.) Similarly, multiple spaces +are treated as a single space. + +.. L11 {{{ Show slide with exercise 1 }}} -.. R10 +.. R11 Now, we try to create a simple LaTeX document. Pause the tutorial and type the content shown on the screen in a text editor. Save the file as temp.tex -.. L10 +.. L12 {{{continue from paused state}}} -.. R10 +.. R12 Now we compile the commands in the LaTeX input file that is, temp.tex into a -typeset file. -The first alternative is to compile LaTeX input file into a DVI file. We use -the latex command for this purpose. -For compiling the LaTeX input file temp.tex into a DVI file, we use the -following command +typeset file. + +The first alternative is to compile LaTeX input file into a DVI +file. We use the latex command for this purpose. For compiling the LaTeX input +file temp.tex into a DVI file, we use the following command + latex temp.tex. -The output file would be temp.dvi. -On Gnu/Linux use a program like xdvi to view the output file. -.. L11 +The output file would be temp.dvi.On Gnu/Linux use a program like xdvi to view +the output file. + +.. L13 -.. R11 +.. R13 The other alternative is to create PDF files from LaTeX input files. -We use the pdflatex command for this purpose. -For compiling the LaTeX input file temp.tex into a PDF file, we use the -following command +We use the pdflatex command for this purpose. For compiling the LaTeX input +file temp.tex into a PDF file, we use the following command + pdflatex temp.tex -The output file would be temp.pdf -On Gnu/Linux use a program like evince to view the output file. -.. L12 +The output file would be temp.pdf.On Gnu/Linux use a program like evince to +view the output file. + +Please note that, throughout this course we shall be using pdflatex to compile +our documents. + +.. L14 {{{ Show summary slide }}} -.. R12 +.. R14 This brings us to the end of this tutorial. In this tutorial, we have learnt @@ -227,11 +259,11 @@ This brings us to the end of this tutorial. In this tutorial, we have learnt .. comments and special characters, spacing and actual document content. .. #. Created and compiled a very simple LaTeX document. -.. L13 +.. L15 {{{Show self assessment questions slide}}} -.. R13 +.. R15 Here are some self assessment questions for you to solve @@ -242,11 +274,11 @@ using the dvips command. Verify that the two files indeed look the same. temp_1.pdf using the dvipdfm command. Verify that the two files indeed look the same. -.. L14 +.. L16 {{{Show self assessment questions slide}}} -.. R14 +.. R16 And the answers, @@ -256,11 +288,11 @@ dvips -o temp_1.ps temp.dvi 2. We can use the following command to convert temp.dvi to temp_1.pdf dvipdfm -o temp_1.pdf temp.dvi -.. L15 +.. L17 {{{ Show the thank you slide }}} -.. R15 +.. R17 Hope you have enjoyed this tutorial and found it useful. Thank you! |