LaTeX Tips

Here are several Tips which we encountered. I assume you are not a novice of LaTeX. If you are, these tips might be difficult to understand and please refer to other website or books first. A best free resource is "The Not So Short Introduction to LaTeX2e" (Gzipped Postscript version), or PDF version.

You can find others in General documentation about (La)TeX.
Do you need more? Handbooks are very useful. They have not only LaTeX but also vi, emacs, C, and so on. (Thanks José).
My favorite books are on this page.



How to Include Xfig File with LaTeX Format Letters

You can draw your schematic with Xfig and in that schematic you can write any equations or characters with the LaTeX format. LaTeX includes those equations into your figure.
Here is how to do that.
  1. First you're in Xfig. Write equations or characters in the schematic. You need "$" in both sides.

  2. Press the "Edit" icon and change the flag. Make the characters "Special".

  3. "Export" the figure. In the "language" menu, choose "Combined Postscript/LaTeX". Don't choose "Encapseled postscript" if you need to print the equations with LaTeX format.
    The file name will be "foo.pstex_t" when you're editing "foo.fig".

  4. You don't have to specify scale in Xfig, using ("Magnif") in the "Export" menu. After saving EPS file, you can change its scale in LaTeX.
    NOTE: In DVI viewer, you may find the pictures are scaled correctly, but not LaTeX text. Don't panic! After making postscript file using that dvi file, LaTeX text is also scaled correctly. Thanks to José to find this solution!

    Below info works well, but old info. You don't have to obey this.
    Modify the scaling ("Magnif") in the "Export" menu if you need.
    So far, I don't know how to change the scale in LaTeX file, when you include the equations with LaTeX format in your schematic.

  5. Then you're writing your TeX file. Insert \usepackage{epsfig} command between \documentclass and \begin{document}.
    That means:

  6. Write the command to insert your figure in TeX file.
    Command scalebox change your scale in postscript file, but you may not see scaled figure in dvi file. eg.
             \caption{This is an example}

  7. If you don't have LaTeX format characters in your figure. You just "Export" into the eps file. Then, include as follows.
                 \epsfig{file=foo2.eps, scale=0.5}
              \caption{Picture without equations}

  8. Compile your latex file and check it with xdvi. Congratulations!

How to Put Two Figures Next to Each Other

See below minipage command! figure1.eps and figure2.eps are the EPS figures.

      \epsfig{file=figure1.eps, scale=0.5}
      \caption{figure 1}
      \epsfig{file=figure2.eps, scale=0.5}
      \caption{figure 2}

How to put two figures next to each other: Part2.

You can put two or more figures as a part of one figure with captions: (a) xxx (b) yyy (c) zzz.
You need subfigure package in your header, i.e. use
See p.152 in LaTeX companion book for more detail.
Now you can understand this example.
      \subfigure[Honda]{\scalebox{0.3}{\input{prelude.pstex_t}}} \quad
      \subfigure[Toyota]{\scalebox{0.3}{\input{celica.pstex_t}}} \quad
    \caption{I like these!}

How to put FOUR figures in one page

Easy! See this!
      \subfigure[Honda]{\scalebox{0.3}{\input{prelude.pstex_t}}} \quad
      \subfigure[Nissan]{\scalebox{0.3}{\input{FairladyZ.pstex_t}}} \quad
    \caption{I like these!}

How to rotate the graph with its caption

You may use rotating package and use sidewaysfigure instead of a figure environment. Refer LaTeX companion book (p.327).

How to Use Analog Library in Xfig

José created analog library. You can refer that library at:
You may read the man page of Xfig and use a proper option to include this library when you start Xfig.

How to include OSU logo

OSU Black and White Here is my modified eps file.

I just put this eps file into the author fields.
    \centerline{\epsfig{file=logo_black.eps, scale=0.3}}
  Tetsuya Kajita \\ 
  {\small  Advisor: Prof. XXXX } \\
  {\small Co-Advisor: Prof. YYYY }

Our (OSU) officical site is here. But I found their EPS file has a trouble. There are some unwanted "binary" codes at the beginning and the end of the eps file. You should remove them. Or use my modified file for ease.
Should I tell them ... ? Yes. I did, but no reply yet. :-)

Scaling figures

Scaling example, with \resizebox:
  \caption{A switched-capacitor DAC}
Another example, for \epsfxsize:
  \centerline{\epsfxsize 1.00\linewidth \epsfbox{fig1array.eps}}
  \caption  {A switched-capacitor DAC with the proposed analog
mismatch correction}
Thanks to José for this tip.


How to Make Slides


File conversion

Postscript -> Xfig

Use pstoedit command.
Now you can edit the schematic and add some text in it, too.

Postscript -> *.ai (Adobe Illustrator) file

You can import *.ai file into Mayura Draw (PC draw software) and edit it in your PC.

How to Include Combined PS/LATEX Pictures in MS-Word:

First of all, I don't think it is good way to keep using MS-Word now. Think different. In case you *really* need it, José tells you how to do this. (Thanks José)
1. Create a tex file containing only the desired picture;
2. Compile it with LaTeX;
3. Create a eps file with: dvips -E picture.eps -o picture.dvi

If the bounding box doesn't look right, you can adjust it
by editing the file picture.eps. Look for the following
line in the beginning:

%% BoundingBox:

There are four numbers following this line: 
Lower left x, Lower left y, Upper right x, Upper right y

... which you can adjust to fit your desired bounding box.
When you are done, it is straightforward to include this
in Word, or any other program that accepts eps files.


How to eliminate page numbers

Here is the word from Péter. (Thanks Péter)
To ignore page numbers:


but which will still keeps the page number for the first page. To ignore
that one also you should add to the first page (only):


Is there nice header?

Here is Péter's example, based on "The Not So Short Introduction to LaTeX2e" (Gzipped Postscript version). (Thanks Péter)

\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}{}}
\addtolength{\headheight}{2.5pt}                % 0.5pt

How to Change the style of section numbers

Use below command (thanks José):

\renewcommand \thesection{\roman{section}}

If you need a period after the roman number,

\renewcommand \thesection{\roman{section}.}

The second example may bring another problem when you have sub-section. i.e. an extra dot after the number.
[ TOP ] | [ LaTeX Tips ] | [ MATLAB Tips ] | [ HSPICE Tips ] | [ SwitCap2 Tips ]
Comments? Email to Testuya Kajita

Last modified: Fri Oct 27 16:05:26 2000