latex/lab-workbook.tex
author Madhusudan.C.S <madhusudancs@gmail.com>
Tue, 07 Sep 2010 16:49:56 +0530
changeset 129 6e237b9442cd
parent 107 80a8b46754f8
child 134 73012a0eb878
permissions -rw-r--r--
Adding a huge question for lab exercise 4.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
107
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     1
% Created 2010-08-31 Tue 18:51
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     2
\documentclass[11pt]{article}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
\usepackage[utf8]{inputenc}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
\usepackage[T1]{fontenc}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     5
\usepackage{fixltx2e}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     6
\usepackage{graphicx}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     7
\usepackage{longtable}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     8
\usepackage{float}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     9
\usepackage{wrapfig}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    10
\usepackage{soul}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    11
\usepackage{textcomp}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    12
\usepackage{marvosym}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    13
\usepackage{wasysym}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    14
\usepackage{latexsym}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    15
\usepackage{amssymb}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    16
\usepackage{hyperref}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    17
\tolerance=1000
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    18
\providecommand{\alert}[1]{\textbf{#1}}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    19
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    20
\title{Lab Workbook --- \LaTeX}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    21
\author{FOSSEE}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    22
\date{August, 2010}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    23
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    24
\begin{document}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    25
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    26
\maketitle
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    27
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    28
\setcounter{tocdepth}{3}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    29
\tableofcontents
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    30
\vspace*{1cm}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    31
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    32
\section{Lab-1}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    33
\label{sec-1}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    34
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    35
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    36
\begin{enumerate}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    37
\item Compile and produce a pdf output of \texttt{example1.tex}.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    38
\item Modify \texttt{example1.tex} replacing \texttt{LaTeX} with \texttt{\textbackslash{}LaTeX}.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    39
\item Add a title, author and date to the document.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    40
\item What happens if \texttt{\textbackslash{}date} is replaced by \texttt{\textbackslash{}date\{IIT, Bombay\}} ?
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    41
\item Debug and compile examples 2, 3, 4, 5
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    42
\item Provide a document (pdf and source) with a TOC, but has been
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    43
     compiled only once. Exercise for Debugging.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    44
\item What happens when you add the following \LaTeX{} code to the
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    45
     document from the previous question? 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    46
     
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    47
\begin{verbatim}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    48
      \renewcommand{\contentsname}{What is Here?}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    49
\end{verbatim}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    50
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    51
\item Experiment with setting the secnumdepth counter to 1, 0, -1.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    52
\item Debug and compile example 6.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    53
\item Experiment with the options of \texttt{\textbackslash{}documentclass}.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    54
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    55
\begin{itemize}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    56
\item 10pt, 11pt, 12pt sets the size of the text of the document.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    57
\item onecolumn, twocolumn
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    58
\item draft --- makes \LaTeX{} highlight problems in typesetting to
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    59
        be looked at by a human.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    60
\end{itemize}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    61
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    62
\end{enumerate}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    63
\section{Lab-2}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    64
\label{sec-2}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    65
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    66
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    67
\begin{enumerate}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    68
\item \texttt{\textbackslash{}newpage} command adds a page break. Add some page breaks to
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    69
     example 6 and see how the command works.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    70
\item Try out the commands \texttt{\textbackslash{}pagestyle} and \texttt{\textbackslash{}thispagestyle} with the
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    71
     following parameters and look at the outputs obtained.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    72
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    73
\begin{itemize}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    74
\item \texttt{empty},
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    75
\item \texttt{plain},
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    76
\item \texttt{heading}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    77
\end{itemize}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    78
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    79
\item Add the following description list describing the options to
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    80
     \texttt{\textbackslash{}includegraphics} command to a document and look at the output. 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    81
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    82
\begin{verbatim}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    83
\begin{description}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    84
\item[{\texttt{width=x}, \texttt{height=x}}] 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    85
If only the height or width is specified, the image is scaled, maintaining the aspect ratio.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    86
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    87
\item[{\texttt{keepaspectratio}}]  
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    88
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.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    89
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    90
\item[{\texttt{angle=x}}] 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    91
This option can be used to rotate the image by \texttt{x} degrees, counter-clockwise.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    92
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    93
\end{description}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    94
\end{verbatim}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    95
\item \texttt{\textbackslash{}ldots} is used to get ellipsis in \LaTeX{} documents.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    96
\item Read the manual of listings package and learn how to include a
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    97
     set of lines from a file into a \LaTeX{} document. Include a few
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    98
     lines from your previous lab exercises of ULT.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    99
\item To change the line spacing of your document
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   100
     \texttt{\textbackslash{}usepackage\{setspace\}} and then specify the line spacing of
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   101
     your document, using \texttt{\textbackslash{}doublespace}, \texttt{\textbackslash{}onehalfspace}, etc.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   102
\item Debug and compile examples 9, 10
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   103
\end{enumerate}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   104
\section{Lab-3}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   105
\label{sec-3}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   106
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   107
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   108
\begin{enumerate}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   109
\item Debug and compile example 7.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   110
\item BibTeX is another way of handling bibliography. Look at
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   111
       bibtex.rst and change draft.tex to use BibTeX.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   112
\item As you would've already observed, \LaTeX{} compilation produces a
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   113
       lot of other files along with the pdf output.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   114
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   115
\begin{itemize}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   116
\item .log --- gives a log of what happened during last
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   117
         compilation.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   118
\item .toc --- stores section headers. Edit this file and observe
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   119
         changes in this document to see how the compilation of \LaTeX{}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   120
         works and why two compilations are required for table of
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   121
         contents to work.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   122
\item .aux --- used to share information between consecutive
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   123
         compiler runs.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   124
\end{itemize}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   125
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   126
\item Prepare a presentation in beamer with solutions to any 10
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   127
       problems from the Lab workbook.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   128
\item Debug and compile example 8.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   129
\item Finish the incomplete parts of the draft to obtain the complete
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   130
       output of the sample document that we started out to prepare.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   131
\end{enumerate}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   132
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   133
\end{document}