PSTricks is a set of macros that allow the inclusion of PostScript code (e.g. drawings) directly inside (La)TeX code. This tag is compatible with the tag {diagrams}.

learn more… | top users | synonyms

41
votes
5answers
3k views

3D helix torus with hidden lines

How can I generate the above image using TikZ (possibly other methods will work if they produce better looking results)? I would like to have a nicely shaded (not so dark image) without gridlines ...
1
vote
0answers
321 views

PSTricks doesn't work in Linux [closed]

I'm tryng to compile in Linux (Ubuntu 12.04 + Texlive-full) a document using latex>dvips>ps2pdf. This document include graphics in .eps and has a pspicture code. When I compile this document in ...
3
votes
1answer
95 views

What is the drawback (if any) when loading pst-all?

I am curious whether or not there is a drawback when we always load pst-all. Is there such a drawback or side effect?
8
votes
1answer
446 views

String diagrams for monoidal functors a la McCurdy

Almost surely you don't know who Micah McCurdy is, but here is a sample of his diagrams, on pages 20-21, for example, or page 27 for something fancier. I asked him how he did them, and unfortunately ...
12
votes
2answers
4k views

PSTricks error “Undefined control sequence <recently read> \c@lor@to@ps”

I have a problem with this file tex: \begin{document} \begin{figure} \begin{center} \begin{pspicture}(0,0)(1,3.8) \psline{-<}(0,0)(0,.2) \psline{-}(0,.2)(0,.4) \psline{*->}(0,.4)(0,.9) ...
4
votes
2answers
144 views

How to make parentheses usable as macro delimiters when the macro is passed as a point in RPN notation?

How to make ( and ) usable as macro delimiters when the macro is passed as a point in RPN notation? \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \def\f#1{#1 2 exp 1 sub} ...
2
votes
1answer
341 views

Why does \psplot need higher plotpoints when plotting a function on the left of the function's asymptote?

The following animation shows the behavior intuitively. \psplot seems to work in an asymmetric way. It can plot the right part with the default plotpoints but it is not the case when it plots the left ...
8
votes
2answers
262 views

How to draw tangens of arbitrary functions y=f(x) at given point (x,y) of f(x) using PStricks?

I'm relative new using PStricks and I don't know exactly how to draw a tangens of y=f(x) at a given point of the curve. I know, by simple mathematics that can be done by constructing the associate ...
13
votes
2answers
880 views

Is it possible to fill the complement of (A union B union C) with a solid color but the remaining regions remain transparent?

Please ignore the binary numbers. Without finding the intersection points in advance, is it possible to fill the complement of (A union B union C) with a solid color but the remaining regions ...
17
votes
4answers
2k views

How to generate all possible Venn diagrams (with the case below) efficiently?

I can draw Venn diagrams but now my question is more complicated than just drawing Venn diagrams one by one. I need to draw all possible Venn diagrams efficiently. I need a combinatorical approach ...
4
votes
2answers
742 views

TeXworks + pdflatex + PSTricks autopp suffix problem

I have managed to make PSTricks work with TeXworks. However after compilation it adds -autopp to the basename of the pdf file, e.g. report.pdf becomes report-autopp.pdf. As a result TeXworks is not ...
4
votes
1answer
757 views

\rput does rotate my whole document

When using \rputwith the rotation parameter it seems to rotate my whole document if the rotated text is longer then the non-rotated text. See this minimal example: \documentclass[dvips]{article} ...
5
votes
1answer
1k views

How to increase the size around text in \psframebox

when using \psframebox the size between text and corners of the box is really small. Is there a way to increase that? My minimal example: \documentclass[dvips]{article} \usepackage{pst-all} ...
2
votes
1answer
1k views

Converted DVI to EPS is larger then the underlying graphic

I use this code for generating a graphic: \documentclass[dvips]{article} \usepackage{pst-all} \usepackage{pst-3dplot} \usepackage{pst-eps} \usepackage{pst-dbicons} \begin{document} \pagestyle{empty} ...
2
votes
1answer
216 views

listplot and postscript

Is there a possibility with listplot to make lines from a point which is defined? Example... Fileinput: -0.013,0.471 0.044,-0.294 -0.069,0.446 0.025,-0.385 0.038,-0.448 0.073,-0.365 0.375,0.045 ...
6
votes
2answers
362 views

How to use angle option when using ([angle=number]{node1} node2) notation?

