Which is the best way to put function plots into a LaTeX document?
[Tex/LaTex] Best way to generate nice function plots in LaTeX
big-listdiagrams
Related Solutions
You should look into the (extremely useful) preview package. You'll probably want the tightpage
option, and if you want the generated eps to have exactly the same dimensions as the original you'll need to \setlength\PreviewBorder{0 pt}
.
You don't need to copy the picture
environments into otherwise blank documents, you just need have a \PreviewEnvironment{picture}
line in the preamble, in order to extract only the pictures.
To expand on your example
\documentclass{article}
\usepackage[active,tightpage]{preview}
\setlength\PreviewBorder{0pt}
\PreviewEnvironment{picture}
\begin{document}
\setlength{\unitlength}{1in}
Text before picture
\begin{picture}(3.14,2.71)
Contents of picture environment
\end{picture}
\begin{picture}(1.00,1.00)
Contents of picture environment2
\end{picture}
Text after pictures
\end{document}
Gives, when compiled with pdflatex, a pdf which has pages of exactly 3.14in*2.71in and 1.00in*1.00in, and when compiled by latex and dvips gives a ps with the same dimension pages. Either the pdf or the ps can be turned into eps using external tools, but if you want to, you can replace tightpage
with psfixbb
and then run dvips -E -i
on the dvi to get a series of eps files each with the correct dimensions (named jobname.001 jobname.002 etc, which you have to rename as jobname.001.eps etc).
Removing the active
option from the usepackage
line means the file will compile as if preview was never loaded.
PS: if you want the \includegraphics
boxes to be very accurately the same as the original ones then you should also look into the hiresbb
option of the graphicx
package. Otherwise the dimensions get rounded to 1 bp
(big point) accuracy.
I don't have MS Visio myself, but all the other MS Office 2010 (and 2007 as well, methinks) programs are able to export to/save as PDF natively:
- Click the File tab.
- Click Save As.
- In the File Name box, enter a name for the file, if you haven't already.
In the Save as type list, click PDF (*.pdf).
- If you want the file to open in the selected format after saving, select the Open file after publishing check box.
- If the document requires high print quality, click Standard (publishing online and printing).
- If file size is more important than print quality, click Minimum size (publishing online).
- Click Options to set the page to be printed, to choose whether markup should be printed and to select output options. Click OK. Click Save.
(applies to Viso 2010, http://office.microsoft.com/en-us/visio-help/save-as-pdf-HA010354239.aspx#BM10)
Here's the guide for Visio 2007.
You might have to run pdfcrop
afterwards, as Martin suggested.
Best Answer
To extend the answer from Mica,
pgfplots
can do calculations in TeX:or using GNUplot (requires
--shell-escape
):You can also pre-calculate values using another program, for example a spreadsheet, and import the data. This is all detailed in the manual.