Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pdflatex/PSTricks conflict?

544 views
Skip to first unread message

Edward M. Reingold

unread,
Apr 16, 2010, 12:57:53 PM4/16/10
to
The following works just fine in latex, but produces no output in pdflatex:

\documentclass{article}
\usepackage{fancybox,pst-all}
\begin{document}
\begin{LandScape}{\rotateleft}
\centerline{Standard}
\end{LandScape}
\end{document}

Why? Can't I use PSTricks with pdflatex?

--

Professor Edward M. Reingold Email: rein...@iit.edu
Department of Computer Science Voice: (312) 567-3309
Illinois Institute of Technology Fax: (312) 567-5067
Stuart Building, 228F
10 West 31st Street
Chicago, IL 60616-3729 U.S.A.

pluton

unread,
Apr 16, 2010, 1:37:04 PM4/16/10
to

> Why?  Can't I use PSTricks with pdflatex?

you may want to read this: http://www.tug.org/PSTricks/main.cgi?file=pdf/pdfoutput

Edward M. Reingold

unread,
Apr 16, 2010, 4:44:19 PM4/16/10
to
>>>>> "p" == pluton <pluto...@gmail.com> writes:

>> Why? �Can't I use PSTricks with pdflatex?

p> you may want to read this:
p> http://www.tug.org/PSTricks/main.cgi?file=pdf/pdfoutput

That is not the point; I need pdflatex for other things not shown in the samll
sample.

Marco Daniel

unread,
Apr 16, 2010, 4:54:33 PM4/16/10
to
Hi,

Am 16.04.2010 22:44, schrieb Edward M. Reingold:
> That is not the point; I need pdflatex for other things not shown in the samll
> sample.

What is the point? pstricks is using the language postscript. So you
need the way latex-ps-pdf. The link of pluto shows you a way how to use
pdflatex with using pstricks.

An example of the site is the package pst-pdf.


\documentclass[12pt]{article}

\usepackage{pstricks}
\usepackage{pst-pdf}

\pagestyle{empty}

\begin{document}

\begin{pspicture}(-5.25,-5.25)(5.25,5.25)%
\pscircle*[linecolor=cyan]{5}
\psgrid[subgriddiv=0,gridcolor=lightgray,gridlabels=0pt]
\Huge\sffamily\bfseries
\rput(-4.5,4.5){A} \rput(4.5,4.5){B}
\rput(-4.5,-4.5){C}\rput(4.5,-4.5){D}
\rput(0,0){pst-pdf}
\rmfamily
\rput(0,-3.8){PSTricks}
\rput(0,3.8){\LaTeX}
\end{pspicture}

\end{document}

with the introduction to run:
latex <file.tex>
dvips -Ppdf -o <file-pics.ps> <file.dvi>
ps2pdf -dAutoRotatePages=/None <file-pics.ps> <file-pics.pdf>
pdflatex <file.tex>


regars
Marco

pluton

unread,
Apr 16, 2010, 5:11:57 PM4/16/10
to

> That is not the point; I need pdflatex for other things not shown in the samll
> sample.

yes, you should re-read the link.

Peter Flynn

unread,
Apr 16, 2010, 5:13:23 PM4/16/10
to
Edward M. Reingold wrote:
> The following works just fine in latex, but produces no output in pdflatex:
>
> \documentclass{article}
> \usepackage{fancybox,pst-all}
> \begin{document}
> \begin{LandScape}{\rotateleft}
> \centerline{Standard}
> \end{LandScape}
> \end{document}
>
> Why? Can't I use PSTricks with pdflatex?

Not directly. PS stands for PostScript: PSTricks uses the programmable
features of PostScript that do not exist in PDF, so it is only for
producing PostScript output via .dvi files. But you can do just that,
and then convert the resulting PostScript to PDF with ps2pdf. There *is*
a PDFTricks, but I don't know if it has the same range of features as
PSTricks.

///Peter

Joris

unread,
Apr 16, 2010, 8:23:26 PM4/16/10
to

or use tikz, which I prefer anyway (my preference is not shared by
all)

Herbert Voss

unread,
Apr 17, 2010, 3:29:13 AM4/17/10
to
Am 16.04.2010 22:44, schrieb Edward M. Reingold:
>>>>>> "p" == pluton <pluto...@gmail.com> writes:
>
> >> Why? Can't I use PSTricks with pdflatex?
>
> p> you may want to read this:
> p> http://www.tug.org/PSTricks/main.cgi?file=pdf/pdfoutput
>
> That is not the point; I need pdflatex for other things not shown in the samll
> sample.

