LATEX / LyX 101 - A Hands-on BYOL Workshop Adnan Masood - scis.nova.edu/~adnan adnan@nova.edu Adnan Masood works as a web architect / technical lead for a financial institution where he develops SOA based middle-tier architectures, distributed systems, and web-applications using Microsoft technologies. He is a Microsoft Certified Trainer holding several technical certifications, including MCPD (Enterprise Developer), MCSD .NET, and SCJP-II. Adnan is attributed and published in print media and on the Web; he is technical editor for upcoming "Microsoft Windows Server AppFabric Cookbook" and also taught Windows Communication Foundation (WCF) courses at the University of California at San Diego. Adnan regularly presents at local code camps and user groups. He is actively involved in the .NET community as cofounder and president of the of San Gabriel Valley .NET Developers group. Adnan holds a Masters degree in Computer Science; he is currently a doctoral student working towards PhD in Machine Learning; specifically interestingness measures in outliers using Bayesian Belief Networks. He also holds systems architecture certification from MIT and SOA Smarts certification from CMU. He can be reached via Adnan adnan@nova.edu or via blog.adnanmasood.com Lyx/Latex LaTeX is a document markup language (similar to HTML or XML) - The document source is written in a regular text file, with extension .tex - It is compiled to generate the document (dvi, ps or pdf) - It is mainly used in academia to write scientific papers, thesis, documents, etc - LaTeX is in charge of applying the desired format (the user only concentrates in the content) - It achieves professional typesetting quality Resources: blog.adnanmasood.com scis.nova.edu/~adnan Comprehensive TeX Archive Network (CTAN). automation and fun is the secret reason why developers love to use it. Objective of the presentation is for you to be able to learn how to use it. Give the presentaiton you want to attend.not an expert quirks in 1 1/2 hour practical advice and for all the hard questions about syntactical sugar can be redirected to dr seagull. =================================================== Word vs. LateX Let's face it, we like pain. There is a learning curve http://oestrem.com/thingstwice/2007/05/latex-vs-word-vs-writer/ =================================================== Installation for Windows - Download MiKTeX from http://miktex.org - Use the basic installer (the required packages will be downloaded on demand) =================================================== Hello World. \documentclass{article} \title{My First Latex Document} \author{Adnan Masood} \date{7/20/2012} \begin{document} \maketitle Hello NSU! \end{document}=================================================== Formatting - emphasis, heading, classes, figures =================================================== LyX is a document processor that encourages an approach to writing based on the structure of your documents (WYSIWYM) and not simply their appearance (WYSIWYG). LyX combines the power and flexibility of TeX/LaTeX with the ease of use of a graphical interface. This results in world-class support for creation of mathematical content (via a fully integrated equation editor) and structured documents like academic articles, theses, and books. In addition, staples of scientific authoring such as reference list and index creation come standard. But you can also use LyX to create a letter or a novel or a theatre play or film script. A broad array of ready, well-designed document layouts are built in. =================================================== \command[options]{argument} \section{Introduction} Comments: % This text is ignored by \LaTeX{} Escaping? To insert the \%" character into a document, escape it with a backslash: \%. =================================================== LaTeX terms: What is Preamble Everything before the line \begin{document} is part of the preamble. A typical preamble might look like this: \documentclass{article} \usepackage{graphicx} \usepackage{amsmath,amssymb} \title{Test} \author{Test} \date{\today} \documentclass{article} tells LATEX that the document is an article. Other classes include report, book, letter and slides \usepackage{graphicx} tells LATEX to use the graphicx package, which allows users to include many types of graphics in their documents. Packages are covered later on. The \usepackage{amsmath,amsfonts} command invokes packages from the American Mathematical Society that extent the functionality of LATEX \title{} and \author{} obviously define the title and author \date{\today} tells LATEX to use today's date. \date{July 2012} would print \July 2012" as the date. The \date{} without an argument would cause LATEX to leave the date blank. =================================================== The document body Everything after the preamble and between \begin{document} and \end{document} is part of the document body. Most of a LATEX document is simply plain text. To start a new paragraph, insert two carriage returns (one blank line). To force a line break, use \\. A document's structure is de ned using \section{} commands. LATEX is strongly based on well-structured documents. The structure tags include:  \section{Name}  \subsection{Name}  \subsubsection{Name}  \paragraph{Name} =================================================== Modifying Text Styles \textbf{bold text} not bold text\\ \textit{italic text} not italic text\\ \texttt{typewriter text} not typewriter text =================================================== equations Inline $a^2+b^2=c^2$ Offset An offset equation \begin{equation} a^2+b^2=c^2 \label{pythag} \end{equation} with equation number and label. Pythagorean theorem is given % by eqn.~\eqref{pythag}. ======================================================Tables \begin{table}[H] \caption{This table is an example. \label{exampleTable}} \begin{center} \begin{tabular}{|c|c|c|} \hline row 1, column 1 & row 1, column 2 & row 1, column 3 \\ \hline row 2, column 1 & row 2, column 2 & row 2, column 3 \\ row 3, column 1 & row 3, column 2 & row 3, column 3 \\ \hline \multicolumn{2}{|c|}{row 4, two columns} & row 4, column 4 \\ \hline \end{tabular} \end{center} \end{table} ====================================================== To insert a footnote, simply type \footnote{text here}. LATEX will automatically insert the footnote number and text. TOC \documentclasss[12pt,letterpaper]{article} % Preamble \begin{document} \tableofcontents \listoffigures \listoftables % Different sections, text, etc. \end{document} Bibliography \begin{thebibliography}{99} \bibitem{key1}H.B.~Phillips, \textit{Vector Analysis} (Wiley and% Sons, 1933), p. 206. % \bibitem{key2}P.M.~Morse and P.J. Rubenstein, Phys. Rev.% \textbf{54}, 895 (1938). % \bibitem{key3}J.A.~Stratton and L.J.~Chu, Phys. Rev. \textbf{56},% 99 (1939). \end{thebibliography} You must manually type the bibliography entries. To refer to an item within the text, use \cite{key}[1]. The {99} tells LATEX that there a maximum of 99 entries in the bibliography. LATEX needs to know this so it can correctly justify the bibliography entries with their numbering on the left. A more ecient way to create bibliographies is to use BibTeX, which allows you to maintain a database of citations and call them as needed in your bibliography. ======================================= Realworld Thesis and Organization Spliting into sections Insert Child document Insert Graphics =======================================