SLIDE 1 AOS Linux Tutorial
Revision Control and L
AT
EX Michael Havas
- Dept. of Atmospheric and Oceanic Sciences
McGill University October 12, 2010
SLIDE 2
Outline
1 Revision Control
Subversion Git
2 L AT
EX Introduction Beauty Tools Structure Building Typesetting Text Useful Packages BibTeX
3 Next Time
SLIDE 3
Revision Control
Time machine for your documents. Collaboration. Integrates with Text Editors and IDEs.
SLIDE 4
Revision Control Systems
Types
Central Subversion. CVS. Distributed Git. Mercurial. Darcs. Bazaar.
SLIDE 5
Revision Control Systems
Types
Central Subversion. CVS. Distributed Git. Mercurial. Darcs. Bazaar.
SLIDE 6
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.
SLIDE 7
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.
SLIDE 8
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
SLIDE 9 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 \
Checking out a project $ cd /aos/home/user/project/src $ svn checkout file:///~/repos/svn/project/trunk Updating a checked out project $ svn update
SLIDE 10
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
SLIDE 11
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.
SLIDE 12
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.
SLIDE 13
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
SLIDE 14 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
- f 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/
SLIDE 15
Outline
1 Revision Control
Subversion Git
2 L AT
EX Introduction Beauty Tools Structure Building Typesetting Text Useful Packages BibTeX
3 Next Time
SLIDE 16
L
AT
EX
Introduction
What is L
AT
EX A document preparation system. Produces high-quality typesetting Often used for technical or scientific documents. What L
AT
EX is not A word processor. WYSIWYG
SLIDE 17
L
AT
EX
Introduction
What is L
AT
EX A document preparation system. Produces high-quality typesetting Often used for technical or scientific documents. What L
AT
EX is not A word processor. WYSIWYG
SLIDE 18
L
AT
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.
SLIDE 19
L
AT
EX
Introduction
Advantages Over WYSIWYG Editors Beauty. Portability. Lightness. Security. Freedom. Focus on content and not layout.
SLIDE 20
L
AT
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
AT
EX.
SLIDE 21 L
AT
EX
Beauty
Kerning.
Figure: Kerning in Word Figure: Kerning in L
AT
EX
SLIDE 22 L
AT
EX
Beauty
Kerning. Real Small Caps.
Figure: Small caps in Word Figure: Small caps in L
AT
EX
SLIDE 23 L
AT
EX
Beauty
Kerning. Real Small Caps. Ligatures.
Figure: Ligatures in Word Figure: Ligatures in L
AT
EX
SLIDE 24 L
AT
EX
Beauty
Kerning. Real Small Caps. Ligatures. Line breaks, justification and hyphenation.
Figure: Hyphenation in L
AT
EX
SLIDE 25 L
AT
EX
Beauty
Kerning. Real Small Caps. Ligatures. Line breaks, justification and hyphenation.
Figure: Hyphenation in L
AT
EX
For more info: http://nitens.org/taraborelli/latex
SLIDE 26
L
AT
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.
SLIDE 27
L
AT
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/
SLIDE 28 L
AT
EX
Document Structure
A first example
% % Sample Document . % % ’%’ i s a comment % % The preamble \ documentclass { a r t i c l e } \ usepackage { f u l l p a g e } \ 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
A Sample Title
Michael Havas October 12, 2010
Contents
1 A sample Section 1
1 A sample Section
This is some text.
SLIDE 29
L
AT
EX
Building
Building a L
AT
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.
SLIDE 30
L
AT
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.
SLIDE 31
L
AT
EX
Typesetting Text
Whitespace, Line-breaks, paragraph-breaks, page-breaks White space Does not count. Paragraph-breaks \\ Page-breaks \newpage
SLIDE 32
L
AT
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}
SLIDE 33 L
AT
EX
Typesetting Text
Tables and the tabular environment \begin{tabular}{|r|l|} \hline 7C0 & hexadecimal \\ 3700 & octal \\ 11111000000 & binary \\ \hline \hline 1984 & decimal \\ \hline \end{tabular} 7C0 hexadecimal 3700
11111000000 binary 1984 decimal
SLIDE 34
L
AT
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*}
SLIDE 35
L
AT
EX
Typesetting Text
Symbols \alpha \beta \gamma \delta α β γ δ = \equiv \cup \rightarrow = ≡ ∪ → \geq \frac{a}{b} aˆb \sum {a}ˆb ≥
a b
ab b
a
SLIDE 36
L
AT
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}
SLIDE 37
L
AT
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.
SLIDE 38
L
AT
EX
Useful Packages
Useful Packages Listings Amsmath hshyperref Beamer Modernvc Algorithmic
SLIDE 39
L
AT
EX
BibTex
BibTex Entry @article{1320864, author = {Ronald Metoyer and Victor Zordan}, title = {Psychologically Inspired Anticipation and Dynamic Response for Impacts to the Head and Upper Body}, journal = {IEEE Transactions on Visualization and Computer Graphics}, volume = {14}, number = {1}, year = {2008}, issn = {1077-2626}, pages = {173--185}, doi = {http://dx.doi.org/10.1109/TVCG.2007.70427}, publisher = {IEEE Educational Activities Department}, address = {Piscataway, NJ, USA}, }
SLIDE 40
L
AT
EX
BibTex
Latex file \documentclass[11pt]{article} \usepackage{cite} \begin{document} \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle Blablabla said Nobody ~\cite{1320864}. \bibliography{mybib}{} \bibliographystyle{plain} \end{document}
SLIDE 41
L
AT
EX
BibTeX
Compiling $ pdflatex myarticle $ bibtex myarticle $ pdflatex myarticle $ pdflatex myarticle
SLIDE 42
Outline
1 Revision Control
Subversion Git
2 L AT
EX Introduction Beauty Tools Structure Building Typesetting Text Useful Packages BibTeX
3 Next Time
SLIDE 43
Next Time
Your Suggestions Review? Matlab?