that is exactly the point ...
However, if you run Linux, you can use pst2pdf instead of pdflatex.
The script does all converting of the PostScript related code
and you can use jpeg and png images as usual.

Herbert

Herbert Voss

unread,
Apr 17, 2010, 3:32:23 AM4/17/10
to
Am 16.04.2010 23:13, schrieb Peter Flynn:

> and then convert the resulting PostScript to PDF with ps2pdf. There *is*
> a PDFTricks, but I don't know if it has the same range of features as
> PSTricks.

pdftricks is only a package which runs the PS code snippets
from within pdflatex via the -shell-escape option.

Herbert

Edward M. Reingold

unread,
Apr 19, 2010, 11:47:58 AM4/19/10
to
>>>>> "HV" == Herbert Voss <Herber...@FU-Berlin.de> writes:

HV> that is exactly the point ... However, if you run Linux, you can use
HV> pst2pdf instead of pdflatex. The script does all converting of the
HV> PostScript related code and you can use jpeg and png images as usual.

I should have described exactly what I am trying to: I need to create a single
pdf file with tooltips; the tooltips will be on points in a rather elaborate
plot created with PSTricks. So, I need PSTricks to get the drawing, but
pdflatex to get the tooltips (via cooltooltips). I would use fancytooltips,
but I need everything in a single pdf file.

So, what are my options?!

Josef Kleber

unread,
Apr 19, 2010, 2:03:06 PM4/19/10
to
Am 19.04.2010 17:47, schrieb Edward M. Reingold:
>>>>>> "HV" == Herbert Voss <Herber...@FU-Berlin.de> writes:
>
> HV> that is exactly the point ... However, if you run Linux, you can use
> HV> pst2pdf instead of pdflatex. The script does all converting of the
> HV> PostScript related code and you can use jpeg and png images as usual.
>
> I should have described exactly what I am trying to: I need to create a single
> pdf file with tooltips; the tooltips will be on points in a rather elaborate
> plot created with PSTricks. So, I need PSTricks to get the drawing, but
> pdflatex to get the tooltips (via cooltooltips).

If you only need the tooltips and "comment boxes", but no hyperlinks,
you can also try pdfcomment.sty, which works also with the
latex->dvips->ps2pdf route.

Josef

--
Keine Sicherheit ohne Schäuble:
GNUPG/PGP-Key unter http://www.josef-kleber.de/pgp/Josef_Kleber_News.asc
DSA 1024 / 0xF4B1EA2A / F832 6058 319E FFD4 0EFF 088C 521B 40D4 F4B1 EA2A

Herbert Voss

unread,
Apr 19, 2010, 2:27:01 PM4/19/10
to
Am 19.04.2010 17:47, schrieb Edward M. Reingold:
>>>>>> "HV" == Herbert Voss <Herber...@FU-Berlin.de> writes:
>
> HV> that is exactly the point ... However, if you run Linux, you can use
> HV> pst2pdf instead of pdflatex. The script does all converting of the
> HV> PostScript related code and you can use jpeg and png images as usual.
>
> I should have described exactly what I am trying to: I need to create a single
> pdf file with tooltips; the tooltips will be on points in a rather elaborate
> plot created with PSTricks. So, I need PSTricks to get the drawing, but
> pdflatex to get the tooltips (via cooltooltips). I would use fancytooltips,
> but I need everything in a single pdf file.
>
> So, what are my options?!
>
>

use pst2pdf instead of latex, then the last run is always
a pdflatex one.

Herbert

Edward M. Reingold

unread,
Apr 19, 2010, 3:35:45 PM4/19/10
to
>>>>> "JK" == Josef Kleber <josef....@nurfuerspam.de> writes:

JK> If you only need the tooltips and "comment boxes", but no hyperlinks,
JK> you can also try pdfcomment.sty, which works also with the
latex-> dvips->ps2pdf route.

That looks like it would do what I want, but I need the "live" areas for the
tooltips to be objects defined in PSTricks terms (rectangular regions,
circles, lines, etc). How do I do that?

Herbert Voss

unread,
Apr 19, 2010, 3:50:38 PM4/19/10
to
Am 19.04.2010 21:35, schrieb Edward M. Reingold:
>>>>>> "JK" == Josef Kleber <josef....@nurfuerspam.de> writes:
>
> JK> If you only need the tooltips and "comment boxes", but no hyperlinks,
> JK> you can also try pdfcomment.sty, which works also with the
> latex-> dvips->ps2pdf route.
>
> That looks like it would do what I want, but I need the "live" areas for the
> tooltips to be objects defined in PSTricks terms (rectangular regions,
> circles, lines, etc). How do I do that?

