FOR BEGINNERS 2 Day Workshop on Research Methodology & Technical Writing
Total Page:16
File Type:pdf, Size:1020Kb
2 Day Workshop on Research Methodology & Technical Writing FOR BEGINNERS Chandra Prakash Assistant Professor IGDTUW, Delhi Index • – Introduction • Why you should learn LaTeX ? • Nuts and Bolts of LaTeX – Structure – Format – Equations – Table and Figure – Reference • Examples 2 Common Scenario in Research • As a Researcher you need to write a scientific Paper/Thesis and publish your research work • Each publishing firm (IEEE, Springer etc.) has its own layout. • If not selected in one firm, send it to other. – One way :- Rewrite it again as per new format – Other way :- If you write it in Latex you only need to change the style file to set it into their format. • There is no need for a complete rewrite Introduction • LaTeX is a typesetting systems (scripting language) suitable for producing high quality scientific and mathematical documents – Enables authors to typeset and print their work at the highest typographical quality. – Pronounced as “Lay-tech”. – Uses TeX formatter as its typesetting engine. • TeX is a program written by Donald Kunth in 70’s for typesetting text and mathematical formulas TeX LaTeX Identify Which One is Good in Look ?? 5 Latex vs. Word Processors • Standard processors (M.S. Word, Open office) are of the WYSIWYG type, that is, what you see is what you get. Instead, LATEX is considered as WYSIWYM, what you see is what you mean. • High typeset quality Word J[x(),u()] F(x(t),u(t),t)dt LaTeX t0 • Easy to include math formulas • Source file format is not bounded to a particular OS or platform • Portability (Windows, Unix, Mac) • Latex implementations exists for all platforms (DOS, Windows, Unix, Mac ..) • Free Vs Paid Again Which One is Latex Draft ??? 7 Why to use it • Considered as De facto standard for scientific publishing • Reuse already written up material • Almost all good journals/conferences have their LaTeX styles (just download and use them). • Meaning based structuring (rather than appearance) • Few bugs as compared to other drafting tools • Easy to draft large documents • Final reason: Most likely, you will be forced to use it, since it is the fist choice of every good Researcher Disadvantages of using LaTeX • It can be a bit overwhelming at first • Fairly steep learning curve – Learning how to use it takes time • Customizing is tedious. – Layout changes are difficult (i.e., will require time for you to hunt down solution and implement it) Installation: What do I need to use LATEX Two different components to be installed : • A LATEX editor and • MiKTeX. • Download and install MikTeX LaTeX package http://www.miktex.org/ • Install Foxit Reader/Acrobat Reader • Install Editor — Tex Studio — Texmaker Online Editor: — WinEdt http://www.winedt.com/ https://www.sharelatex.com/ — TexnicCenter https://www.overleaf.com/ http://www.texniccenter.org/ — TeXworks — Emacs, vi, etc. TexStudio 11 To run and compile Tex file Texmaker 12 Basic steps to Use LaTeX to Create Documents • Start with a skeleton document • Create it by yourself, • Get it from you colleagues, • Download it from journals’website • Fill stuff into your skeleton document • Text, formula, figure, table … • Run LaTeX to generate output and make modifications • Learn as you go – via online — Comprehensive latex tutorial http://www.latex-tutorial.com/tutorials/ — Beginning LaTeX http://www.cs.cornell.edu/Info/Misc/LaTeX-Tutorial/LaTeX-Home.html Output Formats .dvi Device Independent .ps Post Script .pdf PDF .rtf Rich Text Format .html HTML .xml XML 1 Process to Create Document Using LaTeX TeX input file Your source LaTeX file.tex document Run LaTeX program DVI file Device independent output file.dvi Run Device Driver Unix Commands Out input file > latex file.tex runs latex file.ps or file.pdf > xdiv file.dvi previewer > dvips file.dvi creates .ps > pdflatex file.tex creates .pdf directly Latex File Structure • Document Class Predefined Formats (article, report, book,..). \documentclass[options]{class} options = a4paper, 11pt, 12pt, 10pt, twocolumn, landscape,... class = article, report, book,... • Packages used Added Functionality (graphics, reference style,...). \usepackage{package name} Eg: epsfig = insert PS pictures into the document fancyhdr = easy definition of footer and header • Main Body Text and Bibliography References. Basic Structure of LaTeX Document \documentclass[options]{class} Define the types of the document \documentclass [12pt]{article} (article, book, thesis, letter …) \usepackage {color} Preamble. Incorporate packages or \usepackage {graphicx} define macros here \begin{document} \part{...} \section{Section Title} \subsection{ Title} Main body, stuff to be printed, title, \subsubsection{Title} authors, abstract, sections, \paragraph{...} references, …. \subparagraph{...} \end{document} Body of Text • Start with \begin{document} • End with \end{document} • Typesetting Text – \\ or \newline and \newpage – Comment or Quotations % – Bold \textbf{……………} or \bf – Italics \emph{…………} or \textit{………} or \it – Underline \underline{…………} or \ul Format • Sections – \section{…} 1. Latex is Great – \subsection{…} 1.1 Why Latex is Great – \subsubsection{…} 1.1.1 Reason One – \appendix - Changes numbering scheme – \chapter{…} - To be used with book and report document classes • Titles, Authors and others – \title{…} – \author{…} – \footnote{footnote-text} Format Contd. • \maketitle - Display Title and Author • \tableofcontents - Generates TOC • \listoftables - Generates List of Tables • \listoffigures -Generates List of Figures • Labels – \label{marker} - Marker in document. – \pageref{marker} - Displays page no. of marker. – \ref{marker} - Displays section location of marker. • Itemize – Use either enumerate, itemize or description. Body of Text cont… • Including Multiple Files – \input{filename.tex} • Modify main.tex to include chapters \documentclass{report} \title{Assignment 1 for ICT} \author{Prakash} \begin{document} \maketitle \tableofcontents \include{chapter_1} \include{chapter_2} \include{chapter_3} \end{document} Lists • Source \begin{itemize} \item Apple \item Orange \end{itemize} – Apple – Orange • Enumerate instead of itemize gives a numbered list • Lists can be recursive Environment • Something between – \begin{environment-name} – \end{environment-name} • Many command, for example \bf affect the text until the end of environment • Environments can be recursive • Examples: – Enumerate, itemize, description – Abstract- It is normally placed just after the \maketitle command. • \begin{abstract} • ... • \end{abstract} Standard Environments \begin{env_name} stuff Environment name (env_name) can be \end{env_name} document, itemize, enumerate, tabular, etc. \begin{itemize} \item The first item \item The second item \end{itemize} \begin{enumerate} \item The first item \item The second item \end{enumerate} Group • Group is some text between { and } • Many commands work until the end of the group • Code – put {one word \bf in bold} here • Result – put one word in bold here Alignment • Environments center, flushleft, flushright • Example – \begin{flushright} – Right aligned – \end{flushright} • Result Right aligned Font size \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge Formulas: How to insert Math • In order to insert formulas in the main text, we need the operator ($). • Use \( … \) for in-line and \[ … \] for displaying math formulas • Spaces inside \( … \) and \[ … \] are ignored. If needed, use “\ ” to add space • Use \mbox{…} for words inside math formulas Mathematics Greek Symbols \alpha, \beta, \gamma Superscript, Subscript x^y x_y x_y^z Calculus \int_0^\infty \int{\int} \frac{\partial u}{\partial x} x = \frac{-b \pm \sqrt{b^2-4ac} } {2a} Some more Math \begin{center} {\large $$ y=\frac{a^3+2c_{x}}{1+\sqrt{b_{x}}} $$ \\ \vspace{0.2in} $$ Q=\sum_{i=1}^{j}\int_{\mu}^{\infty} f(x_{j})dx $$ \\ \vspace{0.2in} $$ \Psi = \oint_{- \infty}^{\infty}f_{xy} ({\frac{\partial Qx}{\partial Qy}})^{\Im_{\pi}^ \prime} $$ \\ } Floating Objects • Floating objects can stop splitting of tables and images over pages. • Figures & Tables cannot be broken between pages • They are “floated” Options (recommendations) h (here) - place at same location \begin{table}[options] t (top) - place at top of page \end{table} b (bottom) - place at bottom of page p (page) - place at on an extra page \begin{figure}[options] ! (override) - will force the specified \end{figure} location H - Places the float at precisely the • They will now appear in the location in the LATEX code. – \listoffigures Requires the float package. This is somewhat equivalent to h!. • List of Figures (LOF) – List of Tables (LOT). Table environment • The syntax for creating a table object is the following \begin{table}[position ] \label{tab1} \caption{table-caption } \begin{tabular} ... \end{tabular} \end{table} 32 Tabular Two Columns • Columns l = automatically adjust – \begin{tabular}{|…|…|} size, left justify – \end{tabular} r = automatically adjust size, right justify • Rows p = set size e.g p{4.7cm} – & - Split text into columns c = centre text – \\ - End a row – \hline - Draw line under row – e.g. 123123 & 34.00\\ \hline Example of table \begin{tabular}{l|c|c} \hline \multicolumn{3}{c}{Gender separation} \\ \hline & Female & Male \\ \hline Faculty & 0 & 12 \\ Research fellows & 1 & 1 \\ Ph.D & 1 & 9 \\ \hline \end{tabular} \ Example of Figure/Image You can insert figures in pdf, jpg, eps, and other formats into your document. \begin{figure}[position ] \centering \includegraphics[options ]{filename } \caption{caption-text } ... \end{figure}