Pictures in L^{A}TEX

Want: pictures that have L^{A}TEX-labels. Use Xfig. This is a bad program, it will drive you insane. But: it exports to L^{A}TEXnicely. Draw your diagram, label it with “TEXT” in L^{A}TEX. Be sure to set the SPECIAL FLAG. Go to File-Export. Select Combined PS/LaTeX or Combined PDF/LaTeX (when using pdflatex. This will produce two files: *.pstex and *.pstex_t,

or *.pdftex and *.pdftex_t. Put the *_t file

in your latex source.

\begin{picture}(0,0)%
\includegraphics{PQdef.pstex}%
\end{picture}%
\setlength{\unitlength}{3947sp}%
%
\begingroup\makeatletter\ifx\SetFigFont\undefined%
\gdef\SetFigFont#1#2#3#4#5{%
  \reset@font\fontsize{#1}{#2pt}%
  \fontfamily{#3}\fontseries{#4}\fontshape{#5}%
  \selectfont}%
\fi\endgroup%
\begin{picture}(3528,3204)(412,-2818)
\put(1108,187){\makebox(0,0)[lb]{\smash{{\SetFigFont{14}{16.8}
{\rmdefault}{\mddefault}{\updefault}{\color[rgb]{1,0,0}
$\{\dist_{\infty}(x,Q)=\epsilon\}$}%
}}}}
\put(1839,-1636){\makebox(0,0)[lb]{\smash{{\SetFigFont{14}{16.8}
{\rmdefault}{\mddefault}{\updefault}{\color[rgb]{0,0,1}$Q$}%
}}}}
\end{picture}%

\begin{matrix}\{dist_{∞}(x, Q) = ϵ\} \\ Q \end{matrix}

All dvi and pdf viewers that I know don’t show L^{A}TEX-labels in the right color. If you print them they will however have the right color.

Be sure to have the pictures in the right size. If you want to use \scalebox you have to remove \SetFigFont. However your labels might move into the picture.

Layers make drawing pictures with xfig much easier.

If you rescale things in xfig, it tends to forget attributes. Use update.

               \psfrag

Use any graphics program. Put simple tags (like a,b,c,...) for the places where you want to label your picture. Save as *.eps. Add

% in the preamble
\usepackage{psfrag,graphics}
% where you want to place the picture
\psfrag{a}{$\mathcal{S}_0$}
\psfrag{b}{$\mathcal{S}_1$}
\psfrag{c}{$\mathcal{S}_2$}
\psfrag{d}{$\mathcal{S}_3$}
\includegraphics{subdivision.eps}

PSfrag replacements S_{0} S_{1} S_{2} S_{3} Your dvi viewer will not show the replacements correctly. Use simple tags no $ % ^& # . Can use tags globally. \psfrag at beginning will replace all eps pictures in the document. Otherwise put in environment. Doesn’t work with pdflatex Can do more stuff

\psfrag{tag}[][][scale][rotation]{replacement}

PSfrag replacements S_{0} S_{1} S_{2} S_{3}

BibTEX

Produces bibliographies. Place your citations in a file (i. e. lit.bib). Put before \end{document}

\bibliographystyle{plain} % can use other styles
\bibliography{lit}

Go to MathSciNet Search, to find your articles.

Add to Clipboard,
View clipboard,
Select format: Citations (BibTeX),
View all

Enjoy! Bibweb by John Palmieri does this automatically.

Have to delete some stuff (like reviewer). Careful with accents. Correct sequence to resolve all citations:

latex file
bibtex file
latex file
latex file

RefTEX

Enhancement for referencing in emacs. Add to

.emacs
; use in emacs LaTeX mode
(add-hook 'latex-mode-hook 'turn-on-reftex)
; with AUCTeX
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)

C-c ) Add a reference. C-c ( Add label. C-c = toc navigate around. C-c [ Add citation. C-c / Create Index Entry.

Multifile Documents

Thesis: likely several files. Put at the end of each file (emacs latex):

%%% Local Variables:
%%% mode: latex
%%% tex-main-file: ``main.tex''
%%% End:

AUCTeX:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: ``main.tex''
%%% End:

with AUCTeX add to .emacs

;ask for master-file
(setq-default TeX-master nil)

this will automatically ask and create the above.

AUCTEX

Enhanced L^{A}TEXmode for emacs. Not installed on zeno (yet). Activate by adding to .emacs

;; on zeno
(setq load-path (cons "/usr/share/xemacs
/xemacs-packages/lisp/auctex" load-path))
;; activate AUCTeX
(require 'tex-site)
C-c C-e: enters \begin{}\end{}, ask for name.

C-u C-c C-e: changes environment. C-c ; comments region out. C-u C-c ; uncomments region.

C-c C-c: runs command, default LaTeX. M-TAB: auto-completion. C-c ~: enter math mode. ` + key: math command, for example greek

     ` s: \sigma σ
     ` 0: \emptyset ∅
     ` {: \subset ⊂

Math mode always on with (in .emacs)

; always activate math mode in AUCTeX
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode

emacs

Settings are saved in ~/.emacs.

Possible options are comparable to the number of particles in the known universe.

Some things I find useful:

;; turn on font-lock mode
(global-font-lock-mode t)
;; enable visual feedback on selections
(setq-default transient-mark-mode t)
;; make it colorfull
(setq font-lock-maximum-decoration t)
;; show matching parenthesis
(show-paren-mode t)

General

Use AMS packages.

\usepackage{amssymb,amsmath,amsthm}

Use align. amsart looks much nicer than article. Define your own macros. For example

% complex numbers
\newcommand{\C}{\mathbb{C}}

So by $\C$ one gets ℂ. If you want to change it to C, just have to change

% complex numbers
\newcommand{\C}{\mathbf{C}}

Miscellaneous

Periods: use .\␣ for Abbreviations like etc.\␣. Use tilde ~ for nonbreakable spaces like i.~e.\␣. L^{A}TEXknows three dashes:

• - for hyphen, like single-valued.

• -- for number ranges, like pages 12–25.

• --- em dash, like blablabla—and now something completely different.

Misc Math

Don’t write |a|, L^{A}TEXdoesn’t know whether its left or right. Similar for ∥. Put

\providecommand{\abs}[1]{\lvert#1\rvert}
\providecommand{\norm}[1]{\lVert#1\rVert}
then $abs\{z}$ gives |z| and $\norm{v}$ ∥v∥.

XY-pic, Commutative Diagrams

\usepackage[matrix,arrow,curve,cmtip]{xy}
\xymatrix{A \ar[rrr]^{f} \ar[dd]_{g}
& & & B \ar[dd]^{h} \\
& & {} \ar@{=>}[dr]\\
C \ar[rrr]_{i}
& & & D}

produces this:

[figure: A; f; g; B; h; C; i; D] [figure: ∘; a; b; c; d; e; f; ∘; ∘; ∘; ∘; ∘; ∘; ∘]

[figure: A; B]

creating pdf-files

pdflatex file generates a pdf-file in one step. Use:

\usepackage{pslatex}  % produces better output
% use following for clickable links
\usepackage[colorlinks=true,linkcolor=black]
    {hyperref}

Can’t use eps-files for graphics. Have to convert. Otherwise use

latex file
dvips -Pcmz -Pamz -D7200 file.dvi -o file.ps
ps2pdf -dEmbedAllFonts file.ps

Or

dvips -Ppdf -f -G0 filename.dvi > filename.ps

fonts substitutions

Some people dislike standard L^{A}TEXfonts. Can change fonts, but might open can of worms. All different fonts have to match. By

\usepackage{mathpazo,bm}

one gets the Palatino font (including bold) in math and text. By

\usepackage{mathptmx}

get Times in text and math. Careful: not all

symbols in bold. Get this script font 𝒜 ℬ𝒞 𝒟ℰ ℱ 𝒢

Books

George Grätzer: Math Into L^{A}TEX, Birkhäuser-Springer, 3rd ed. My favorite

Helmut Kopka and Patrick W. Daly: Guide to L^{A}TEX(4th Edition) Also very good

Frank Mittelbach and Michel Goossens: The L^{A}TEXCompanion (2nd Edition) If you absolutely definitely want to know everything.

Apostolos Syropoulos, Antonis Tsolomitis, Nick Sofroniou: Digital Typography Using L^{A}TEX I quite like it, it’s weird though (want to write in Mogolian?). Available online from Library.