diff options
Diffstat (limited to 'Latex/Latex5')
-rw-r--r-- | Latex/Latex5/FTF_Latex.rst | 253 | ||||
-rw-r--r-- | Latex/Latex5/Latex_FTF.tex | 269 |
2 files changed, 372 insertions, 150 deletions
diff --git a/Latex/Latex5/FTF_Latex.rst b/Latex/Latex5/FTF_Latex.rst index b213709..732842d 100644 --- a/Latex/Latex5/FTF_Latex.rst +++ b/Latex/Latex5/FTF_Latex.rst @@ -1,23 +1,14 @@ - -.. Prerequisites -.. ------------- - -.. None - -.. Author : Primal Pappachan - Internal Reviewer : Kiran Isukapatla, Sushma Dubey - Date: Jan 15, 2012 -------- Script -------- .. L1 -{{{ Show the first slide containing title, name of the production team along with the logo of MHRD}}} +{{{ Show the title slide}}} .. R1 -Hello friends and welcome to the second tutorial on Latex. +Hello friends and welcome to the tutorial on Latex: Tables & Figures. .. L2 @@ -25,71 +16,105 @@ Hello friends and welcome to the second tutorial on Latex. .. R2 -1. Learn how to add figures to your document +In this tutorial we will learn how to: -#. Include tabular environments +1. Add figures in Latex document. + +#. Include tabular environments in Latex document. .. L3 -{{{Show the slide 'Prerequisite'}}} +{{{Show the slide 'Prerequisites'}}} .. R3 -Please make sure that you have gone through the following tutorials before you continue on this tutorial +Please make sure that you have gone through the following tutorials before you +continue on this tutorial: + +1. Latex Installation +#. Latex Introduction +#. Latex Basics & Structuring +#. Latex Typesetting Text .. L4 {{{Show the slide 'Figures'}}} .. R4 - -To include graphics in a LaTeX document, we need to use the graphicx package. Add the \usepackage{graphicx} directive to the preamble of the document. - -To add the graphic, use the includegraphics command. The relative path of the image that we wish to include is passed as an argument to includegraphics. It takes an optional argument of scaling the image. - -.. L5 - -{{{Show rev17 of hg}}} - -.. R5 - -We use a scale of 0.4 to scale our image. +Let us start with seeing how to include 'figures' in a Latex document. +To include graphics in a LaTeX document, we need to use the <graphicx> package. +To use this package, we have to add the <\\usepackage{graphicx}> directive +to the preamble of the document. + +Then, to add a graphic, use the <\\includegraphics> command. +The relative path of the image that we wish to include is passed as an +argument to includegraphics. You can see two images in each slide of this +presentation, these images are included using <\\includegraphics> command. +It takes an optional argument, to scale an image. For our images a scale +of 0.80 is used. -.. L6 +.. L5 {{{Show slide 'includegraphics'}}} -.. R6 +.. R5 -It takes other optional arguments. +<\\includegraphics> command also takes other optional arguments such as: -1. width=x, height=x +1. <width=x, height=x> -If only the height or width is specified, the image is scaled, maintaining the aspect ratio. +If only the height or width is specified, the image is scaled, +maintaining the aspect ratio. -#. keepaspectratio +#. <keepaspectratio> -This parameter can either be set to true or false. When set to true, the image is scaled according to both width and height, without changing the aspect ratio, so that it does not exceed both the width and the height dimensions. +This parameter can either be set to true or false. +When set to true, the image is scaled according to both width and height, +without changing the aspect ratio, so that it does not exceed both the +width and the height dimensions. -#. angle=x +#. <angle=x> This option can be used to rotate the image by x degrees, counter-clockwise. + +.. L6 + +{{{Show slide 'includegraphics..'}}} + +.. R6 + +Here is the complete syntax for <\\includegraphics> command with +the optional arguments we just talked about and the relative path +to the image. + .. L7 {{{Show the slide 'Floats'}}} .. R7 -Figures (and tables) are treated specially because, they cannot be broken across pages. They are "floated" across to the next page, if they donot fit on the current page, filling the current page with text. To make our graphic into a float, we should enlose it within a figure environment. The figure environment takes an additional parameter for the location of the float. +Graphics (and tables) are treated specially because, +they cannot be split into pages. +They are "floated" across to the next page, +if they do not fit on the current page, filling the current page with text. +To make our graphic into a float, we should enlose it within +a figure environment. The figure environment takes an additional parameter +for the location of the float. .. L8 -\begin{figure}[hbtp!] +{{{Show the slide 'Floats..'}}} .. R8 -The specifiers htbp are permissions to place the float at various locations. t for top of page, b for bottom of page, p for a separate page for floats and h for here, as in the same place where the command appears in the source. ! mark overrides a few of LaTeX's internal parameters for good position of floats. +The specifiers 't','b','p','h' & '!' are permissions to place the float at +various locations. +'t' for top of page, 'b' for bottom of page, 'p' for a separate page for +floats and 'h' for here, as in pproximately at the same point it occurs in +the source text. '!' mark overrides few of LaTeX's internal parameters +for good position of floats. + .. L9 @@ -97,37 +122,51 @@ The specifiers htbp are permissions to place the float at various locations. t f .. R9 -The figure environment also, allows us to add a caption to the graphic using the \caption command. +The figure environment also, allows us to add a caption to the graphic +using the <\\caption> command. This command will be placed within the figure +environment. +To keep the graphic center aligned in the page, +we use the center environment within the figure environment. +To label a figure, we just add a <\\label> command within the +figure environment. +Note that the label to a figure should be added after the caption command. +Figures are auto numbered. -To place the graphic in the center aligned in the page, we use the center environment. +.. L10 -To label a figure, we just add a label with in the figure environment. Note, that the label to a figure should be added after the caption command. +{{{Show the slide Captions and References..}}} -.. L9 - -{{{Show rev17 of hg}}} +.. R10 -.. R9 +Here, you can see a sample code that shows the use of figure environment +with caption & label. +It explains how to include image, how to center align it. +Also shows, how to add caption and label to an image. +You can note that the label is added after the caption, as we mentioned +earlier. -Figures are auto numbered -.. L10 +.. L11 {{{Show the slide 'Tables'}}} -.. R10 - -Now, let us look at the other kind of floats - Tables. We shall convert the list of sub-packages in the sub-packages section to a table. +.. R11 -To begin a table, we use the tabular environment. And to make this a float, it is enclosed in the table environment. The table environment also allows us to add captions to the table and Tables are also auto numbered. +Now, let us look at how to include Tables in our document. +To typeset content in a tabular format, we use the tabular environment. +And to make it a float, it is enclosed in the table environment. +The table environment also allows us to add captions & labels to the table, +just as we added in the figure environment. +Tables are also auto numbered. -.. L11 +.. L12 {{{Show the slide 'tabular'}}} -.. R11 +.. R12 -The tabular environment takes as arguments the columns and the formatting of each column. The possible arguments to the tabular environment are +The tabular environment takes the columns, and the formatting of each column, +as arguments. The possible arguments to the tabular environment are 1. l for left justified column content @@ -135,31 +174,47 @@ The tabular environment takes as arguments the columns and the formatting of eac #. c for centered column content -#. | for produces a vertical line. +#. | (pipe) produces a vertical line. -It also takes an optional parameter that specifies the position of the table; t for top, b for bottom, or c for center. -.. L12 +.. L13 -{{{Show rev18 of hg}}} +{{{Show the slide 'tabular..'}}} -.. R12 +.. R13 -Each column of a table is separated by an & symbol and each row is separated by a new line. The \hline command allows you to draw horizontal lines between two rows of the table. +Tabular also takes an optional parameter that specifies the position +of the table; 't' for top, 'b' for bottom, or 'c' for center. +Each column of a table is separated by an '&' (ampersand) symbol and +each row is separated by a new line. + +The <\\hline> command allows you to draw horizontal lines between +two rows of the table. -.. L13 +.. L14 + +{{{Show the slide 'tabular..'}}} + +.. R14 + +A sample code that shows the complete use of the tabular +environment with all arguments and options. + + +.. L15 {{{Show the slide 'List of Tables, Figures'}}} -.. R13 +.. R15 -You could also add a listoftables or listoffigures to the document, similar to the way we added table of contents. +You could also add a list of tables or list of figures to the document, +using <\\listoftables> & <\\listoffigures> commands respectively. -.. L14 +.. L16 {{{Show the 'summary' slide'}}} -.. R20 +.. R16 This brings us to the end of the tutorial. In this tutorial, we have learnt to, @@ -169,37 +224,85 @@ learnt to, #. Include tabular environments in a LateX document -.. L21 +.. L17 {{{Show self assessment questions slide}}} -.. R21 +.. R17 -Here are some self assessment questions for you to solve +Here are some self assessment questions for you to solve, -.. L22 +1. Which input parameter is used in the figure environment to make it float + to the bottom of the page ? +#. What is the mandatory argument in tabular environment specification ? + +.. L18 {{{Show the solutions slide to self assessment questions }}} -.. R22 +.. R18 And the answers, +1. Input parameter `b' is passed as argument, to make it float to the bottom + of the page. +#. It is mandatory to specify alignment of each column in tabular + environment. -.. L23 -{{{Show the thank you slide}}} +.. L19 -.. R23 +{{{ Show the SDES & FOSSEE slide }}} -Hope you have enjoyed this tutorial and found it useful. -Thank you +.. R19 +Software Development techniques for Engineers and Scientists - SDES, is an +initiative by FOSSEE. For more information, please visit the given link. +Free and Open-source Software for Science and Engineering Education - FOSSEE, +is based at IIT Bombay which is funded by MHRD as part of National Mission on +Education through ICT. +.. L20 +{{{ Show the About the Spoken Tutorial Project slide }}} +.. R20 +Watch the video available at the following link. It summarises the Spoken +Tutorial project.If you do not have good bandwidth, you can download and +watch it. + +.. L21 + +{{{ Show the Spoken Tutorial Workshops slide }}} + +.. R21 + +The Spoken Tutorial Project Team conducts workshops using spoken tutorials, +gives certificates to those who pass an online test. + +For more details, contact contact@spoken-tutorial.org + +.. L22 + +{{{ Show the Acknowledgements slide }}} + +.. R22 + +Spoken Tutorial Project is a part of the "Talk to a Teacher" project. +It is supported by the National Mission on Education through ICT, MHRD, +Government of India. More information on this mission is available at the +given link. + +.. L23 + +{{{ Show the Thankyou slide }}} + +.. R23 + +Hope you have enjoyed this tutorial and found it useful. +Thank you! diff --git a/Latex/Latex5/Latex_FTF.tex b/Latex/Latex5/Latex_FTF.tex index c7c50ae..e992ac5 100644 --- a/Latex/Latex5/Latex_FTF.tex +++ b/Latex/Latex5/Latex_FTF.tex @@ -4,8 +4,8 @@ % Author: FOSSEE % Copyright (c) 2009, FOSSEE, IIT Bombay %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\documentclass{beamer} +\documentclass[17pt,compress]{beamer} +\usepackage{beamerthemesplit} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} @@ -24,6 +24,7 @@ \usepackage[english]{babel} \usepackage{ae,aecompl} \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} \usepackage{listings} + \lstset{ language=TeX, basicstyle=\ttfamily\bfseries, @@ -34,58 +35,94 @@ postbreak = \space\dots } -\newcommand{\typ}[1]{\lstinline{#1}} - \mode<presentation> { \usetheme{Warsaw} \useoutertheme{infolines} \setbeamercovered{transparent} + \setbeamertemplate{navigation symbols}{} } +% Taken from Fernando's slides. +\usepackage{ae,aecompl} +\usepackage[scaled=.95]{helvet} +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} + +% change the alerted colour to LimeGreen +\definecolor{LimeGreen}{RGB}{50,205,50} +\setbeamercolor{structure}{fg=LimeGreen} +\author[FOSSEE]{} +\institute[IIT Bombay]{} +\date[]{} +% \setbeamercovered{transparent} -\setbeamercolor{emphbar}{bg=blue!20, fg=black} -\newcommand{\emphbar}[1] +% theme split +\usepackage{verbatim} +\newenvironment{colorverbatim}[1][]% +{% +\color{blue} +\verbatim +}% +{% +\endverbatim +}% + +\usepackage{mathpazo,courier,euler} +\usepackage{listings} +\lstset{language=sh, + basicstyle=\ttfamily\bfseries, + showstringspaces=false, + keywordstyle=\color{black}\bfseries} + +% logo +\logo{\includegraphics[height=1.30 cm]{../images/3t-logo.pdf}} +\logo{\includegraphics[height=1.30 cm]{../images/fossee-logo.pdf} + +\hspace{7.5cm} +\includegraphics[scale=0.99]{../images/fossee-logo.pdf}\\ +\hspace{281pt} +\includegraphics[scale=0.80]{../images/3t-logo.pdf}} +\newcommand{\typ}[1]{\lstinline{#1}} \begin{document} -\begin{frame} +\sffamily \bfseries +\title +[{\LaTeX}: Tables \& Figures] +{{\LaTeX}: Tables \& Figures} +\author +[FOSSEE] +{\small Talk to a Teacher\\{\color{blue}\url{http://spoken-tutorial.org}} +\\\vspace{0.25cm}National Mission on Education + through ICT\\{\color{blue}\url{ http://sakshat.ac.in}} \\ [1.65cm] + Contributed by FOSSEE Team \\IIT Bombay \\[0.3cm] +} -\begin{center} -\vspace{12pt} -\textcolor{blue}{\huge {\LaTeX}:Tables, Figures and Floats} -\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.15]{../images/iitb-logo.jpg}\\ -\end{center} +\begin{frame} + \titlepage \end{frame} \begin{frame} \frametitle{Objectives} - At the end of this session, you will be able to: + In this tutorial we will learn how to: \begin{itemize} - \item Learn how to add figures to your document - \item Include tabular environments + \item Add graphics in Latex document + \item Include tabular environments in Latex document \end{itemize} \end{frame} \begin{frame} - \frametitle{Prerequisite} + \frametitle{Prerequisites} Spoken Tutorial on: \begin{enumerate} - \item {\LaTeX} - Getting Started + \item {\LaTeX} - Installation \item {\LaTeX} - Introduction - \item {\LaTeX} - Structuring the Content + \item {\LaTeX} - Basics \& Structuring \item {\LaTeX} - Typesetting Text \end{enumerate} \end{frame} @@ -98,70 +135,94 @@ \item To add a graphic, use \lstinline{\includegraphics} command \item Use relative path to the image \end{itemize} - \tiny See rev17 of \typ{hg} \end{frame} \begin{frame}[fragile] - \frametitle{\lstinline{includgraphics}} + \frametitle{\lstinline{includegraphics}} It takes following optional arguments \begin{itemize} - \item \lstinline+scale+ --- specifies the factor by which to scale - the image - \item \lstinline+height+, \lstinline+width+ --- If only one of them + \item \lstinline+height+, \lstinline+width+ -- If only one of them is specified, aspect ratio is maintained - \item \lstinline+keepaspectratio+ --- boolean value to keep aspect + \item \lstinline+keepaspectratio+ -- boolean value to keep aspect ratio or not - \item \lstinline+angle+ --- specify by what angle the image should + \item \lstinline+angle+ -- specify by what angle the image should be rotated \end{itemize} \end{frame} \begin{frame}[fragile] + \frametitle{\lstinline{includegraphics..}} + Syntax for \lstinline{includegraphics} command with optional arguments and + relative path to the image: + \begin{itemize} + \item \lstinline{\includegraphics[<args>]}\{<img path> \} + \end{itemize} +\end{frame} + +\begin{frame}[fragile] \frametitle{Floats} \begin{itemize} - \item Graphics (\& Tables) are special because they cannot be broken - across pages - \item They are ``floated'' to the next page, if they don't fit in - the current page + \item Graphics (\& Tables) are special + \item They are ``floated'' to the next page \item Enclose graphic within \lstinline+figure+ environment to make it float \item Figure environment takes additional parameter for location of float \end{itemize} - \begin{table} - \caption{Permission Specifiers} - - \begin{tabular}{|c|c|} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Floats..} +\begin{table} + \begin{tabular}{|c|l} Specifier & Permission\\\hline t & Top of page\\ b & Bottom of page\\ p & Separate page for floats\\ - h & here (the same place where command appears in source)\\ - ! & override \LaTeX's internal parameters for good position + h & Here (the same place)\\ + ! & Overrides internal parameters \end{tabular} \end{table} \end{frame} + \begin{frame} \frametitle{Captions and References} \begin{itemize} - \item Figure environment allows us add a caption - \item To place the image in the center we enclose it in the + \item \lstinline+caption+ to add captions to figures + \item To place the image in the center, we enclose it in the \lstinline+center+ environment \item We can label images too - \item label should be added after the caption command + \item Add label after caption command \item Figures are auto numbered \end{itemize} - \tiny See rev17 of \typ{hg} \end{frame} +\begin{frame}[fragile] + \frametitle{Captions and References..} + Sample code to include caption and label in a center aligned figure: + \vspace{8pt} + {\tiny + \begin{verbatim} + \begin{figure} + \begin{center} + \includegraphics{some image} + \end{center} + \caption{A caption for some image !} + \label{Label for some image !} + \end{figure} + \end{verbatim} + } +\end{frame} + + \begin{frame}[frame] \frametitle{Tables} \begin{itemize} \item \lstinline+tabular+ is used to typeset a table \item It is enclosed in a \lstinline+table+ environment to make it a float - \item \lstinline+table+ environment also gives captions, auto + \item \lstinline+table+ environment also gives captions, labels \& auto numbering \end{itemize} \end{frame} @@ -170,12 +231,9 @@ \begin{frame}[fragile] \frametitle{\lstinline+tabular+} \begin{itemize} - \item tabular takes formatting of each column as argument + \item Tabular takes formatting of each column as argument \end{itemize} - \begin{table} - \caption{tabular environment} - \begin{tabular}{|l|l|} \lstinline+l+ & left justified column content\\\hline \lstinline+r+ & right justified column content\\\hline @@ -183,18 +241,41 @@ \lstinline+|+ & produces a vertical line\\ \end{tabular} \end{table} - \begin{itemize} - \item also takes an optional parameter for specifying position of +\end{frame} + +\begin{frame}[fragile] + \frametitle{\lstinline+tabular+..} +\begin{itemize} + \item Also takes an optional parameter for specifying position of table \item \lstinline+t+ for top, \lstinline+b+ for bottom, \lstinline+c+ for center - \item each column of table is separated by \& - \item each row is separated by newline \lstinline{\\} + \item Seperate each column of a table by '\&' + \item Each row is separated by newline \lstinline{\\} \item \lstinline+\hline+ give a horizontal line between two rows \end{itemize} - \tiny See rev18 of \typ{hg} \end{frame} + +\begin{frame}[fragile] + \frametitle{\lstinline+tabular+..} + A sample code that shows complete use of tabular environment: + \vspace{8pt} + {\tiny + \begin{verbatim} + \begin{center} + \begin{tabular}{ l | c || r | } + \hline + 1 & 2 & 3 \\ \hline + 4 & 5 & 6 \\ \hline + 7 & 8 & 9 \\ + \hline + \end{tabular} + \end{center} + \end{verbatim} + } +\end{frame} + \begin{frame}[fragile] \frametitle{List of Tables, Figures} \begin{itemize} @@ -204,7 +285,8 @@ \end{frame} \begin{frame}[fragile] - \frametitle{Summary...} + \frametitle{Summary} + We learned how to, \begin{itemize} \item Add graphics to a LateX document \item Include tabular environments in a LateX document @@ -214,9 +296,9 @@ \begin{frame}[fragile] \frametitle{Evaluation} \begin{enumerate} -\item Why the figures and tables are called as floats? -\item What are the input parameters the figure environment take to make it float? -\item What is the mandatory arguement in tabular environment specification? +\item Which input parameter is used in the figure environment to make it float + to the bottom of the page ? +\item What is the mandatory argument in tabular environment specification ? \end{enumerate} \end{frame} \begin{frame} @@ -224,34 +306,71 @@ \frametitle{Solutions} \begin{enumerate} \vspace{15pt} -\item Figures and tables are called as floats because they float to the nearest location. -\item The following can be used as parameters to a figure environment to make it float. +\item Input parameter `b' is passed as argument, to make it float to the bottom + of the page. +\item It is mandatory to specify alignment of each column in tabular + environment. +\end{enumerate} +\end{frame} + +\begin{frame} +\frametitle{SDES \& FOSSEE} +\begin{center} \begin{itemize} -\item t - Top of the page. -\item b - Bottom of the page. -\item p - Separate pages for float -\item h - Here(the place where command appears) -\item !- To override Latex internal parameters for good position +\item \small{SDES}\\ +\small{\color{LimeGreen}Software Development techniques for Engineers and Scientists} \\ +\scriptsize An initiative by FOSSEE. \\ +\vspace{3pt} +\scriptsize For more information on SDES, please visit {\color{blue}\url{http://fossee.in/sdes}}\\ +\vspace{12pt} +\item \small{FOSSEE}\\ +\small {\color{LimeGreen}Free and Open-source Software for \\Science and Engineering Education} \\ +\scriptsize Based at IIT Bombay, Funded by MHRD.\\ +\vspace{3pt} +\scriptsize Part of National Mission on Education through ICT (NME-ICT) \\ \end{itemize} +\end{center} +\end{frame} -\item Alignment of each column -\end{enumerate} +\begin{frame} +\frametitle{About the Spoken Tutorial Project} +\begin{itemize} +\item Watch the video available at {\color{blue}\url{http://spoken-tutorial.org /What\_is\_a\_Spoken\_Tutorial}} +\item It summarises the Spoken Tutorial project +\item If you do not have good bandwidth, you can download and watch it +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Spoken Tutorial Workshops}The Spoken Tutorial Project Team +\begin{itemize} +\item Conducts workshops using spoken tutorials +\item Gives certificates to those who pass an online test +\item For more details, please write to \\ \hspace {0.5cm}{\color{blue}contact@spoken-tutorial.org} +\end{itemize} \end{frame} \begin{frame} +\frametitle{Acknowledgements} +\begin{itemize} +\item Spoken Tutorial Project is a part of the Talk to a Teacher project +\item It is supported by the National Mission on Education through ICT, MHRD, Government of India +\item More information on this Mission is available at: \\{\color{blue}\url{http://spoken-tutorial.org/NMEICT-Intro}} +\end{itemize} +\end{frame} -\begin{block}{} +\begin{frame} + \begin{block}{} \begin{center} - \textcolor{blue}{\Large THANK YOU!} + {\Large THANK YOU!} \end{center} \end{block} \begin{block}{} \begin{center} For more Information, visit our website\\ - \url{http://fossee.in/} + {\color{blue}\url{http://fossee.in/}} \end{center} \end{block} \end{frame} \end{document} - |