do you have small example file?

Herbert

Edward M. Reingold

unread,
Apr 19, 2010, 4:08:42 PM4/19/10
to
>>>>> "HV" == Herbert Voss <Herber...@FU-Berlin.de> writes:

HV> do you have small example file?

Something like this:

\documentclass{article}
\usepackage{pst-all}

\begin{document}

\begin{pspicture}(0,0)(5,5)
\psgrid
\psframe*[linecolor=green](1,1) % Tooltip in this rectangle should say ``Origin''
\psframe*[linecolor=red](4,4)(5,5) % Tooltip in this rectangle should say
% ``Top right''
\pscircle*[linecolor=blue](1,4){1} % Tooltip in this circle should say
% ``Top left''
\psline[linewidth=3pt](0,2)(4,3) % Tooltip on this line should say ``Line''
\end{pspicture}

\end{document}

Herbert Voss

unread,
Apr 19, 2010, 4:16:53 PM4/19/10
to
Am 19.04.2010 22:08, schrieb Edward M. Reingold:
>>>>>> "HV" == Herbert Voss <Herber...@FU-Berlin.de> writes:
>
> HV> Am 19.04.2010 21:35, schrieb Edward M. Reingold:
> >>>>>>> "JK" == Josef Kleber <josef....@nurfuerspam.de> writes:
> >>
> JK> If you only need the tooltips and "comment boxes", but no hyperlinks,
> JK> you can also try pdfcomment.sty, which works also with the
> latex-> dvips->ps2pdf route.
> >> That looks like it would do what I want, but I need the "live" areas
> >> for the tooltips to be objects defined in PSTricks terms (rectangular
> >> regions, circles, lines, etc). How do I do that?
>
> HV> do you have small example file?

sorry, I meant one which uses also tooltips.
This example is only PSTricks code

Herbert

Edward M. Reingold

unread,
Apr 19, 2010, 4:34:04 PM4/19/10
to
>>>>> "HV" == Herbert Voss <Herber...@FU-Berlin.de> writes:

HV> sorry, I meant one which uses also tooltips. This example is only
HV> PSTricks code

The problem is that I don't know how to get the tooltips I want! So, I cannot
craft an example. All I could do is describe the effect I want.

Herbert Voss

unread,
Apr 19, 2010, 4:46:43 PM4/19/10
to
Am 19.04.2010 22:08, schrieb Edward M. Reingold:

> \begin{pspicture}(0,0)(5,5)
> \psgrid
> \psframe*[linecolor=green](1,1) % Tooltip in this rectangle should say ``Origin''

ok, I see. This is not possible with PSTricks because
the tooltips are part of the pspicture environment,
which itself is exported as an image and then reread
by pdflatex. But then it is too late for the tooltips

Herbert

Josef Kleber

unread,
Apr 19, 2010, 5:07:36 PM4/19/10
to
Am 19.04.2010 22:08, schrieb Edward M. Reingold:
> >> That looks like it would do what I want, but I need the "live" areas
> >> for the tooltips to be objects defined in PSTricks terms (rectangular
> >> regions, circles, lines, etc). How do I do that?
>
> HV> do you have small example file?
>
> Something like this:
>
> \documentclass{article}
> \usepackage{pst-all}
>
> \begin{document}
>
> \begin{pspicture}(0,0)(5,5)
> \psgrid
> \psframe*[linecolor=green](1,1) % Tooltip in this rectangle should say ``Origin''
> \psframe*[linecolor=red](4,4)(5,5) % Tooltip in this rectangle should say
> % ``Top right''
> \pscircle*[linecolor=blue](1,4){1} % Tooltip in this circle should say
> % ``Top left''
> \psline[linewidth=3pt](0,2)(4,3) % Tooltip on this line should say ``Line''
> \end{pspicture}
>
> \end{document}
>

So you only need a tooltip, right? A while ago i played with an example
presented by Alexander Grahn. It works only with the
latex->dvips->ps2pdf route, but that doen't semm to be a problem in your
case! ;-)
Maybe it also works in your case:

\documentclass{article}
\usepackage{pstricks-add}
\usepackage{hyperref}
\newcounter{tooltip}
\newcommand\tooltip[2]{%
% arg #1: text to put on the page
% arg #2: tooltip text
\pdfmark[#1]{
pdfmark=/ANN,
Subtype=/Widget,
Raw={
/TU (#2)/T (tooltip \thetooltip)
/FT/Btn/Ff 65536/H/N
}
}%
\stepcounter{tooltip}%
}

\begin{document}
\begin{center}
\begin{pspicture}(-2,-2)(2,2)
\psaxes(0,0)(-2,-2)(2,2)
\rput(1,1){{\tooltip{\textcolor{red}{$\bullet$}}{1,1}}}
\rput(-1,-1){{\tooltip{\textcolor{red}{$\bullet$}}{-1,-1}}}
\end{pspicture}
\end{center}

Das ist ein kleiner \tooltip{\textcolor{red}{Test}}{Das ist ein
Test-Tooltip!} im Text!

Das funktioniert natürlich auch mit Formeln:
\tooltip{\textcolor{red}{$y = \frac{a^3}{a^2 + x^2}$}}{Witch of Agnesi /
Versiera der Agnesi}
\end{document}

Herbert Voss

unread,
Apr 19, 2010, 5:27:03 PM4/19/10
to
Am 19.04.2010 23:07, schrieb Josef Kleber:

> So you only need a tooltip, right? A while ago i played with an example
> presented by Alexander Grahn. It works only with the
> latex->dvips->ps2pdf route, but that doen't semm to be a problem in your
> case! ;-)
> Maybe it also works in your case:

works fine ...

\documentclass{article}
\usepackage{pstricks-add}
\usepackage{hyperref}
\newcounter{tooltip}
\newcommand\tooltip[2]{%
% arg #1: text to put on the page
% arg #2: tooltip text
\pdfmark[#1]{
pdfmark=/ANN,
Subtype=/Widget,
Raw={
/TU (#2)/T (tooltip \thetooltip)
/FT/Btn/Ff 65536/H/N
}
}%
\stepcounter{tooltip}%
}

\begin{document}
\begin{center}
\begin{pspicture}(-2,-2)(2,2)
\psaxes(0,0)(-2,-2)(2,2)

\psTextFrame[linestyle=none](-1,-1)(1,1){\tooltip{\space\space}{Origin}}
\end{pspicture}
\end{center}

\end{document}

Herbert

Alan Munn

unread,
Apr 19, 2010, 9:17:46 PM4/19/10
to
In article <hqiffj$r16$03$1...@news.t-online.com>,
Herbert Voss <Herber...@FU-Berlin.de> wrote:

Perhaps it would be easier to make the diagram in TikZ, which then can
use the cooltooltips, which depend on pdflatex.

(I don't know if the diagram Ed posted was just super simple one or
not.) But most things you can do in pstricks you can also do in TikZ,
and if the cooltooltips is so necessary, it would probably be worth the
effort to try. Here's a version of what I think you want, Ed.

\documentclass{article}
\usepackage{tikz}
\usepackage{cooltooltips}
\begin{document}
\usetikzlibrary{decorations.text}
\begin{tikzpicture}
\setlength{\fboxrule}{0pt}
\setlength{\fboxsep}{0pt}
\draw[step=.2cm,gray] (0,0) grid (5,5);
\draw[step=1cm,very thick] (0,0) grid (5,5);
\draw (.5,.5) node (O) {{\cooltooltip [0 0 0] {Origin} {This is the
origin of the graph.} {}{} {\color{green}\rule{1cm}{1cm}}{}}} (1,1);
\draw (4.5,4.5) node (R) {{\cooltooltip [0 0 0] {Corner} {This is the
top right corner of the graph.} {}{} {\color{red}\rule{1cm}{1cm}}{}}}
(5,5);
\draw (1,4) node (L) {{\cooltooltip [0 .2 1] {Corner} {This is the top
left corner of the graph.} {}{} {\rule{1.3cm}{1.3cm}}{}}} (1,5);
\draw[fill,blue] (1,4) circle (1);
\draw[line width=3pt] (0,2) -- (4,3);
\foreach \x in {0,.1,...,4} {
\node at (\x,2+\x*.25) {{\cooltooltip [0 0 0] {Line} {This is a
line.} {}{} {\rule{2pt}{2pt}}{}}};}
\foreach \x in {0,1,...,5} {
\node[left=3pt] at (0,\x) {\sffamily\bfseries\x};
\node[below=3pt] at (\x,0) {\sffamily\bfseries\x};}
\end{tikzpicture}

\end{document}


Alan

0 new messages