According to PSTricks manual, as shown in the screenshot below, there is an optional angle option. Unfortunately, the example above does not show how to use angle option. I have tried using ...
6
votes
1answer
222 views

Is it possible to simplify the following expression by defining a global operator?

The following MWE is the simplified version of the real scenario. I want to simplify (!\psGetNodeCenter{A}\psGetNodeCenter{B} A.x B.x add A.y B.y add) to (!A B AddNode). Is it possible? ...
1
vote
2answers
2k views

How to pass the abscissa of a node to the first 2 mandatory arguments of \psplot?

How to pass the abscissa of a node to the first 2 mandatory arguments of \psplot? I have tried \psGetCenterNode but it produced an error in PS interpreting phase. ...
4
votes
3answers
2k views

Beginners Guide to PSTricks for TeXShop users for math functions

I am looking to get help to plot tangent function. I find TikZ insufficient capability on TeXShop. I am thinking about PSTricks and TeXShop. Is there any useful documentation or tutorial on packages ...
8
votes
2answers
189 views

How to pass a macro as a value for a key?

I want to pass a macro to a showgrid key. The macro can be redefined later. Its possible values are top, bottom, false, true. The following MWE produces a blank page. How to fix it? ...
1
vote
1answer
140 views

How to pass a node as the angle argument of \uput?

I am attempting to solve my own problem How to rotate the label such that its base line is parallel to the bisector? with the most elegant approach, i.e., passing a node as an angle argument of \uput. ...
2
votes
1answer
1k views

How to run PSTricks in TeXShop

Why can't I run the following command in my TeXShop? \documentclass{article} \usepackage{pstricks-add} \begin{document} \psset{algebraic=true} \pspicture(-2,-0.5)(2,2) ...
6
votes
2answers
295 views

How to rotate the label such that its base line is parallel to the bisector?

How to rotate the label counter clockwise such that its base line is parallel to the bisector? \documentclass[border=0pt,pstricks]{standalone} \usepackage{pst-eucl} ...
2
votes
1answer
210 views

Why does the objects get shifted to the left when using clipping?

Without clipping, the output position is correct: With clipping, the output position is wrong as it gets shifted to the left: \documentclass[pstricks,border=12pt]{standalone} ...
8
votes
3answers
1k views

Why don't \pscircle and \psellipse move the current point before drawing their shapes?

I have tested all PSTricks closed curves: \psframe \psccurve \pspolygon \pswedge \psellipticwedge \pscircle \psellipse and I noticed that only \pscircle and \psellipse do not move the current ...
1
vote
1answer
133 views

How to define a global constant or a global RPN function without \pstheader?

I want to put \pstVerb { true setglobal globaldict begin /side 4 def /potocar {2 copy cos mul 3 1 roll sin mul} bind def end false setglobal } in the preamble instead of in ...
3
votes
1answer
206 views

Inserting text containing braces in pstricks

I'ld love to create a Database-Symbol with pst-dbicons: \rput(5.5,3.25){\database{3.5cm}{2cm}{Datenbank(en)}} The problem is, that there are braces inside of the text. When I remove them, it works, ...
17
votes
4answers
16k views

How to draw an ellipse?

As I know, I can draw a circle using: \draw (1,0) circle (2) I try this kind of method to draw a \draw ellipse, failed. Would you tell me how to draw a ellipse? What's wrong with the code below? ...
3
votes
1answer
162 views

Confused with different behaviors of nodes and literal points when using origin option

I have not found a document explaining my problem below. In my understanding, if \pnode(1,1){A} then \pscircle[origin={A}](A){1} must be identical to \pscircle[origin={1,1}](A){1} ...
9
votes
2answers
370 views

Can we use a single frame to create the following effect?

I want to create a slide to show how the clipping works as shown in the following animation. I used two frames, the last frame is needed because I want to hide the unwanted (trimmed) parts of ...
7
votes
2answers
2k views

How to include a PSTricks animation into a beamer?

I'm trying to create an animation to include into a beamer. I figured (naively I suppose) a way to do that is to create a Pdf with animate package, and then \includegraphics it into my beamer. ...
8
votes
2answers
670 views

How to make inner and outer regions transparent?

The white regions are required to be true transparent (preserved in both PDF and PNG). How do you do this in TikZ or PSTricks? The following diagram is just an example for illustration.
21
votes
4answers
372 views

Does the order of specified key-values matter?

The following screen shot shows how the order of specified key-values affects the output. When using dx=\psPiH,xunit=\psPi. When using xunit=\psPi,dx=\psPiH. Minimal Working Example ...
1
vote
0answers
180 views

