AOS Linux Tutorial Revision Control and L A T EX Michael Havas Dept. of Atmospheric and Oceanic Sciences McGill University October 12, 2010
Outline 1 Revision Control Subversion Git 2 L A T EX Introduction Beauty Tools Structure Building Typesetting Text Useful Packages BibTeX 3 Next Time
Revision Control Time machine for your documents. Collaboration. Integrates with Text Editors and IDEs.
Revision Control Systems Types Central Subversion. CVS. Distributed Git. Mercurial. Darcs. Bazaar.
Revision Control Systems Types Central Subversion. CVS. Distributed Git. Mercurial. Darcs. Bazaar.
Revision Control Systems Pros and Cons of Central RCS Pros of central revisions control systems Centralized. Robust. Secure. Many tools. Cons of central revisions control systems Centralized. Rigid. Slow. Online.
Revision Control Systems Pros and Cons of Central RCS Pros of central revisions control systems Centralized. Robust. Secure. Many tools. Cons of central revisions control systems Centralized. Rigid. Slow. Online.
Revision Control Systems Subversion Workflow if Project is not checked out then Checkout project. end if Update project while Not tired do Do logical unit of work. Add any additional files to the repository. Checkin project with good log message. end while
Revision Control Systems Subversion Creating and importing an existing project $ svnadmin create /aos/home/user/repos/svn $ svn import /path/to/project \ file:///~/repos/svn/project/trunk \ -m "Initial Import" Checking out a project $ cd /aos/home/user/project/src $ svn checkout file:///~/repos/svn/project/trunk Updating a checked out project $ svn update
Revision Control Systems Subversion Adding Files and Directories $ svn add . Committing Changes $ svn commit -m "Log Message" Seeing Changes $ svn diff Viewing History $ svn log
Revision Control Systems Git Benefits Decentralized. Quick. Branching is a primary activity. Working directory is the repository. Offline. Drawbacks Decentralized. Complicated (at first). Lack of integration.
Revision Control Systems Git Benefits Decentralized. Quick. Branching is a primary activity. Working directory is the repository. Offline. Drawbacks Decentralized. Complicated (at first). Lack of integration.
Revision Control Systems Git Initializing git $ cd /path/to/project $ git init $ git add $ git commit -a -m "Initial Commit." Adding files and Commiting $ git add . $ git commit -m "A useful message." Cloning a Repository $ git clone http://server/repository
Revision Control Systems A Good Commit Message A Quote Always write a comment when committing something to the repository. Your comment should be brief and to the point, describing what was changed and possibly why. If you made several changes, write one line or sentence about each part. If you find yourself writing a very long list of changes, consider splitting your commit into smaller parts, as described earlier. Prefixing your comments with identifiers like Fix or Add is a good way of indicating what type of change you did. It also makes it easier to filter the content later, either visually, by a human reader, or automatically, by a program. http://blog.looplabel.net/2008/07/28/ best-practices-for-version-control/
Outline 1 Revision Control Subversion Git 2 L A T EX Introduction Beauty Tools Structure Building Typesetting Text Useful Packages BibTeX 3 Next Time
L A T EX Introduction What is L A T EX A document preparation system. Produces high-quality typesetting Often used for technical or scientific documents. What L A T EX is not A word processor. WYSIWYG
L A T EX Introduction What is L A T EX A document preparation system. Produces high-quality typesetting Often used for technical or scientific documents. What L A T EX is not A word processor. WYSIWYG
L A T EX Introduction Features for: Typesetting journal articles, technical reports, books and slide presentations. Control over large documents containing sections, cross-references, tables and figures. Typesetting complex mathematical formulas. Automatic generation of bibliographies and indexes. Multi-lingual typesetting. Inclusion of artwork. Custom fonts.
L A T EX Introduction Advantages Over WYSIWYG Editors Beauty. Portability. Lightness. Security. Freedom. Focus on content and not layout.
L A T EX Introduction History Based on Donald Knuth’s T EX typesetting language. First developed in 1985 by Leslie Lamport. Annoyances Pronounced Lah-tech or Lay-tech to rhyme with “blech” or “Brecht”. Written L A T EX.
L A T EX Beauty Figure: Kerning in Word Kerning. Figure: Kerning in L A T EX
L A T EX Beauty Figure: Small caps in Word Kerning. Figure: Small caps in L A T EX Real Small Caps.
L A T EX Beauty Figure: Ligatures in Word Kerning. Real Small Caps. Figure: Ligatures in L A T EX Ligatures.
L A T EX Beauty Kerning. Real Small Caps. Ligatures. Line breaks, justification and hyphenation. Figure: Hyphenation in L A T EX
L A T EX Beauty Kerning. Real Small Caps. Ligatures. Line breaks, justification and hyphenation. Figure: Hyphenation in L A T EX For more info: http://nitens.org/taraborelli/latex
L A T EX Tools Windows MiKTeX http://miktex.org/ TeXnicCenter http://www.texniccenter.org/ OS X MacTex http://www.tug.org/mactex/ Linux TeXLive http://www.tug.org/texlive/ Install via package manager.
L A T EX Tools Editors Kile http://kile.sourceforge.net TeXMaker http://www.xm1math.net/texmaker/ Gedit-LaTeX http://live.gnome.org/Gedit/LaTeXPlugin Gummi http://code.google.com/p/gummi/ Vim http://www.vim.org Vim-latex vim-latex.sourceforge.net Emacs http://www.gnu.org/software/emacs/ Auctex http: //www.gnu.org/software/auctex/ LyX http://www.lyx.org/
L A T EX Document Structure A first example % % Sample Document . A Sample Title % % ’%’ i s a comment Michael Havas October 12, 2010 % % The preamble Contents \ documentclass { a r t i c l e } 1 A sample Section 1 \ usepackage { f u l l p a g e } 1 A sample Section This is some text. \ author { Michael Havas } \ t i t l e { A Sample T i t l e } % % The body \ begin { document } \ m a k e t i t l e \ t a b l e o f c o n t e n t s \ s e c t i o n { A sample Section } This i s some t e x t . \ end { document } sample01.tex
L A T EX Building Building a L A T EX document to pdf Code your document. bibtex document.bib while not complete do pdflatex document.tex if error then code some more end if end while Tips Some editors help you with this tremendously.
L A T EX Typesetting Text Font types \ emph { word } Emphasis (normally italics) \ textsc { word } Small caps . \ textsl { word } Slanted . \ texttt { word } Typewritter font (fixed-width). \ textbf { word } Bold . \ underline { word } Underline. \ textit { word } Italics .
L A T EX Typesetting Text Whitespace, Line-breaks, paragraph-breaks, page-breaks White space Does not count. Paragraph-breaks \\ Page-breaks \ newpage
L A T EX Typesetting Text Enumerate \begin{enumerate} \item Apples. \item Oranges. \end{enumerate} itemize \begin{itemize} \item Apples. \item Oranges. \end{itemize} description \begin{description} \item[Apples] Yummy!. \item[Oranges] Nabbad. \end{description}
L A T EX Typesetting Text Tables and the tabular environment \begin{tabular}{|r|l|} 7C0 hexadecimal \hline 7C0 & hexadecimal \\ 3700 octal 3700 & octal \\ 11111000000 binary 11111000000 & binary \\ 1984 decimal \hline \hline 1984 & decimal \\ \hline \end{tabular}
L A T EX Typesetting Text Inline Math Inline math may be types by putting them between \ ( . . . \ ) characters. Used to be $ characters but that’s old-school Math Environments There exists some math environments useful for typesetting math. The most useful are in the amsmath package. align Ex: \begin{align*} a^2 +b^2 &= c^2 \\ 2a^2 + 2b^2 &= 2c^2 \end{align*}
L A T EX Typesetting Text Symbols \ alpha \ beta \ gamma \ delta α β γ δ = \ equiv \ cup \ rightarrow = ≡ ∪ → \ geq \ frac { a }{ b } aˆb \ sum { a } ˆb � b a a b ≥ a b
L A T EX Typesetting Text Sectioning \ section { name } \ subsection { name } \ subsubsection { name } Figures \begin{figure}[htpb] \label{labelID} \includegraphics[scale=0.5]{img/picture.jpg} \caption{A picture} \end{figure}
L A T EX Typesetting Text Labels and References Labels can exist anywhere in your document. \label{labelID} References refer to labels for cross-referencing within a document. According to me in section \ref{labelID}, I am so awesome.
L A T EX Useful Packages Useful Packages Listings Amsmath hshyperref Beamer Modernvc Algorithmic
Recommend
More recommend