location: Diff for "LaTeX"

Institute of Mathematics - PublicMathWiki:

Differences between revisions 73 and 165 (spanning 92 versions)
Revision 73 as of 2012-12-27 11:46:06
Size: 11248
Editor: crose
Comment:
Revision 165 as of 2021-02-04 10:06:06
Size: 12918
Editor: eseide
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
 <<TableOfContents>>  . <<TableOfContents>>
Line 9: Line 9:
 * A short introduction to LaTeX (in German): http://developer.kde.org/~kdvi/DVI/l2kurz.dvi
 * A short introduction to LaTeX: https://tobi.oetiker.ch/lshort/lshort.pdf
  * Based on the original German edition found here: http://www.ctan.org/tex-archive/info/lshort/german
Line 14: Line 14:
If you are working with the I-MATH SunRay Terminals, you can right away use the templates for letters and presentations provided below. The UZH offers LaTeX templates with official corporate design. Below you can find versions of these templates adapted for the Institute of Mathematics.
Line 17: Line 17:

The official LaTeX templates for correspondence are located at `/scratch/templates/latex/korrespondenz/`.

Copy the desired template to your home directory (see below for a preview of each template), or any other suitable location (Do not edit the files in `/scratch/templates/latex/korrespondenz/`) and edit it with your favorite LaTeX editor.
The UZH Letter style is based on the KOMA Letter package. '''Documentation''': http://www.ctan.org/pkg/scrlttr2
Line 25: Line 21:
Preview of templates: Direct downloads of the letter templates:
Line 36: Line 32:
The official LaTeX templates for correspondence are located at `/scratch/templates/latex/praesentation/`.