Problem with the pst-geo bundle [closed]

I have tried to compile the code in this example from Political map in LaTeX following the latex->dvips->ps2pdf sequence but in the very first stage (latex compilation) I got the error message ...
3
votes
2answers
406 views

Why does \pscustom fail to fill the enclosed region?

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \def\Major{3}% semi major \def\Minor{2}% semi minor \def\Xo{4}% distance from origin to ellipse center \def\Theta{60} ...
6
votes
1answer
230 views

How to pass PostScript expression to nodesep and offset when using ([…]node) syntax?

Quoted from pst-news13.pdf on page 3: The labelsep is the first – optional – argument of \uput. It is now possible to use the PostScript notation for this length, eg {! 45 sin 3 mul}. Then the ...
5
votes
2answers
2k views

Plotting Trigonometric Functions

I was trying to plot graph of sine functions. I found PSTricks and tried using it, but I have no idea whether there are more standard / more appropriate packages to do this. Here is what I did (which ...
9
votes
1answer
348 views

How to fill a region bounded by a character and a graphic object with a color?

There are 5 white regions bounded by the ellipse and character R as shown in the following figure. I want to fill EACH of these regions with a UNIQUE/DIFFERENT/DISTINGUISHABLE color. How to do ...
2
votes
2answers
115 views

Why does \psPrintValue not allow 2 \rput to work at the same time?

For each compilation, only one of the 2 \rputs can be used. Attempting to activate both will produce a strange output which is only the first \rput can work. \documentclass[border=0pt]{standalone} ...
0
votes
2answers
200 views

How to pass a constant defined in \pstVerb as the most right argument of \rput?

\documentclass[border=12pt]{standalone} \usepackage{pstricks-add} \def\i{1} \begin{document} \begin{pspicture}(4,4) \pstVerb{/two \i\space 1 add def} \rput(2,2){<the value of ...
3
votes
2answers
340 views

How to crop a pstricks figure

I wish to create a figure using pstricks code, and then to display only a cropped region of the figure. I thought that the arguments to \begin{pspicture}(...,...)(...,...) would allow me to do this, ...
7
votes
2answers
341 views

defining Postscript procedures with global scope

How can I define a Postscript procedure whose definition survives page breaks, that is, which has global scope? Here is a trivial example, where the procedure invocations after a \newpage fail during ...
7
votes
2answers
3k views

Drawing 3D cylinder

I need to draw a lot of 3D cylinders with different dimensions. Has anyone maybe already defined a command like \3Dcylinder{x}{y}{z}? I found 3D bodies in TikZ and tried the third answer. But I don't ...
1
vote
1answer
71 views

How to use a macro as the point arguments of both pspicture and \psframe?

I forgot the rule to use \expandafter such that \rect can be used as the point arguments of both psframe and pspicture. \documentclass{standalone} \usepackage{pstricks} \def\rect{(-3,-3)(3,3)} ...
29
votes
2answers
4k views

What is the clearest way to graph a piecewise function?

I have a function defined as: How can I graph that using functions instead of coordinates? I'm currently working with pgfplots but I'm open to something else if it's better.
3
votes
1answer
154 views

How to avoid setting hard-coded values to the point arguments of pspicture?

I want to shrink and expand the canvas based on the 2 variables \Base and \Angle. The following code still use a hard-coded value for the ordinate of pspicture, which is equal to 6, for example. I ...
2
votes
1answer
167 views

How to use a \pstVerb constant as the angle arguments of \uput?

How to use alpha as the angle arguments of \uput? \documentclass[border=0pt]{standalone} \usepackage{pstricks-add} \pstVerb{ /theta 45 def /alpha theta 90 sub def /weight 1.5 def } ...
10
votes
2answers
189 views

How do I know that w must not be used?

I have a project to draw something that is more complicated than the following. Apparently I cannot use w after invoking \psaxes with [$x$,0][$y$,90]. I found it after struggling for 1 hour. ...
3
votes
2answers
213 views

Why does \ncbar seem to ignore angleB?

I have used \ncbar before with success and it worked perfectly however the following code: \documentclass{article} \usepackage{pst-all} ...
4
votes
2answers
466 views

Is there a “smarter” way to know the size of \psbarcode?

The size of 2D barcode depends on the first argument of \psbarcode. I usually do trial and error to find the size of \pspicture such that I get a tight output. \documentclass{article} ...