Intro to LaTeX WING meeting 12 Jan 2007 What’s LaTeX An alternative to using MS Word for writing reports and papers Our target today HYP Thesis by ytm52584

VIEWS: 230 PAGES: 19

Ph.D Thesis Template document sample

More Info
									Intro to LaTeX
 WING meeting 12 Jan 2007
             What’s LaTeX?

    > An alternative to using MS Word for writing
      reports and papers

    > Our target today:
         HYP Thesis
         ACM Conference Submissions
         PhD Thesis

    > Best Practice Tools

              Why LaTeX?

    > Plain Text with Markup
    > Forces you to concentrate on writing
    > Takes care of math, figure positioning,
      references, and tables of contents quite well.
    > Free!

    > Why not LaTeX?
         Steep learning curve
         Not WYSIWYG (even with 3rd party tools)
         Needs compilation
         Ugly tables and Figure inclusion is hard

    > Conclusion: use if you have time to learn
            Example of LaTeX
    \title{Simple Example}
    \author{Andrei Gurtov}
    \date{March 2000}
    Hello world!

                            Two Columns
    > Columns
                                       l = automatically adjust
    > Rows                                 size, left justify
        & - Split text into columns    r = automatically adjust
        \\ - End a row                     size, right justify
        \hline - Draw line under row   p = set size
        e.g. 123123 & 34.00\\ \hline        e.g p{4.7cm}
                                       c = centre text

        Example of table

    \begin{tabular}{|l|r|c|} \hline
    Date & Price & Size \\ \hline
    Yesterday & 5 & big \\ \hline
    Today & 3 & small \\ \hline

             Date          Price      Size
             Yesterday        5        Big

             Today            3       Small

                         Floating Objects

    > Floating objects can stop splitting of tables and
      images over pages.
    > They will now appear in the
          List of Figures (LOF) and
          List of Tables (LOT).

                                 Options (recommendations)
                                 h = place table here
                                 t = place at top of page
7                                b = place at bottom of page
              Example of floating

    >   \begin{figure}[ht]
    >   \centering\epsfig{, width=5cm}
    >   \caption{University of Helsinki}
    >   \label{uni}
    >   \end{figure}      Width and height modifiers


                  Some Math

    $$ y=\frac{a^3+2c_{x}}{1+\sqrt{b_{x}}}
        $$ \\
        f(x_{j})dx $$ \\
    $$ \Psi = \oint_{-
    Qx}{\partial Qy}})^{\Im_{\pi}^ \prime}
        $$ \\ }

               Local .sty and .cls files

     > These are the files that control the
       formatting of the final file (look&feel)
          LaTeX uses .sty (style files)
          LaTeX2E uses .cls (class files)

     > For HYP reports use Wei Tsang’s page
          Google “latex ooiwt” or “latex nus soc”

     > For Ph.D. thesis use Hang’s template

          Or WING cvs sg/edu/nus/comp/hang/thesis_template

     > For papers, start with the ACM template
10        Google “acm latex template”, use alternate tighter style
               Trivial to do

     > Create a table of contents
     > Create a table of figures
     > Create the bibliography
          Only records that were referenced will be included
          This means you can keep all of the references you will
          ever use in one BibTex file.

               Bibliography using

     > Bibliography information is stored in a
       *.bib file, in BibTex format.
     > Include chicago package (at top)
     > Set referencing style (at end)
     > Create reference section by
          \bibliography{bibfile with no extension}

                Bibliography using

     author=“D. E. Comer”,
     title={Internetworking with TCP/IP:
         Principles, Protocols and Architecture},

     > Citing references in text
           \cite{cuc98} = (Cuce 1998)
           \citeN{cru98} = Crud (1998)
           \shortcite{tom98} = (Tom, et. al. 1998)
     > Creating Bibtex Files
           Use Emacs with extensions.
            or copy Bibtex entries from bibliography database.
           ACM Portal has option to get BibTex reference


     > Often LaTeX will fail with an error.

     > If it has a question mark for you,
       type “x” and press enter.

     > This will quit LaTeX.

     > When LaTeX dies like this, it is
       almost always because you
       screwed up.

                How to solve problems

     > Look at the error LaTeX gave you.

     > It will have a line number which will help you
       find the error.

     > Common mistakes:
           Mismatched \begin{}/\end{} blocks
           Mismatched {/}
           Mismatched $, $$, or \(\) or \[\]
           Misspelled keywords

     > Sometimes lines are too long. This isn’t fatal
       but looks bad. LaTeX outputs a warning with
       a line number so you can fix it.
               Best Practice Tools

     > make to create your pdf file
     > Use another program to create eps or pdf
       figures for inclusion.
          PowerPoint, or xfig
          Use graphicx or epsfig package for eps figures
          You can import raster graphics (jpg) but this is trickier;
          make sure resolution is correct
     > Use GhostView to see revisions
          Can read PDF, not as slow or feature heavy as Acrobat
          Handles re-opens well
     > Need to count words?
17        Use my script, from my software page.
               General Best Practices

     > Check in your revisions very often to get CVS
       to backup your stuff
          You may need to refer to your old files
          Do comment your revisions
          Use in file CVS $Id$ and $Log$ to see revision history
     > Use specific comments
          Comments start with % but don’t show
          Use % BUG: to tell me what to correct, I will do the same
          Use % GUB: to tell me what’s fixed; I will then delete the
          line if I agree
     > Use inline notes {\em BUG: xxx }
          If you need me to see a thing wrt to the actual file.
               Need help?

     > Use the web; learn by example
     > One in particular:
       Hypertext help for LaTeX


To top