Copy the desired template to your home directory (see below for a preview of each template), or any other suitable location (
Do not edit the files in `/scratch/templates/latex/praesentation/`) and edit it with your favorite LaTeX editor.

 * UZH Praesentation deutsch (informell) ([[https://wiki.math.uzh.ch/public/LaTeX?action=AttachFile&do=get&target=uzh-praesentation-de-informal.pdf|pdf]]) ([[https://wiki.math.uzh.ch/public/LaTeX?action=AttachFile&do=get&target=uzh-praesentation-de-informal.ps|ps]]) ([[http://www.math.uzh.ch/doc/latex/praesentation/uzh-praesentation-de-informal.tex|tex]])
 * UZH Praesentation deutsch ([[https://wiki.math.uzh.ch/public/LaTeX?action=AttachFile&do=get&target=uzh-praesentation-de.pdf|pdf]]) ([[https://wiki.math.uzh.ch/public/LaTeX?action=AttachFile&do=get&target=uzh-praesentation-de.ps|ps]]) ([[http://www.math.uzh.ch/doc/latex/praesentation/uzh-praesentation-de.tex|tex]])
Direct downloads of the persentation templates:

 * UZH Präsentation deutsch (informell) ([[https://wiki.math.uzh.ch/public/LaTeX?action=AttachFile&do=get&target=uzh-praesentation-de-informal.pdf|pdf]]) ([[https://wiki.math.uzh.ch/public/LaTeX?action=AttachFile&do=get&target=uzh-praesentation-de-informal.ps|ps]]) ([[http://www.math.uzh.ch/doc/latex/praesentation/uzh-praesentation-de-informal.tex|tex]])
 * UZH Präsentation deutsch ([[https://wiki.math.uzh.ch/public/LaTeX?action=AttachFile&do=get&target=uzh-praesentation-de.pdf|pdf]]) ([[https://wiki.math.uzh.ch/public/LaTeX?action=AttachFile&do=get&target=uzh-praesentation-de.ps|ps]]) ([[http://www.math.uzh.ch/doc/latex/praesentation/uzh-praesentation-de.tex|tex]])
Line 45: Line 39:
== Working with Templates on the I-MATH Terminals ==

If you are working with the I-MATH Terminals, you can also find the official LaTeX templates linked above at `/scratch/templates/latex`. '''Copy''' the desired template to your home directory, or any other suitable location (Do not edit the files in `/scratch/templates/latex`) and edit it with your favorite LaTeX editor.
Line 46: Line 44:

You have to perform the steps below only when using the LaTeX on your Notebook or Personal Computer. If you are working with the I-MATH SunRay Terminals, see [[#Letter]] and [[#Presentation]]
You have to perform the steps below only when using the LaTeX on your Notebook or Personal Computer.
Line 50: Line 47:

This instruction assumes that the latest MikTeX is installed including KOMA-Script, lastpage, mptopdf, and arial package. In order to ensure you're running the latest version or installing missing packages, start the MikTeX Package Administrator found under `Start|All Programs|MikTeX X.Y|Maintenance (Admin)|Package Manager (Admin)` and run the Update Wizard found under `Task|Update Wizard`. Please refer to the MikTeX Documentation for further information on this topic by pointing your browser to [[http://www.miktex.org/docs]].
This instruction assumes that the latest MikTeX is installed including KOMA-Script, lastpage, mptopdf, and arial package. In order to ensure you're running the latest version or installing missing packages, start the MikTeX Package Administrator found under `Start|All Programs|MikTeX X.Y|Maintenance (Admin)|Package Manager (Admin)` and run the Update Wizard found under `Task|Update Wizard`. Please refer to the MikTeX Documentation for further information on this topic by pointing your browser to http://www.miktex.org/docs.
Line 54: Line 50:

Download the LaTeX Letter templates from [[http://www.math.uzh.ch/doc/latex/config/nmathletter.zip|math www]] (see Notes: 1). Unzip the package, and copy the entire `nmathletter` directory to `C:\Program Files\MiKTeX X.Y\tex\latex`.
Download the LaTeX Letter templates from [[http://www.math.uzh.ch/doc/latex/config/nmathletter.zip|math www]] ([[#Access:_restrictions|access]]). Unzip the package, and copy the entire `nmathletter` directory to `C:\Program Files\MiKTeX X.Y\tex\latex`.
Line 60: Line 55:

Download the LaTeX Beamer templates from [[http://www.math.uzh.ch/doc/latex/config/mathbeamer.zip|math www]] (see Notes: 1). Unzip the package, and copy the entire `mathbeamer` directory to `C:\Program Files\MiKTeX X.Y\tex\latex`.
Download the LaTeX Beamer templates from [[http://www.math.uzh.ch/doc/latex/config/mathbeamer.zip|math www]] ([[#Access:_restrictions|access]]). Unzip the package, and copy the entire `mathbeamer` directory to `C:\Program Files\MiKTeX X.Y\tex\latex`.
Line 66: Line 60:

You need to have installed the following Ubuntu packages:

 * texlive-fonts-extra

In order to install the Arial font type on a command line: `sudo getnonfreefonts-sys arial-urw`
You need to have the Ubuntu package texlive-fonts-extra installed:

In order to install the Arial font, type on a command line: `sudo getnonfreefonts --sys arial-urw`

If there is no `getnonfreefonts` : {{{
cd /var/tmp
curl -O http://tug.org/fonts/getnonfreefonts/install-getnonfreefonts
texlua install-getnonfreefonts
getnonfreefonts --sys arial-urw
}}}
Line 74: Line 72:

Download the LaTeX Letter templates from [[http://www.math.uzh.ch/doc/latex/config/nmathletter.zip|math www]] (see Notes: 1). Unzip the package, and copy the entire `nmathletter` directory `/usr/local/share/texmf/tex/latex`. Download [[http://prdownload.berlios.de/koma-script3/koma-script-20120729.tds.zip]] and save it to `/usr/local/share/texmf/` and unzip the file in that directory.

Run `sudo mktexlsr` in order to update the search database of latex.
 * Download the LaTeX Letter templates from [[http://www.math.uzh.ch/doc/latex/config/nmathletter.zip|math www]] ([[#Access:_restrictions|access]]).
 * Unzip the package, and copy the entire `nmathletter` directory `/usr/local/share/texmf/tex/latex`.
 * Download
http://prdownload.berlios.de/koma-script3/koma-script-20120729.tds.zip and save it to `/usr/local/share/texmf/` and unzip the file in that directory.
 * Run `sudo mktexlsr` in order to update the search database of latex.
Line 80: Line 78:

Download the LaTeX Beamer templates from [[http://www.math.uzh.ch/doc/latex/config/mathbeamer.zip|math www]] (see Notes: 1). Unzip the package, and copy the entire `mathbeamer` directory to `/usr/local/share/texmf/tex/latex`.

Run `sudo mktexlsr` in order to update the search database of latex.
 * Download the LaTeX Beamer templates from [[http://www.math.uzh.ch/doc/latex/config/mathbeamer.zip|math www]] ([[#Access:_restrictions|access]]).   * Unzip the package, and copy the entire `mathbeamer` directory to `/usr/local/share/texmf/tex/latex`.

 * Run `sudo mktexlsr` in order to update the search database of latex.
Line 87: Line 85:
You need to have the latest MacTeX installed. MacTeX can be obtained [[http://www.tug.org/mactex/downloading.html|here]]. Further, it is assumed you have installed ''getnonfreefonts'' (download and installation instructions can be found [[http://tug.org/fonts/getnonfreefonts/|here]]). ==== installation of required packages and prepare installation ====
 * Download and install the latest MacTeX. MacTeX can be obtained [[http://www.tug.org/mactex/downloading.html|here]].
 * next, you need to install the required fonts.
 * before this can be performed, you need to set the correct installation path. Please open a '''terminal''' and type `export PATH="/Library/TeX/texbin/:$PATH"`
 * Download the installer "install-getnonfreefonts" to i.e. the Downloads directory: getnonfreefonts can be obtained [[https://tug.org/fonts/getnonfreefonts/install-getnonfreefonts|here]]
  * assuming the terminal is still open, please navigate (cd) into the directory containing the downloaded file
  * type `sudo texlua install-getnonfreefonts`
  * do not close the terminal, as we need it for the next steps
Line 90: Line 95:

Open a terminal and type

 `getnonfreefonts-sys arial-urw`

(This requires administrator privileges). The Arial font will be downloaded and automagically installed.
 * in the terminal type now:
 . `sudo getnonfreefonts --sys arial-urw`
  * The font Arial will be downloaded
 * next, in order to install the fonts run this command in the same terminal
 . `updmap-user`

Further notes can be found:
 * http://www.tug.org/mactex/TeXLive2018+Changes.pdf
Line 98: Line 105:

Download the LaTeX Letter templates from [[http://www.math.uzh.ch/doc/latex/config/nmathletter.zip|math www]]. Unzip the package, and copy the entire `nmathletter` directory `/usr/local/texlive/texmf-local/tex/latex/local`.

Run `mktexlsr` as administrator in order to update the search database of latex.
Download the LaTeX Letter templates from [[http://www.math.uzh.ch/doc/latex/config/nmathletter.zip|math www]]. Unzip the package, and copy the entire `nmathletter` directory `/usr/local/texlive/texmf-local/tex/latex/local` (you need administrative privileges to perform this task and you will be asked to enter your password).

Run `sudo mktexlsr` in a terminal in order to update the search database of latex.
Line 104: Line 110:

Download the LaTeX Beamer templates from [[http://www.math.uzh.ch/doc/latex/config/mathbeamer.zip|math www]]. Unzip the package, and copy the entire `mathbeamer` directory to `/usr/local/texlive/texmf-local/tex/latex/local`.

Run `mktexlsr` as adminstrator in order to update the search database of latex.
Download the LaTeX Beamer templates from [[http://www.math.uzh.ch/doc/latex/config/mathbeamer.zip|math www]]. Unzip the package, and copy the entire `mathbeamer` directory to `/usr/local/texlive/texmf-local/tex/latex/local` (you need administrative privileges to perform this task and you will be asked to enter your password).

Run `sudo mktexlsr` in a terminal in order to update the search database of latex.

 * note: all sudo introduced command requires a password to perform the action
Line 110: Line 117:
Line 113: Line 119:
= Frequently used questions and programs =

== Count words in a latex documents ==
= Tips and tricks =
== Count words in a latex document ==
Line 119: Line 124:
Line 122: Line 126:
  = Tips and tricks =

== Looking for symbol ==

== Custom paper size ==
{{{
\documentclass[a4paper]{amsart}
\usepackage{amssymb,latexsym}
\usepackage{graphicx, pgf, pst-all}

\usepackage[paperwidth=17truecm, paperheight=24truecm, centering, twoside, margin=1.58cm,heightrounded]{geometry}

\textwidth14truecm
\textheight20truecm
}}}

== Looking for a symbol ==
Line 139: Line 153:
View the PDF File in Acrobat Reader. It probably won't work on the Sun Ray Terminals.
View the PDF File in Acrobat Reader. It probably won't work on the Terminals.
Line 144: Line 157:
Line 165: Line 179:
   * Download the MP4 version: http://keepvid.com/?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6lIM9p6XOKo
 * compile: 
   * Download the MP4 version: [[http://keepvid.com/?url=http://www.youtube.com/watch?v=6lIM9p6XOKo|http://keepvid.com/?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6lIM9p6XOKo]]
 * compile:
Line 172: Line 187:
== Converting LaTeX to HTML, XML, OpenOffice, Word ==
 * TeX4HT: http://www.tug.org/applications/tex4ht/mn.html
 * Sun Ray: call the commandline utilities in a terminal.
 * All possible filters: `ls -l /usr/share/tex4ht`
 * Converting a LaTeX Document to MS Word:
{{{
# Create an OpenOffice File
mk4ht oolatex filename.tex
}}}
 * Open 'filename.odt' in OpenOffice and save it as Microsoft Word/97 file.

= Grafic / Drawing =
= Graphic / Drawing =
Line 185: Line 189:
 * old, powerfull and strange
 * lmgtfy (Google): http://lmgtfy.com/?q=xfig+latex
 * old, powerful and strange
 * http://www.xfig.org/userman/latex_and_xfig.html
Line 192: Line 196:
 * F.e.: 
{{{
Save your image, eg as “image.svg”. In addition, in Inkscape go to the 
option File -> Save a Copy and chose PDF as your output format in the 
same folder as the SVG. In the PDF options popup that comes right after 
 * e.g.:

{{{
Save your image, eg as “image.svg”. In addition, in Inkscape go to the
option File -> Save a Copy and chose PDF as your output format in the
same folder as the SVG. In the PDF options popup that comes right after
Line 210: Line 215:
Line 213: Line 217:
Line 216: Line 219:
= Access restrictions =
Some files are copyright protected. To access such files (links named 'math www'), you have to be inside of I-MATH or use a browser via SGD (http://institute.math.uzh.ch).
= Access: restrictions =

 Some files are copyright protected. To access such files (links named 'math www'), you have to provide your I-MATH credentials.

= Converting Latex to Word (and more) =
 * Overview: http://tug.org/utilities/texconv/textopc.html

|| way || Correct math symbols || Keep Layout || Editable ||
|| Open the PDF under Windows in Adobe Acrobat (not Adobe Reader) and 'Export as Word' || - || - || (./) ||
|| Open the PDF under Windows in Adobe Acrobat (not Adobe Reader) and 'Export as Image'. Take all Images, one per side in an empty Word Document. || (./) || (./) || - ||
|| LyX > ODT > Word || ? || ? || ? ||
|| pandoc > DOCX || ? || ? || ? ||
|| TeX4HT: http://www.tug.org/applications/tex4ht/mn.html <<BR>> * All possible filters: `ls -l /usr/share/tex4ht` <<BR>> * Converting a LaTeX Document to MS Word: `mk4ht oolatex filename.tex`|| ? || - || (./) ||

LaTeX



TeX/LaTeX Documentation

UZH Style Templates

The UZH offers LaTeX templates with official corporate design. Below you can find versions of these templates adapted for the Institute of Mathematics.

Letter

The UZH Letter style is based on the KOMA Letter package. Documentation: http://www.ctan.org/pkg/scrlttr2

Please make sure that the return address (Institute of Mathematics) is mentioned on the envelope!

Direct downloads of the letter templates:

  • UZH Brief deutsch mit Absender (pdf) (ps) (tex)

  • UZH Brief deutsch ohne Absender (pdf) (ps) (tex)

  • UZH Letter English with Sender (pdf) (ps) (tex)

  • UZH Letter English without Sender (pdf) (ps) (tex)

Please replace the text enclosed by angle brackets (<>) with the appropriate information.

Presentation

Direct downloads of the persentation templates:

  • UZH Präsentation deutsch (informell) (pdf) (ps) (tex)

  • UZH Präsentation deutsch (pdf) (ps) (tex)

  • UZH Presentation English (informal) (pdf) (ps) (tex)

  • UZH Presentation English (pdf) (ps) (tex)

Working with Templates on the I-MATH Terminals

If you are working with the I-MATH Terminals, you can also find the official LaTeX templates linked above at /scratch/templates/latex. Copy the desired template to your home directory, or any other suitable location (Do not edit the files in /scratch/templates/latex) and edit it with your favorite LaTeX editor.

Installation of Corporate Design Templates

You have to perform the steps below only when using the LaTeX on your Notebook or Personal Computer.

Windows

This instruction assumes that the latest MikTeX is installed including KOMA-Script, lastpage, mptopdf, and arial package. In order to ensure you're running the latest version or installing missing packages, start the MikTeX Package Administrator found under Start|All Programs|MikTeX X.Y|Maintenance (Admin)|Package Manager (Admin) and run the Update Wizard found under Task|Update Wizard. Please refer to the MikTeX Documentation for further information on this topic by pointing your browser to http://www.miktex.org/docs.

Letter Templates

Download the LaTeX Letter templates from math www (access). Unzip the package, and copy the entire nmathletter directory to C:\Program Files\MiKTeX X.Y\tex\latex.

Go to Start|All Programs|MiKTeX X.Y|Maintenance (Admin)|Settings (Admin) and click in the first tab on Refresh FNDB.

Beamer Templates

Download the LaTeX Beamer templates from math www (access). Unzip the package, and copy the entire mathbeamer directory to C:\Program Files\MiKTeX X.Y\tex\latex.

Go to Start|All Programs|MiKTeX X.Y|Maintenance (Admin)|Settings (Admin) and click in the first tab on Refresh FNDB.

Ubuntu

You need to have the Ubuntu package texlive-fonts-extra installed:

In order to install the Arial font, type on a command line: sudo getnonfreefonts --sys arial-urw

If there is no getnonfreefonts :

cd /var/tmp
curl -O http://tug.org/fonts/getnonfreefonts/install-getnonfreefonts
texlua install-getnonfreefonts
getnonfreefonts --sys arial-urw

Letter Templates

Beamer Templates

  • Download the LaTeX Beamer templates from math www (access).

  • Unzip the package, and copy the entire mathbeamer directory to /usr/local/share/texmf/tex/latex.

  • Run sudo mktexlsr in order to update the search database of latex.

MacOS X

installation of required packages and prepare installation

  • Download and install the latest MacTeX. MacTeX can be obtained here.

  • next, you need to install the required fonts.
  • before this can be performed, you need to set the correct installation path. Please open a terminal and type export PATH="/Library/TeX/texbin/:$PATH"

  • Download the installer "install-getnonfreefonts" to i.e. the Downloads directory: getnonfreefonts can be obtained here

    • assuming the terminal is still open, please navigate (cd) into the directory containing the downloaded file
    • type sudo texlua install-getnonfreefonts

    • do not close the terminal, as we need it for the next steps

Installing the Arial Font

  • in the terminal type now:
  • sudo getnonfreefonts --sys arial-urw

    • The font Arial will be downloaded
  • next, in order to install the fonts run this command in the same terminal
  • updmap-user

Further notes can be found:

Letter Templates

Download the LaTeX Letter templates from math www. Unzip the package, and copy the entire nmathletter directory /usr/local/texlive/texmf-local/tex/latex/local (you need administrative privileges to perform this task and you will be asked to enter your password).

Run sudo mktexlsr in a terminal in order to update the search database of latex.

Beamer Templates

Download the LaTeX Beamer templates from math www. Unzip the package, and copy the entire mathbeamer directory to /usr/local/texlive/texmf-local/tex/latex/local (you need administrative privileges to perform this task and you will be asked to enter your password).

Run sudo mktexlsr in a terminal in order to update the search database of latex.

  • note: all sudo introduced command requires a password to perform the action

UZH Logo

If you want to include the UZH logo in a LaTeX document, download this zip file. Read the README.pdf file for instructions.

Tips and tricks

Count words in a latex document

Kile: File > Statistics

kdvi

Custom paper size

\documentclass[a4paper]{amsart}
\usepackage{amssymb,latexsym}
\usepackage{graphicx, pgf, pst-all}

\usepackage[paperwidth=17truecm, paperheight=24truecm, centering, twoside, margin=1.58cm,heightrounded]{geometry}

\textwidth14truecm
\textheight20truecm

Looking for a symbol

Converting .eps-files (automatically) to .pdf-files

Include a movie in a PDF Document

Example: omega.tex omega.mpg omega.pdf

[user@host] pdflatex omega.tex

View the PDF File in Acrobat Reader. It probably won't work on the Terminals.

Example

  • movie.tex

\documentclass[12pt,landscape]{article}
\usepackage{geometry}
\geometry{verbose,letterpaper}
\usepackage{movie15}
\usepackage{hyperref}
\begin{document}
Whispering-gallery mode in a quarter circle:
\begin{figure}[ht]

\includemovie[
  poster,
  text={\small(2-twist-spun.mp4)}
]{6cm}{4.8cm}{2-twist-spun.mp4}

\end{figure}
\end{document}

pdflatex movie.tex

Graphic / Drawing

xfig

inkscape

Save your image, eg as “image.svg”. In addition, in Inkscape go to the
option File -> Save a Copy and chose PDF as your output format in the
same folder as the SVG. In the PDF options popup that comes right after
select the options:

  * PDF+LaTeX: Omit text in PDF and create LaTeX file
  * Export area is drawing

Save and go to your LaTeX document.

\begin{figure}
    \centering
    \def\svgwidth{\columnwidth} % sets the image width, this is optional
    \input{image.pdf_tex}
\end{figure}

Kile

Path setting

Kile users should make sure, that under Settings|Configure Kile|Tools|Build for LaTeX and PDFLaTeX the command is /usr/sepp/bin/latex resp. /usr/sepp/bin/pdflatex.

Access: restrictions

  • Some files are copyright protected. To access such files (links named 'math www'), you have to provide your I-MATH credentials.

Converting Latex to Word (and more)

way

Correct math symbols

Keep Layout

Editable

Open the PDF under Windows in Adobe Acrobat (not Adobe Reader) and 'Export as Word'

-

-

(./)

Open the PDF under Windows in Adobe Acrobat (not Adobe Reader) and 'Export as Image'. Take all Images, one per side in an empty Word Document.

(./)

(./)

-

LyX > ODT > Word

?

?

?

pandoc > DOCX

?

?

?

TeX4HT: http://www.tug.org/applications/tex4ht/mn.html
* All possible filters: ls -l /usr/share/tex4ht
* Converting a LaTeX Document to MS Word: mk4ht oolatex filename.tex

?

-

(./)

PublicMathWiki: LaTeX (last edited 2021-02-04 10:06:06 by eseide)