Graphics, Figures & TablesPSTricks | Figures in PDF Format

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Magnolis
Posts: 13
Joined: Wed Apr 04, 2012 1:45 pm

PSTricks | Figures in PDF Format

Post by Magnolis »

Hi, I'm trying to insert a figure created with Inkscape (saved in .tex format) by using the PSTricks package, but the PDF created does not display it.
This is the minimal example I am using:

Code: Select all

\documentclass[12pt]{article}
\usepackage{pstricks}
\begin{document}

Test of PSTricks with Inkscape.

\input{FileExportTest.tex}

\end{document}
It is exactly the same example suggested in this page (search for "LaTeX with PSTricks Macros"):
http://tavmjong.free.fr/INKSCAPE/MANUAL ... port-Other.
I have read somewhere that the command \input may be troublesome, so I tried \include but nothing changed. I also tried to insert the .tex code of the figure into the main .tex file: the result was the same.
Just in case, I'm not using a classic .pdf or .eps format because I'd like to include this figure directly into an equation, but I don't know any other simple ways to do it. Thank you.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

PSTricks | Figures in PDF Format

Post by Stefan Kottwitz »

Hi,
Magnolis wrote:Hi, I'm trying to insert a figure created with Inkscape (saved in .tex format) by using the PSTricks package, but the .pdf created does not display it.
you have to use LaTeX in DVI mode, you can produce a PDF file by dvips and ps2pdf afterwards. Or try XeLaTeX. But pdfLaTeX would not directly work with PSTricks, or try it with auto-pst-pdf.
Magnolis wrote:I have read somewhere that the command \input may be troublesome, so I tried \include but nothing changed. I also tried to insert the .tex code of the figure into the main .tex file: the result was the same.
\input is simple and should usually work well. \include is more restricted, it doesn't work in the preamble and it clears the page before the file.
Magnolis wrote:Just in case, I'm not using a classic .pdf or .eps format because I'd like to include this figure directly into an equation, but I don't know any other simple ways to do it. Thank you.
\includegraphics with .pdf or .eps files works also in equations.

Stefan
LaTeX.org admin
Magnolis
Posts: 13
Joined: Wed Apr 04, 2012 1:45 pm

Re: PSTricks | Figures in PDF Format

Post by Magnolis »

Thanks, it seems that the easiest way to include a figure into an equation is to use the \includegraphics command, despite some alignment problems, I will try to solve them.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

PSTricks | Figures in PDF Format

Post by Stefan Kottwitz »

The baseline of included graphics is at the bottom. It can be changed with \raisebox, for example. Or center it vertically with \vcenter{hbox{...}}.

Stefan
LaTeX.org admin
Post Reply