oBook‎ > ‎Latex Tips‎ > ‎


posted Jul 22, 2014, 6:52 PM by Javad Taghia   [ updated Jul 22, 2014, 6:52 PM ]
One easy way to create figures with latex formula is using PSfrag. For this purpose we need three things to do: 
1. Have a eps figure ready and put text boxes with tags on the figure. Then in the latex file we will substitute the tags with proper mathematical symbols. 
Eps files can be created and tagged by: Inkscape; GIMP or WinFig
2. We need to add \usepackage{psfragand \usepackage{graphicx,color} to our latex file. 
3. Using the following code arrangement:
The following is other ways for using PSfrag:
 \psfrag{tag}[position][psposition][scale][rotation]{LaTeX construction}
\psfrag{ZafnbR}[Br][Br][0.9]{$a f(n/b)$}
\psfrag{Za2fnb2R}[Br][Br][0.9]{$a^2 f(n/b^2)$}
\psfrag{Zlogbn}[Bc][Bc][0.9]{$\log_b n$}
\psfrag{Znlogba}[Bc][Bc][0.9]{$n^{\log_b a}$}
\psfrag{ZTnlogbaR}[Br][Br][0.9]{$\Theta(n^{\log_b a})$}
\psfrag{ZTotalR}[Br][Br][0.9]{Total: $\displaystyle\Theta(n^{\log_b a}) +
\sum_{j=0}^{\log_b n-1} a^j f(n/b^j)$}