l t ex and mikt ex
play

L T EX and MiKT EX A Introduction Part 2 http://www.win.tue.nl/ - PowerPoint PPT Presentation

L T EX and MiKT EX A Introduction Part 2 http://www.win.tue.nl/ jknopper/latex/intro/ December 11, 2012 Jan Willem Knopper (jknopper@win.tue.nl) Contents 2/57 Tables 3 Including programming statements 15 WinEdt - Working with a


  1. L T EX and MiKT EX A Introduction Part 2 http://www.win.tue.nl/ ∼ jknopper/latex/intro/ December 11, 2012 Jan Willem Knopper (jknopper@win.tue.nl)

  2. Contents 2/57 Tables 3 Including programming statements 15 WinEdt - Working with a main file 18 Page Numbering 22 Multicolumn Text 24 Footnotes 25 Fonts 26 Non-standard headers and footers 28 Exercise 30 Mathematical formulas 31 Floats 42 Creating a master index 50 Slide shows and posters 52 / w December 11, 2012

  3. Tables 3/57 The environments array and tabular create tables and matrices. The usage of array is the same as for tabular, but it can only be used in math mode. \ begin {array}[pos]{cols} rows \ end {array} \ begin {tabular}[pos]{cols} rows \ end {tabular} The pos argument defines the vertical positioning for the table: t or b (top or bottom) / w December 11, 2012

  4. Tables 4/57 The cols argument defines the column formatting. The possible formatting symbols are: l the column contents are left justified r the column contents are right justified c the column contents are centered p{ width } the text in this column is set in a paragraph box of the specified width. | draws a vertical line || draws a double vertical line / w December 11, 2012

  5. Tables 5/57 The rows contain the actual entries. Each row is terminated with the \\ com- mand. The column entries are separated by a & symbol. / w December 11, 2012

  6. Tables 5/57 The rows contain the actual entries. Each row is terminated with the \\ com- mand. The column entries are separated by a & symbol. The command \ hline draws a horizontal line over the full width. The command \ cline {m-n} draws a horizontal line from the left of column m to the right of column n . / w December 11, 2012

  7. Tables 5/57 The rows contain the actual entries. Each row is terminated with the \\ com- mand. The column entries are separated by a & symbol. The command \ hline draws a horizontal line over the full width. The command \ cline {m-n} draws a horizontal line from the left of column m to the right of column n . The command \ multicolumn {n}{col}{text} creates a table cell that extends n columns. The column formatting for this cell is defined by col. / w December 11, 2012

  8. Tables 6/57 Example 1 Stand Eredivisie 26 maart 2008 P W D L Pts +/- 1 PSV 30 19 7 4 64 61 - 23 2 Ajax 30 16 9 5 57 79 - 40 3 sc Heerenveen 30 16 6 8 54 76 - 38 4 Feyenoord 30 16 6 8 54 56 - 34 5 NAC Breda 30 16 6 8 54 41 - 35 6 FC Twente 30 14 10 6 52 47 - 31 7 FC Groningen 30 15 5 10 50 50 - 48 8 Roda JC 30 11 10 9 43 51 - 49 9 FC Utrecht 30 12 6 12 42 56 - 50 10 Vitesse 30 11 7 12 40 42 - 51 11 NEC 30 11 6 13 39 43 - 49 12 AZ 30 8 9 13 33 41 - 49 13 Heracles Almelo 30 8 7 15 31 33 - 56 14 Sparta Rotterdam 30 8 6 16 30 46 - 68 15 De Graafschap 30 7 7 16 28 30 - 55 16 Willem II 30 7 6 17 27 33 - 41 17 VVV-Venlo 30 6 8 16 26 37 - 67 18 Excelsior 30 6 5 19 23 29 - 67 / w December 11, 2012

  9. Tables 7/57 Example 1 \ begin {tabular}{|l|l|cccc|r|c|} \ hline \ multicolumn {8}{|c|}{Eredivisie 26 maart 2008} \\ \ hline & & P & W & D & L & Pts & +/- \\ \ hline 1 & PSV & 30 & 19 & 7 & 4 & 64 & 61 - 23 \\ 2 & Ajax & 30 & 16 & 9 & 5 & 57 & 79 - 40 \\ ... 18 & Excelsior & 30 & 6 & 5 & 19 & 23 & 29 - 67 \\ \ hline \ end {tabular} / w December 11, 2012

  10. Tables 8/57 Example 2 Model Description Price FBD 360 € 999.00 Desktop : XP3600+ Processor, 512 MB DDR- RAM, 80 GB Hard disk, 16x DVD drive, 32x CDRW drive, 64 MB TV output, Windows XP, 15" monitor FBD 480 € 1399.00 Desktop DeLuxe : Same as FBD 360 but with XP4800+ Processor, 48x CDRW drive, 17" mon- itor / w December 11, 2012

  11. Tables 9/57 Example 2 \ begin {tabular}{lp{0.5\ textwidth }r} \ bfseries Model & \ bfseries Description & \ bfseries Price \\[1ex] FBD 360 & \ small \ textbf {Desktop}: XP3600+ Processor, 512~MB DDR-RAM, 80~GB Hard disk, 16x DVD drive, 32x CDRW drive, 64~MB TV output, Windows~XP, 15" monitor & \ EUR {} 999.00 \\ FBD 480 & \ small \ textbf {Desktop DeLuxe}: Same as FBD 360 but with XP4800+ Processor, 48x CDRW drive, 17" monitor & \ EUR {} 1399.00 \\ \ end {tabular} / w December 11, 2012

  12. Tables 10/57 WinEdt has a useful plug-in to insert tables: / w December 11, 2012

  13. Tables 11/57 WinEdt has a useful plug-in to insert tables: / w December 11, 2012

  14. Tables 12/57 WinEdt has a useful plug-in to insert tables: / w December 11, 2012

  15. Tables 13/57 WinEdt has a useful plug-in to insert tables: / w December 11, 2012

  16. Tables 14/57 Excel to L A T EX Add-In 1. download the Excel macro: Excel2LaTeX.xla 2. Start Excel and install the Add-in: • Click on the Office button (in the upper left corner) • Excel Options • Add-Ins • Go... • Browse... • Browse for the Add-In and click Ok 3. Restart Excel 4. A button has been added to the Add-Ins tab: 5. Create a table in Excel, select the table and press this button. 6. Copy-paste to WinEdt / w December 11, 2012

  17. Including programming statements 15/57 The package listings formats listings. It defines the following commands: • \ lstlisting {...} for inline programming statements. • \ begin {lstlisting} ... \ end {lstlisting} for multi-line list- ings. • \ lstinputlisting {filename} imports a complete source file / w December 11, 2012

  18. Including programming statements 16/57 Customizing listings Using the command \ lstset you can customize the language and appear- ance of the listing: \ lstset { language=Java, basicstyle=\ color {black}\ ttfamily , commentstyle=\ color {green}\ itshape \ ttfamily , keywordstyle=\ color {blue}\ bfseries \ ttfamily , showstringspaces=false, frame=single, % boxed listings backgroundcolor=\ color {white} } Supported languages: too many to mention. Included are Basic, C, C++, Del- phi, Fortran, HTML, Java, Mathematica, Matlab, Pascal, Perl, PHP, SAS, SQL, TeX, VBScript, XML. / w December 11, 2012

  19. Including programming statements 17/57 Customizing listings Alternatively, you can specify options like this: \definecolor{myyellow}{rgb}{1.00,1.00,0.50} \begin{lstlisting}[language=Pascal, backgroundcolor=\color{myyellow}] readln(N); for i := 1 to N do begin writeln(random) end \end{lstlisting} / w December 11, 2012

  20. Including programming statements 17/57 Customizing listings Alternatively, you can specify options like this: \definecolor{myyellow}{rgb}{1.00,1.00,0.50} \begin{lstlisting}[language=Pascal, backgroundcolor=\color{myyellow}] readln(N); for i := 1 to N do begin writeln(random) end \end{lstlisting} readln (N); for i := 1 to N do begin writeln (random) end / w December 11, 2012

  21. WinEdt - Working with a main file 18/57 In bigger documents one often has one main file which includes several sub- documents: \ input chapter1 etc.. WinEdt has special functionality to deal with this document structure: declares the current file as main file. This means that the programs latex, yap, dvips, gsview, pdflatex operate on this main file, even if another document is opened in WinEdt. does not consider the current file as main file anymore. The file that is currently open will be L A T EXed. displays the project tree (main file, input files, table of contents, bibliog- raphy and labels. You can click on files in this tree to open them. / w December 11, 2012

  22. WinEdt - Working with a main file 19/57 / w December 11, 2012

  23. WinEdt - Working with a main file 20/57 / w December 11, 2012

  24. Table of Contents 21/57 The table of contents is generated and printed with the command \ tableofcontents (normally after title page and abstract). All entries are created automatically, based on the sectioning commands. You have to run latex twice to get all references right! It is recommended to use the texify command. / w December 11, 2012

  25. Table of Contents 21/57 The table of contents is generated and printed with the command \ tableofcontents (normally after title page and abstract). All entries are created automatically, based on the sectioning commands. You have to run latex twice to get all references right! It is recommended to use the texify command. To create additional entries manually, use the command: \ addcontentsline {toc}{section type}{entry text} \ appendix \ addcontentsline {toc}{chapter}{\ noindent Appendix} \ chapter {Source code} / w December 11, 2012

  26. Table of Contents 21/57 The table of contents is generated and printed with the command \ tableofcontents (normally after title page and abstract). All entries are created automatically, based on the sectioning commands. You have to run latex twice to get all references right! It is recommended to use the texify command. To create additional entries manually, use the command: \ addcontentsline {toc}{section type}{entry text} \ appendix \ addcontentsline {toc}{chapter}{\ noindent Appendix} \ chapter {Source code} Depth of TOC entries (do not include subsubsections): \ setcounter {tocdepth}{2} / w December 11, 2012

  27. Page Numbering 22/57 You can set the page number manually: \ setcounter {page}{14} / w December 11, 2012

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend