Fig4TeX : Insertion of a figure in a document |
| Introduction | Reference Guide | Tutorial | Examples | Pdf Documentation | |
Here, we are interested in the problem of the insertion of a figure inside a TeX document. People concerned with this question are often looking for simple solutions and examples. Here are some such solutions using Fig4TeX or LaTeX or both.
Picture.png
. Some hints are given below
if the figure has to be created.
pdftex
or pdflatex
(see Final document). They all give the
same kind of result.
Plain TeX with Fig4TeX | LaTeX with Fig4TeX | LaTeX without Fig4TeX, with graphicx |
\input fig4tex Some text before the figure. \figvisu{\figBoxA}{The figure}{ \figinsertE{Picture.png} } \centerline{\box\figBoxA} Some text after the figure. \bye |
\documentclass[12pt]{article} \usepackage{fig4tex} \begin{document} Some text before the figure. \figvisu{\figBoxA}{}{ \figinsertE{Picture.png} } \begin{figure}[h] \centerline{\box\figBoxA} \caption{The figure} \end{figure} Some text after the figure. \end{document} |
\documentclass[12pt]{article} \usepackage{graphicx} \begin{document} Some text before the figure. \begin{figure}[h] \begin{center} \includegraphics{Picture.png} \end{center} \caption{The figure} \end{figure} Some text after the figure. \end{document} |
Other people prefer macro packages designed for TeX or LaTeX in order to have a close
compatibility between text and figures. In particular, with the softwares mentionned above,
the font used to annotate the figure is not always the same as in the document.
Fig4TeX is one of those macro packages, whose "historical" aim was to compute a geometric
construction leading to an annotated figure, with both text and graphical information gathered
into a single source file, without having to use any other software.
Another way is to use the script bcscript, which
is a small program to be processed by the command bc
(basic calculator) available
on any Unix system (including Linux and Mac OS X).
You can download this file,
modify and execute it according to the guidelines written inside the file. You will get a standalone
TeX file that can be typeset to obtain the desired graph. You are then free to copy-paste the code
in your own document.
The given script leads to the following left figure. The right hand side one is obtained by the
same script by setting the parameter trueorig
to 1.