latex/handout.rst
changeset 61 cfae54ede139
parent 56 eee394eb05fc
child 63 dc13f22e9489
equal deleted inserted replaced
60:8a36825e21c5 61:cfae54ede139
    50   * It is widely used.
    50   * It is widely used.
    51 
    51 
    52 Hello World
    52 Hello World
    53 ~~~~~~~~~~~
    53 ~~~~~~~~~~~
    54 
    54 
    55 Ok, let's get started with our first LaTeX document. Open up your favorite editor and type in the following code. 
    55 OK, let's get started with our first LaTeX document. Open up your favorite editor and type in the following code. 
    56 
    56 
    57 ::
    57 ::
    58 
    58 
    59   %hello.tex - First LaTeX document
    59   %hello.tex - First LaTeX document
    60   \documentclass{article}
    60   \documentclass{article}
   273 ---------------------------
   273 ---------------------------
   274 
   274 
   275 Emphasizing
   275 Emphasizing
   276 ~~~~~~~~~~~
   276 ~~~~~~~~~~~
   277 
   277 
   278 *Italic* font is generally used to emphasize text. The ``\emph`` command may be used to achive this effect in LaTeX.
   278 *Italic* font is generally used to emphasize text. The ``\emph`` command may be used to achieve this effect in LaTeX.
   279 ::
   279 ::
   280 
   280 
   281   This is the \emph{emphasized text}.
   281   This is the \emph{emphasized text}.
   282 
   282 
   283 If the ``\emph`` command is nested within another emphasize command, LaTeX emphasized that text using normal fonts. 
   283 If the ``\emph`` command is nested within another emphasize command, LaTeX emphasized that text using normal fonts. 
   323 
   323 
   324 The ``center`` environment generates centered text.
   324 The ``center`` environment generates centered text.
   325 
   325 
   326 Itemize, Enumerate, and Description
   326 Itemize, Enumerate, and Description
   327 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   327 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   328 LaTeX has three different enivronments for producing lists. Itemize, Enumerate and Description allow you to produce lists of various types in LaTeX. 
   328 LaTeX has three different environments for producing lists. Itemize, Enumerate and Description allow you to produce lists of various types in LaTeX. 
   329 
   329 
   330 Itemize is used to produce unnumbered lists. The bullets of the list can be easily changed to use any character. Enumerate environment allows you to produce auto-numbered lists. The description environment, allows you to produce a list of definitons. These environments can be nested within each other, easily. 
   330 Itemize is used to produce unnumbered lists. The bullets of the list can be easily changed to use any character. Enumerate environment allows you to produce auto-numbered lists. The description environment, allows you to produce a list of definitions. These environments can be nested within each other, easily. 
   331 
   331 
   332 ::
   332 ::
   333 
   333 
   334   \begin{itemize}
   334   \begin{itemize}
   335     \item Now we move onto some elementary \emph{Text Typesetting}.
   335     \item Now we move onto some elementary \emph{Text Typesetting}.
   398   \end{verbatim}
   398   \end{verbatim}
   399 
   399 
   400   from numpy import *
   400   from numpy import *
   401   a = linspace(0, 5, 50, endpoint = False)
   401   a = linspace(0, 5, 50, endpoint = False)
   402 
   402 
   403 To insert verbatim text inline, the ``\verb`` command can be used. 
   403 To insert verbatim text in-line, the ``\verb`` command can be used. 
   404 ::
   404 ::
   405   
   405   
   406  The verb command allows placing \verb|verbatim text| inline. 
   406  The verb command allows placing \verb|verbatim text| in-line. 
   407 
   407 
   408 The | is just an example of a delimiter character. You can use any character except letters, * or space.
   408 The | is just an example of a delimiter character. You can use any character except letters, * or space.
   409 
   409 
   410 Tables, Figures and Captions
   410 Tables, Figures and Captions
   411 ----------------------------
   411 ----------------------------
   477 
   477 
   478   ``keepaspectratio``
   478   ``keepaspectratio``
   479     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. 
   479     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. 
   480 
   480 
   481   ``scale=x``
   481   ``scale=x``
   482     Scale the image by a factor of ``x``. For eg. ``scale=2``, will double the image size. 
   482     Scale the image by a factor of ``x``. For example, ``scale=2``, will double the image size. 
   483 
   483 
   484   ``angle=x``
   484   ``angle=x``
   485     This option can be used to rotate the image by ``x`` degrees, counter-clockwise. 
   485     This option can be used to rotate the image by ``x`` degrees, counter-clockwise. 
   486 
   486 
   487 ::
   487 ::
   602 
   602 
   603 Each bibliography entry starts with a declaration of the type of the reference being mentioned. The reference is in the above example is of the book type. BibTeX has a wide range of reference types, for example, ``article, book, conference, manual, proceedings, unpublished``.
   603 Each bibliography entry starts with a declaration of the type of the reference being mentioned. The reference is in the above example is of the book type. BibTeX has a wide range of reference types, for example, ``article, book, conference, manual, proceedings, unpublished``.
   604 
   604 
   605 The type of reference is followed by a left curly brace, and immediately followed by the citation key. The citation key, ``Lamport94`` in the example above is used to cite this reference using the command ``\cite{Lamport94}``. 
   605 The type of reference is followed by a left curly brace, and immediately followed by the citation key. The citation key, ``Lamport94`` in the example above is used to cite this reference using the command ``\cite{Lamport94}``. 
   606 
   606 
   607 This is followed by the relevant fields and their values, listed one by one. Each entry must be followed by a comma to delemit one field from the other. 
   607 This is followed by the relevant fields and their values, listed one by one. Each entry must be followed by a comma to delimit one field from the other. 
   608 
   608 
   609 To get your LaTeX document to use the bibliography database, you just add the following lines to your LaTeX document. 
   609 To get your LaTeX document to use the bibliography database, you just add the following lines to your LaTeX document. 
   610 ::
   610 ::
   611 
   611 
   612   \bibliographystyle{plain}
   612   \bibliographystyle{plain}
   613   \bibliography{LaTeX}
   613   \bibliography{LaTeX}
   614 
   614 
   615 Bibliography styles are files that tell BibTeX how to format the information stored in the ``.bib`` database file. The style file for this example is ``plain.bst``. Note that you do not need to add the ``.bst`` extension to the filename.  If you wish to achieve a particular style of listing the bibliography items and citing them, you should use an appropriate style file. 
   615 Bibliography styles are files that tell BibTeX how to format the information stored in the ``.bib`` database file. The style file for this example is ``plain.bst``. Note that you do not need to add the ``.bst`` extension to the filename.  If you wish to achieve a particular style of listing the bibliography items and citing them, you should use an appropriate style file. 
   616 
   616 
   617 The ``bibliography`` command specifies the file that shoule be used as the database for references. The file used in this example is ``LaTeX.bib``
   617 The ``bibliography`` command specifies the file that should be used as the database for references. The file used in this example is ``LaTeX.bib``
   618 
   618 
   619 Compiling
   619 Compiling
   620 +++++++++
   620 +++++++++
   621 
   621 
   622 Adding BibTeX based references, slightly complicates the process of compiling the document to obtain the desired output. The exact workings of LaTeX and BibTeX will not be explained here. The procedure for obtaining the output (without any explanations) is as follows:
   622 Adding BibTeX based references, slightly complicates the process of compiling the document to obtain the desired output. The exact workings of LaTeX and BibTeX will not be explained here. The procedure for obtaining the output (without any explanations) is as follows:
   661 
   661 
   662 Exponents and subscripts can be typeset using the carat ``^`` and the underscore ``_`` respectively. Most of the math mode commands act only on the next character. If you want a command to affect several characters, they need to be enclosed in curly braces. 
   662 Exponents and subscripts can be typeset using the carat ``^`` and the underscore ``_`` respectively. Most of the math mode commands act only on the next character. If you want a command to affect several characters, they need to be enclosed in curly braces. 
   663 
   663 
   664 The ``\sqrt`` command is used to typeset the square root symbol. LaTeX of the root sign is determined automatically. The nth root is generated with ``\sqrt[n]``. 
   664 The ``\sqrt`` command is used to typeset the square root symbol. LaTeX of the root sign is determined automatically. The nth root is generated with ``\sqrt[n]``. 
   665 
   665 
   666 To explicitly show a multiplication a dot may be shown. ``\cdot`` could be used, which typesets the dot to the centre. ``\cdots`` is three centered dots while ``\ldots`` sets the dots on the baseline. Besides that ``\vdots`` for vertical and ``\ddots`` can be used for diagonal dots.
   666 To explicitly show a multiplication a dot may be shown. ``\cdot`` could be used, which typesets the dot to the center. ``\cdots`` is three centered dots while ``\ldots`` sets the dots on the baseline. Besides that ``\vdots`` for vertical and ``\ddots`` can be used for diagonal dots.
   667 
   667 
   668 A fraction can be typeset with the command ``\frac{..}{..}``
   668 A fraction can be typeset with the command ``\frac{..}{..}``
   669 
   669 
   670 The integral operator is generated with ``\int``, the sum operator with ``\sum``, and the product operator with ``\prod``. The upper and lower limits are specified with ``^`` and ``_`` like subscripts and superscripts.
   670 The integral operator is generated with ``\int``, the sum operator with ``\sum``, and the product operator with ``\prod``. The upper and lower limits are specified with ``^`` and ``_`` like subscripts and superscripts.
   671 
   671 
   688 
   688 
   689 
   689 
   690 Arrays and Matrices
   690 Arrays and Matrices
   691 ~~~~~~~~~~~~~~~~~~~
   691 ~~~~~~~~~~~~~~~~~~~
   692 
   692 
   693 To typset arrays, use the ``array`` environment. It works similar to the ``tabular`` environment. The ``\\`` command is used to break the lines. 
   693 To typeset arrays, use the ``array`` environment. It works similar to the ``tabular`` environment. The ``\\`` command is used to break the lines. 
   694 ::
   694 ::
   695 
   695 
   696   \begin{equation*}
   696   \begin{equation*}
   697   \mathbf{X} = \left(
   697   \mathbf{X} = \left(
   698    \begin{array}{ccc}
   698    \begin{array}{ccc}
   784 
   784 
   785 This command includes the first 20 lines of the file ``lstexample.py`` into out LaTeX document. 
   785 This command includes the first 20 lines of the file ``lstexample.py`` into out LaTeX document. 
   786 
   786 
   787 Including files
   787 Including files
   788 ~~~~~~~~~~~~~~~
   788 ~~~~~~~~~~~~~~~
   789 When working on a large document, it is convinient sometimes, to split the large file into smaller input files and club them together at the time of compiling. 
   789 When working on a large document, it is convenient sometimes, to split the large file into smaller input files and club them together at the time of compiling. 
   790 
   790 
   791 The ``\input`` or ``\include`` commands may be used to embed one LaTeX file into another. The ``\input`` command is equivalent to a copy and paste of the document, just before the compilation. The ``\include`` command is exactly similar, except for the fact that it creates a new page every time it is issued.
   791 The ``\input`` or ``\include`` commands may be used to embed one LaTeX file into another. The ``\input`` command is equivalent to a copy and paste of the document, just before the compilation. The ``\include`` command is exactly similar, except for the fact that it creates a new page every time it is issued.
   792 
   792 
   793 ``\input{file}`` or ``\include{file}`` commands will include the file ``file1.tex`` with in the file where the command has been issued. Note that you do not need to specify the ``.tex`` extension of the file. 
   793 ``\input{file}`` or ``\include{file}`` commands will include the file ``file1.tex`` with in the file where the command has been issued. Note that you do not need to specify the ``.tex`` extension of the file. 
   794 
   794 
   797 A note on filenames
   797 A note on filenames
   798 +++++++++++++++++++
   798 +++++++++++++++++++
   799 
   799 
   800 Never use filenames or directories that contain spaces. Make filenames as long or short as you would like, but strictly avoid spaces. Stick to upper or lower case letters (without accents), the digits, the hyphen and the full stop or period.
   800 Never use filenames or directories that contain spaces. Make filenames as long or short as you would like, but strictly avoid spaces. Stick to upper or lower case letters (without accents), the digits, the hyphen and the full stop or period.
   801 
   801 
   802 --------------------------------------------------------
   802 
   803 
   803 
   804 Acknowledgements, Attributions
   804 Recommended Reading
   805 ------------------------------
   805 ===================
   806 
   806 
   807 1. *LaTeX Wikibook*
   807 1. *LaTeX Wikibook*
   808 
   808 
   809 2. *The Not So Short Introduction to LaTeX2e* by Tobias Oetikar et al.. 
   809 2. *The Not So Short Introduction to LaTeX2e* by Tobias Oetikar et al.. 
   810 
   810 
   811 3. http://www.ctan.org/tex-archive/info/l2tabu/english/
   811 
   812 ..  LocalWords:  LaTeX WYSIWG WYSIWM pdf
   812 
   813 
   813 
   814 
   814 
   815 
   815 
   816 
   816 ..  LocalWords:  LaTeX Lamport tex documentclass pdf pdflatex dvi topmatter ToC
   817 
   817 ..  LocalWords:  FOSSEE tocdepth addcontentsline toc emph