html5-img
1 / 82

LaTeX, BibTeX & FarsiTeX

LaTeX, BibTeX & FarsiTeX. Yasser Ganji Saffar ganji@ce.sharif.edu Computer Engineering Department Sharif University of Technology. Outline. LaTeX Bibliographies & BibTeX TeX tools IEEEtran FarsiTeX. 1.1 Introduction to LaTeX. The history of TeX Donald Knuth , 1978

sitara
Download Presentation

LaTeX, BibTeX & FarsiTeX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LaTeX, BibTeX & FarsiTeX Yasser Ganji Saffar ganji@ce.sharif.edu Computer Engineering Department Sharif University of Technology

  2. Outline • LaTeX • Bibliographies & BibTeX • TeX tools • IEEEtran • FarsiTeX

  3. 1.1 Introduction to LaTeX • The history of TeX • Donald Knuth,1978 • Everyone could easily use to typeset documents, particularly those that include formulae. • Made it freely available. • The history of LaTeX • Leslie Lamport, wrote a variant of TeX called LaTeX. • Focuses on document structure rather than TeX small details • Strong when working with mathematical symbols • Currently it is the standard of typesetting.

  4. 1.1 Introduction to LaTeX (contd.) • LaTeX is not a WYSIWYG word processor! • not to worry too much about the appearance • but to concentrate on getting the right content. • For example: • You only need to mention that a statement is the title of the document. • You don’t need to mention the font, size,… for title.

  5. 1.2 Documents Components • Every LaTeX document must contain the following three components: • \documentclass{article} • \begin{document} • \end{document} • In Latex commands generally: • required information is included in braces {} • optional information is included in square brackets [].

  6. An Example \documentclass[a4paper,11pt]{article} \begin{document} This is a simple latex file. \end{document}

  7. Document Classes & Options • Classes: • article • report • book • slides • Options: • 10pt, 11pt, 12pt • a4paper, letterpaper,… • onecolumn, twocolumn

  8. 1.3 Error Messages • Since LaTeX will stop after any \end{document} command, a good strategy is to insert \end{document} temporarily to see if the error is above its location.

  9. 1.4 Verbatim Environment • Maybe, you have to type LaTeX commands as part of your text. • Surround any text that you want printed as is with a \begin{verbatim} and an \end{verbatim} command. • For example: \begin{verbatim} #include <stdio.h> int main() { return 0; } \end{verbatim}

  10. Document Structure • Page Numbering and Headings • Creating a Title Page • Sections • Cross-References • Table of Contents • Abstracts • Footnote

  11. 2.1 Page Numbering and Headings • The command \pagestyle controls page numbering and headings. It can take the following forms: • \pagestyle{plain} • Just a page number • \pagestyle{empty} • Produces empty heads and feet - no page numbers . • \pagestyle{headings} • Prints the chapter or section name, and the page number in the heading and footer would be empty • \pagestyle{myheadings} • You specify what is to go in the heading with the \markboth or the \markright commands • These commands can also be applied to a single page using \thispagestyle instead of \pagestyle.

  12. 2.2 Creating a Title Page \documentclass{article} \title{some title} \author{some name} \date{some date} \begin{document} \maketitle

  13. 2.3 Sections • There are two related commands for creating sections: • \section{sectiontitle} • \section*{sectiontitle} • They provide information to LaTeX in case you want to create a Table of Contents. • \subsection{title} • \subsubsection{title}

  14. 2.4 Cross-References • Use \label{name} to label the point in your document with some mnemonic. • Section \ref{name} to refer to that point. • \ref{name} will be replaced by the number of the section containing the corresponding \label command. • You will need to run LaTeX twice to generate these references.

  15. 2.5 Table of Contents • If you have been using \section commands throughout your document, then LaTeX has all the information that it needs to construct one for you. • Place the command \tableofcontents after your \begin{document} command. • It may be necessary to run LaTeX twice on a document with a Table of Contents. • If you have question marks instead of page numbers in your Table of Contents, run LaTeX again.

  16. 2.6 Abstracts • To create an abstract, place your text in an abstract environment, i.e., between \begin{abstract} and \end{abstract} commands. • The abstract should come immediately after your \maketitle command, but before any \tableofcontents command.

  17. 2.7 Footnote • Using \footnote{your footnote message} For example: … in ICMP\footnote{Internet Control Message Protocol} …

  18. Mathematical Typesetting • Mathematical Formulas • Greek Letters • Exponents and Subscripts • Above and Below • Fractions • Functions • Sums, Integrals, and Limits • Roots • Text in Math Displays • Operators • Relations • Negated Symbols

  19. 3.1 Mathematical Formulas • There are two ways to insert mathematical formulas into your document with LaTeX: • Is to have it appear in a paragraph with text($). • Is to have them appear in a separate paragraph($$). • $\alpha$ is the first letter of the Greek alphabet. • $$ \frac{x^n-1}{x-1} = \sum_{k=0}^{n-1}x^k $$

  20. 3.2 Greek Letters

  21. 3.3 Exponents and Subscripts • Use the ^ character to create exponents: • If you have an exponent containing more than one character, group the exponent characters inside braces. $$ x^21 \ne x^{21} $$ • Similarly, subscripts are created using the underscore character. $$ x_21 \ne x_{21} $$

  22. \overline \overbrace \underline \underbrace $$ \left( \begin{array}{c} m+n\\ m \end{array} \right) = \frac{(m+n)!}{m!n!} = \frac {\overbrace{(m+n)(m+n-1)\cdots(n+1)}^\mbox{$m$ factors} {\underbrace{m(m-1)\cdots 1}_\mbox{$m$ factors}} $$ ${ while $\overline{x+\overline{y}} = \overline{x}+y$ 3.4 Above and Below

  23. 3.5 Fractions • Diagonal fraction bar: $a/b$ • Horizontal fraction bar: written as \frac{numerator}{denominator}. $$ \frac{a/b-c/d}{e/f-g/h} $$

  24. LaTeX uses italics in math mode. Roman (non-italic) for function names. Use a backslash in front of function names. Here is a list of function names: \arccos \arcsin \arctan \arg \cos \cosh \cot \coth \csc \deg \det \dim \exp \gcd \hom \inf \ker \lg \lim \liminf \limsup \ln \log \max \min \Pr \sec \sin \sinh \sup \tan \tanh 3.6 Functions

  25. 3.7 Sums, Integrals, and Limits • Summations and integrals both have lower and upper limits, and the commands are similar. • Limits usually have text with an arrow placed below them. • $$ \lim_{x\rightarrow 0} \frac{\sin x}{x} = 1 $$ • $$ \sum_{k=0}^\infty\frac{(-1)^k}{k+1} = \int_0^1\frac{dx}{1+x} $$

  26. 3.8 Roots • Use the \sqrt{} command to produce square roots: • $\sqrt{\frac{a}{b}}$ • If you need an nth root, use \sqrt[n]{} instead. • $\sqrt[10]{\frac{a}{b}}$

  27. 3.9 Text in Math Displays • Use the command \mbox{your text here} to include short phrases in a formula. $$ \int_0^{2\pi}\cos(mx)\,dx = 0 \hspace{1cm} \mbox{if and only if} \hspace{1cm} m\ne 0 $$

  28. 3.10 Operators

  29. 3.11 Relations

  30. 3.12 Negated Symbols

  31. Spacing • Spacing Between Words • Double Spacing • Horizontal & Vertical Spacing

  32. 4.1 Spacing Between Words • LaTeX controls the spacing of your document, trying hard to break lines in places that are pleasing to the eye. • one blank space = a million blank spaces. • Tabs are treated like blank spaces. • Blanks at the end of a line are ignored. • A single Enter is treated like a blank space. • More than one Enter marks the beginning of a new paragraph.

  33. 4.2 Double Spacing • There will be times when you will need to submit a draft that is double-spaced, to permit a grader or editor to make comments. • To double-space a paper, put this in your paper's body: \setlength{\baselineskip}{2\baselineskip}

  34. 4.3 Horizontal & Vertical Spacing • Use\hspace{length} for horizontal space. • Here the length must include a unit, such as 1.5in or 2.3cm. • Use \vspace{length} for vertical space.

  35. Accents and Font Style • Accents • Hyphenation • Quotation Marks • Changing the Appearance of Words • Size of Words

  36. 5.1 Accents • $\hat{a}, \dot{a}, \ddot{a}, \tilde{a}, \bar{a}, \vec{a}$ • LaTeX can also produce the following accents:

  37. 5.2 Hyphenation • There are four hyphens in LaTeX : • - (a single dash) is for hyphenating words. • -- (two dashes) is for ranges of numbers. • --- (three dashes) is for an honest-to-goodness dash between words. • $-$ is a minus sign in math mode. • For example: My cousin-in-law lived in Germany in 1995--6; he speaks French---really, he does. His favorite number is $-2$.

  38. 5.3 Quotation Marks • Use `` (usually on the left side of the keyboard) to begin a quotation • And ’’ (It is two ’ characters that is usually on the right side of the keyboard) to end a quotation. • For example, ``This is a quote’’.

  39. 5.4 Appearance of Words • Use\underline{phrase} to underline a phrase. • Use\textbf{phrase} or {\bf phrase} to print a phrase in boldface. • Use\emph{phrase} to italicize a phrase.

  40. 5.5 Size of Words • {\Huge Huge} • {\huge huge} • {\Large Large} • {\large large} • normal • {\small small}

  41. Tables & Arrays • Constructing Arrays • Constructing Tables

  42. 6.1 Constructing Arrays • Surround the entries with a \begin{array}{justification} command and an \end{array} command. • Separate column entries by an &. And end each line with a \\. • If your array is a matrix, you can surround it with large parentheses \left( and \right). • For example: • $$ • \left( • \begin{array}{rcl} • \alpha&\beta&\gamma\\ • \delta&\epsilon&\zeta\\ • \eta&\theta&\iota\\ • \end{array} • \right) • $$

  43. 6.2 Constructing Tables • For example: \begin{tabular}{|r|c|l|} \hline Right & Center & Left\\ \hline alpha & beta & gamma\\ delta & epsilon & zeta\\ eta & theta & iota\\ \hline \end{tabular}

  44. Multi-line Equations • Multi-line Equations • Dots • Indenting

  45. 7.1 Multi-line Equations • Surround the equations by \begin{eqnarray*} and \end{eqnarray*}. • Surround the equals sign or inequality with &'s, and end each line with \\. • No for $$ with this environment. For example, \begin{eqnarray*} 1+2+\ldots+n &=& \frac{1}{2}((1+2+\ldots+n)+(n+\ldots+2+1))\\ &=& \frac{1}{2}\underbrace{(n+1)+(n+1)+\ldots+(n+1)}_{\mbox{$n$ copies}}\\ &=& \frac{n(n+1)}{2}\\ \end{eqnarray*}

  46. 7.2 Dots • \cdots for center height dots. • \ddots for diagonal dots, which occur in matrices. • \ldots for lower height dots. • \vdots for vertical dots. For example: $$ \left( \begin{array}{ccc} a_{11}&\cdots&a_{1n}\\ \vdots&\ddots&\vdots\\ a_{m1}&\cdots&a_{mn} \end{array} \right) $$

  47. 7.3 Indenting • The default for a LaTeX document is to indent new paragraphs unless the paragraph follows a section heading. • If you want to change the indentation, use the \indent and \noindent commands respectively, at the beginning of the paragraph. • If you wish to choose the amount of indentation for some reason, then use the command: \setlength{\parindent}{size of indentation} • Since this is a command that affects the whole document, it should go in the preamble, between the \documentclass and \begin{document} commands.

  48. Text Formatting • Centering Text • Extended Quotation • Bulleted Lists • Numbered Lists • Filling a Line

  49. 8.1 Centering Text • By default, LaTeX will start all text at the left margin. • If you want to center a title, a table, etc., surround what you want centered with the commands: \begin{center} and \end{center}.

  50. 8.2 Extended Quotation • If you are going to include an extended quotation from another source, it is important to indicate the difference between the quotation and your words. • In LaTeX, surround the quotation with \begin{quote} and \end{quote}.

More Related