1 / 104

Prepare scientific documents

Learn about LaTeX, a powerful typesetting system for scientific papers with high-quality output & easy math formula typing. Discover its advantages, use cases, and practical tips for creating professional documents.

heidif
Download Presentation

Prepare scientific documents

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. Prepare scientific documents Dr Ahmed Jedidi April 2018

  2. What are TeX and LaTeX? • LaTeX is a typesetting systems suitable for producing scientific and mathematical documents • LaTeX enables authors to typeset and print their work at the highest typographical quality. • LaTeX is pronounced “Lay-tech”. • LaTeX uses TeX formatter as its typesetting engine.

  3. Why Use LaTeX? Word • High quality • Easy to use, especially for typing mathematical formulas • Portability (Windows, Unix, Mac) • Most journals have their LaTeX styles (just download and use them). • Final reason: most likely, you will be forced to use it, since everyone else around you is using it. LaTeX

  4. Some advantages of • concentrate on content before appearance; • mathematical formulae easily described: • freely available for all popular platforms; • output comparable (equivalent) to that of published books; • various tools available eg .

  5. Your favourite text editor acrobat yap dvi2pdf doc.dvi latex doc.tex Text file with embedded instructions doc.tex Device independent document description doc.dvi PDF document description doc.pdf Some other printer format (eg postscript)

  6. Your favourite text editor acrobat Text file with embedded instructions doc.tex PDF document description doc.pdf pdftex doc.tex

  7. What to Download • Download and install MikTeX http://www.miktex.org/ • Install Ghostscript and Gsview http://pages.cs.wisc.edu/~ghost/ • Install Acrobat Reader • Install Editor • WinEdt http://www.winedt.com/ • TexnicCenter http://www.texniccenter.org/ • Emacs, vi, etc. LaTeX package PS device driver … For MAC Users TeXShop iTexMac Texmaker …

  8. ‘Coding’ Basics • .commands start with a backslash \ • Parameters are given in curly brackets { } • Environments (blocks with a certain type of content) are of the form: \begin{environment_type} environment content \end{environment_type}

  9. The Simplest Document \documentclass{report} \begin{document} \end{document}

  10. The Simplest Document \documentclass{report} \begin{document} \end{document} This specifies the type of the document: report, book, article, letter, etc.

  11. The Simplest Document \documentclass{report} \begin{document} \end{document} The way the document is formatted is deduced through its class

  12. The Simplest Document \documentclass{report} \begin{document} \end{document} Anything within the document environment is typeset as output

  13. Hello World! \documentclass{report} \begin{document} Hello World! Bye! \end{document}

  14. Hello World! \documentclass{report} \begin{document} Hello World! Bye! \end{document}

  15. Hello World! • Newlines in the source are ignored. • Skipping a line in the source starts a new paragraph \documentclass{report} \begin{document} Hello World! Bye! \end{document}

  16. Commonly Used Symbols

  17. Excuse my French \documentclass{report} \begin{document} He said ``She said `H\’{e}ll\^{o}, j’adore \LaTeX!’ ’’ She was French, you see \ldots \end{document}

  18. Excuse my French \documentclass{report} \begin{document} He said ``She said `H\’{e}ll\^{o}, j’adore \LaTeX!’ ’’ She was French, you see \ldots \end{document}

  19. Useful Document Classes • Article: Ideal for a short paper (divided into sections, subsections, etc). Typeset to be printed double-sided. • Book: Class to be used to typeset a book (chapters, sections, etc). Typeset to be printed double-sided. • Report: (Almost) identical to the book class but for single-sided printing. • Other classes include letter, slides, etc.

  20. Organising a Document • A document is split into logical parts: • A title • An abstract • A number of parts • A number of chapters in each part • A number of sections in each chapter • A number of subsections in each section • A number of subsubsections in each subsection • Availability of a logical part depends on the document class (eg no chapters in a paper). • Typesetting of the sections may vary depending on document class.

  21. The Title \documentclass{article} \begin{document} \title{\LaTeX: Fun with Text} \author{Cikku Flieles} \date{31st February 2000} \maketitle \end{document}

  22. The Title \documentclass{article} \begin{document} \title{\LaTeX: Fun with Text} \author{Cikku Flieles} \date{31st February 2000} \maketitle \end{document}

  23. The Abstract • Available in article and report class. • Used to give an overview of the content of the document. • Is usually typeset with wider margins than the main text. • Specified using the abstract environment: \begin{abstract} … \end{abstract}

  24. Logical Sections • To start a named part, chapter, section, subsection or subsubsection use the command: \section_type{section name} where section_type is one ofpart, chapter, section, subsection and subsubsection. • This will automatically create the title and numbering of the section. • Any text after the command will appear inside the section named. • Parts and chapters are only available in the report and book class.

  25. Logical Sections \documentclass{report} \begin{document} \chapter{Basics} \section{First of all \ldots} Initially, we think. \subsection{Sit Down} Find a chair and sit down. \subsection{Think} Think about the chair. \end{document}

  26. Logical Sections \documentclass{report} \begin{document} \chapter{Basics} \section{First of all \ldots} Initially, we think. \subsection{Sit Down} Find a chair and sit down. \subsection{Think} Think about the chair. \end{document}

  27. Figures and Tables • The figure environment is used to include a floating figure in the text. • Similarly the table environment can be used to insert a floating table. • A caption can be added to both using the \caption{} command. • The two environments are identical except for the caption title, and whether they appear in a list of figures, or the list of tables.

  28. Figures and Tables • The figure environment is used to include a floating figure in the text. • Similarly the table environment can be used to insert a floating table. • A caption can be added to both using the \caption{} command. • The two environments are identical except for the caption title, and whether they appear in a list of figures, or the list of tables. Floating objects do not have a fixed position in the body of the text, but may be moved around by to improve the layout

  29. Figures and Tables \begin{figure} Here include whatever you want in the figure. \caption{A demo figure} \end{figure} Any other text \ldots \begin{table} Here include whatever you want in the table. \caption{A demo table} \table} Note that the figures and tables may move \ldots

  30. Figures and Tables \begin{figure} Here include whatever you want in the figure. \caption{A demo figure} \end{figure} Any other text \ldots \begin{table} Here include whatever you want in the table. \caption{A demo table} \table} Note that the figures and tables may move \ldots

  31. Figures and Tables \begin{figure} Here include whatever you want in the figure. \caption{A demo figure} \end{figure} Any other text \ldots \begin{table} Here include whatever you want in the table. \caption{A demo table} \table} Note that the figures and tables may move \ldots keeps count of the figure and table numbering automatically.

  32. Figures and Tables \begin{figure} Here include whatever you want in the figure. \caption{A demo figure} \end{figure} Any other text \ldots \begin{table} Here include whatever you want in the table. \caption{A demo table} \table} Note that the figures and tables may move \ldots If puts the figures and tables in strange positions there are ways of giving it suggestions. Check a book on for more details.

  33. Tables of Contents • To add a table of contents, with parts, chapters, sections, etc use the command \tableofcontents. • You may also include a list of figures and a list of tables using \listoffigures and \listoftables.

  34. Tables of Contents \title{A Quick \LaTeX\ Primer} \author{Gordon J. Pace} \date{} \maketitle \tableofcontents

  35. Tables of Contents \title{A Quick \LaTeX\ Primer} \author{Gordon J. Pace} \date{} \maketitle \tableofcontents

  36. Tables of Contents CAUTION . creates an auxiliary file with all page numbers when run through a file. Run twice to ensure that they match \title{A Quick \LaTeX\ Primer} \author{Gordon J. Pace} \date{} \maketitle \tableofcontents

  37. Cross References • Quite regularly, you will want to refer to section 4.2.1.4 from section 7.6.4.2. • But when you add a section before section 4.2, you will have to revise the numbering… • provides a way of naming sections, chapters, figures and tables to allow references updated automatically.

  38. Cross References • Use \label{label name} to name a numbered object (figure, section, chapter, etc). It may appear within the \caption, \section, etc parameter or just after it. • Use \ref{label name} to insert the number of the object named using \label command. • Use \pageref{label name} to insert the page number where the named object appears. • References may be forward or backward ones.

  39. Cross References \section{Introduction} ... more details can be found in section \ref{s:proof} (in particular look at figure \ref{f:proof} on page \pageref{f:proof})... \section{Proofs and Roofs} ... \subsection{Proof \label{s:proof}} \begin{figure} ... \caption{Proof outline \label{f:proof}} \end{figure} ...

  40. Cross References \section{Introduction} ... more details can be found in section \ref{s:proof} (in particular look at figure \ref{f:proof} on page \pageref{f:proof})... \section{Proofs and Roofs} ... \subsection{Proof \label{s:proof}} \begin{figure} ... \caption{Proof outline \label{f:proof}} \end{figure} ...

  41. Cross References Using labels starting with f: (for figures), s: (for sections), c: (for chapters) is not obligatory but will help you remember. \section{Introduction} ... more details can be found in section \ref{s:proof} (in particular look at figure \ref{f:proof} on page \pageref{f:proof})... \section{Proofs and Roofs} ... \subsection{Proof \label{s:proof}} \begin{figure} ... \caption{Proof outline \label{f:proof}} \end{figure} ...

  42. CAUTION As with tables of contents, uses an auxiliary file with all references. Run twice to ensure that references match Cross References \section{Introduction} ... more details can be found in section \ref{s:proof} (in particular look at figure \ref{f:proof} on page \pageref{f:proof})... \section{Proofs and Roofs} ... \subsection{Proof \label{s:proof}} \begin{figure} ... \caption{Proof outline \label{f:proof}} \end{figure} ...

  43. Organising a Large Document • Writing a large document can make access to different parts unwieldy. • has two commands to import files from one another: \input{file}, \include{file}. • Both include the text in the file given as parameter as-is into the main document. • They are identical except that \include starts a new page automatically.

  44. Organising a Large Document • Writing a large document can make access to different parts unwieldy. • has two commands to import files from one another: \input{file}, \include{file}. • Both include the text in the file given as parameter as-is into the main document. • They are identical except that \include starts a new page automatically. Note that the although the files are assumed to be files, the .tex extension is left out.

  45. Typical Document Organisation main.tex % Document: FYP Chicken-Sort % Date: 1/9/2005 % Author: Cikku Flieles \documentstyle{report} \begin{document} \input{frontpage} % short introduction \input{introduction} % The algorithm \input{algorithm} % Correctness proof \input{proof} % Conclusions \input{conclusions} \end{document}

  46. Typical Document Organisation proof.tex main.tex \chapter{The Proof of Correctness} \section{Proof Outline} We prove the correctness of chicken sort using a technique based on the Socratic method of discourse. Let us start by assuming that Plato knew about this proof... % Document: FYP Chicken-Sort % Date: 1/9/2005 % Author: Cikku Flieles \documentstyle{report} \begin{document} \input{frontpage} % short introduction \input{introduction} % The algorithm \input{algorithm} % Correctness proof \input{proof} % Conclusions \input{conclusions} \end{document}

  47. Images • Images can be added anywhere in a document (not just as a figure) • To include an image, use the command \includegraphics{filename} • Various formats are allowed, including gif, jpg, pdf (when using pdftex), etc.

  48. Resizing Images • Images can be resized using the \resizebox{width}{height} {object to resize} • Width and height can be set in various units: cm, mm, in, textwidth (the size of the page less the margins). • Use ! as the width or height to scale it according to the other given size.

  49. Il-Ahwa x’Figure! \begin{figure} \resizebox{0.8textwidth}{!} {\includegraphics{girlinlatex.gif}} \caption{Il-Ahwa x’Figure} \end{figure}

More Related