[ Pobierz całość w formacie PDF ]
//-->FIVE MINUTE GUIDEATO L TEXFIRST VERSIONTim van der HorstFrits Wenneker\howtoTEX{.com}This document is copyrighted by howtoTeX.com. Feel free to distribute, but keep a reference to howtoTeX.comand its original authors.ContentsA1 L TEX Basics1.1 Document structure1.1.1 Preamble . .1.1.2 Environments1.1.3 Sectioning . .1.2 Text formatting . . .1.3 Cross references . . ...........................................................................................................................................................................................11111112222334442 Typesetting content2.1 Equations . . . . . .2.1.1 Working with2.2 Figures . . . . . . .2.3 Tables . . . . . . . .2.4 Lists . . . . . . . . .. . .units. . .. . .. . .............................................................................................................................................3 Bibliography withBibTEX3.1 UsingBibTEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2 Adding bibliography items . . . . . . . . . . . . . . . . . . . . . . . . . . . .PrefaceThe title of this document says it all: this is afive minute guide toAL TEX, a way of typesetting documents that will save time and frustration.This guide is written to get you over the fairly steep learning curve. MoreAL TEX guides exist, but they all drown you in information. The contentof this guide will teach you enough to write proper documents.ABefore you can start, the L TEX system needs to be installed. A guide forWindows and Mac OS X is foundhere.To make life even easier, downloadAthisfolder structure to start L TEXing right away.May 27, 2012CHAPTER 1AL TEX BasicsATogether with this guide comes a pre-made folder structure for managing L TEX projects.The latest version is availablehere.It’s advised to open and play with it when followingthis guide.1.1 Document structureThree subfolders are present in the provided folder structure:docs, figsandrefs.Thedocsfolder contains the main content and the preamble. Section 1.1.1 explains the preamble,while the rest of this guide teaches about the main content of documents. Thefigsfolder isAthe root where all figures are placed. Implementing figures in L TEX is shown in section 2.2.Therefsfolder contains a file for the bibliography, explained in chapter 3.In order to compile your document, run themaster.texfile in the root of the folderstructure. In most LaTeX editors, the master file can be specified such that the documentcan also be compiled from the.texfiles in thedocsfolder.docs folderfigs folderrefs folder1.1.1 PreambleAA L TEX document is configured in the preamble. The\documentclass[]{}commanddefines thedocumentclass, where[]contains optional arguments such as font size. The classis chosen between{}.Standard classes arearticle, book, report, slides,andletter.documentclassExample 1Creating a report with 10pt font sizepackage\documentclass[10pt]{report}AThe preamble also calls requiredpackages: L TEX tools. In the provided preamble allnecessary packages are called, together with a brief explanation.1.1.2 EnvironmentsEnvironments contain special content, such as math, figures, tables, etc. Environmentsstart with\begin{}and end with\end{},where the environment name is between{}.Thedocumentenvironment is most important: all content within this environment will beprinted.1.1.3 SectioningA distinct part or subdivision of a writing is created with:\section{}, \subsection{},\subsubsection{}, \paragraph{},where{}contains the title. Thereportandbookclasses require an additional\chapter{}command.1.2 Text formattingText is formatted with:\textbf{}forbold,\textit{}foritalicand\underline{}forAunderlined text. As L TEX uses certain characters for its own purposes, a fewspecialcharactersshould be remembered:\&for &,\%for %,\$for $,\{ \}for { } and\#for #.A line break is created by either a double return or\\.A whole page is cleared with the\clearpagecommand.special characters1.3 Cross referencesACross referencing is one of the strong points of L TEX and can be done to all items thatcontain acounter.Alabelis added to the item with\label{},where the label nameis between{}.For example, this section is labeled with\label{sec:refs}and can bereferred to with\cref{sec:refs},which is printed as: section 1.3. The\cref{}commandis introduced by thecleverefpackage, which automatically determines the type of reference.labelreferenceAFive minute guide to L TEX|||1CHAPTER 2Typesetting content2.1 EquationsEquations and other mathematical expressions are created withinmathenvironments. Thereare two types of math environments: inline and display.Inline equationsare shown within the paragraph and are created by writing the equationbetween$and$.Example 2Creating an inline equationThe derivative ofx2is2xdisplay equationinline equationThe derivative of $x^2$ is $2x$Display equationsare used for larger equations, as they are shown in distinct paragraphs.Theamsmathpackage introduces thealignenvironment for display equations.Example 3Creating a display equationy=√\begin{align} \label{eq:example}y_{0} &= \frac{\sqrt{256}}{2} \\&= 2^{3} = 8 \nonumber\end{align}25623=2 =8(2.1)Subscriptscan be made with_{}andsuperscriptswith^{}.Use&to vertically align theequations and add\\to break a line. Alabelis added to the environment, such that a crossreference to equation (2.1) can be made with\cref{eq:example}.In order to suppressthe automatic equation numbering, use thealign*environment or add\nonumberto thedesired line.sub- and superscriptsuppress numbering2.1.1 Working with unitsThesiunitxpackage provides an easy way to work with (SI)units. This is done with\SI{}{},where the first{}contains the value and the second{}the unit. TheSIcommandcan be used both within and outside math environments.Example 4Working with units1Hz is equal to2πrad s−1SI units\SI{1}{\hertz} is equal to\SI{2\pi}{\radian\per\second}2.2 FiguresPlace figures in the providedfigsfolder. A figure is defined with afigureenvironment anditsplacementis determined by an optional argument between[]: [h]stands forhere,[b]forbottom,[t]fortopand[p]forseparate page.To insert a figure, use\includegraphics[]{},where[]contains the size and{}the filename. Center a figure with\centering.Also, alabelandcaptionshould be assigned.Example 5Inserting a figure namedlogo.pdffigs folderfigure placement\begin{figure}[h]\centering\includegraphics[width=30mm]{figs/logo}\caption{Caption example}\label{fig:logo}\end{figure}\howtoTEX{.com}Figure 2.1: Caption exampleAFive minute guide to L TEX|||22.3 TablesFor nice looking tables, thebooktabspackage is recommended. A table is placed within atableenvironment: first acaptionandlabelare defined, whereafter atabularenviron-ment follows. In the latter, the content of the table can be placed.Table rulesare createdwith\toprule, \midruleand\bottomrule.Example 6Creating a tabletable rule\begin{table}[h]\centering\caption{Table caption}\label{tb:table}\begin{tabular}{crl}\topruleName& Grade & Year\midruleJohn& 7.5& 2012\\Richard & 2& 2010\\\bottomrule\end{tabular}\end{table}Table 2.1: Table captionName\\Grade7.52Year20122010JohnRichardSimilar to figures,table placementcan be specified by[h], [t], [b]or[p].The argument{crl}behind\begin{tabular}determines thecolumn alignment: the first is centered withc,the second is right aligned withrand the last is left aligned withl.table placementcolumn alignment2.4 ListsIn order to make lists, a listing environment must be created. Theenumerateenvironmentcreatesnumbered lists.Example 7Creating a numbered list1. First entry2. Second entrybulleted listdescriptive listnumbered list\begin{enumerate}\item First entry\item Second entry\end{enumerate}Similar,bulleted lists(•) are created with theitemizeenvironment. It is possible to createnested lists by placing one listing environment into another.Descriptive listsare createdusing thedescriptionenvironment.Example 8Creating a descriptive listFirstentrySecondentry\begin{description}\item[First] entry\item[Second] entry\end{description}AFive minute guide to L TEX|||3 [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • asael.keep.pl