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

1
vote
1answer
136 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
292 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
207 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
128 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
204 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
15k 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
161 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
368 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
649 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
371 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
177 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
401 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
227 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 ...
4
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
344 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
114 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
194 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
325 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
336 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
69 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
3k 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
152 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
166 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
209 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
457 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} ...
11
votes
1answer
2k views

How to produce Latex QR-Code (or in general 2d codes) as Vector graphic?

The pst-barcode package is great to produce bar-codes in all flavors. And it does 1d bar-codes like a charm. Also it is capable of generating 2d bar-codes with a command like this for a qrcode: ...
21
votes
3answers
1k views

Letterpress effect through PSTricks or Tikz

I have already typed in the META section of the website a post addressing the question as to how the letterpress (or engraving-like) effect in the headers of the site had been achieved. I know it can ...
11
votes
2answers
1k views

Drawing 3D Transformer with TikZ or PSTricks

Consider the picture of a transformer on the page: How do I draw this using either TikZ (which I have not used before) or PSTricks?
6
votes
2answers
497 views

How do you draw this prism in tikz/pstricks

The numbers are in Persian (side SB=6 and angle SBA=60 degrees).
12
votes
1answer
760 views

Creating figures of polytopes (in 3D): Is it worth switching from PSTricks to TikZ?

I used PSTricks a lot to create figures of polytopes. More recently, I have become aware of discussions going on about whether PSTricks or TikZ is the better choice for creating figures of all kinds. ...
4
votes
2answers
216 views

plot wide range of data with PSTricks

I want to use PSTricks in order to plot data in a file. In general I know how to do it but the problem now is that these data run from x=-2000...2000 and y=1.e-10...1e-3 so I get the "too large" ...
4
votes
2answers
485 views

Undesired behaviour of \parbox within figure environment

I want to put a \parbox in a figure that is drawn by pstricks. The pspicture environment is inside of a figure environment. As an example: \documentclass[singlecolumn, nofootinbib, ...
76
votes
3answers
4k views

Fundamental differences : PSTricks, TikZ/PGF and others

OK, since this is a pretty vague and subjective question. I need to set up some borders around the discussion that I intend to benefit from. But before anything, I certainly do NOT want to excite the ...
2
votes
1answer
214 views

unknown colors using fcol (pst-solides3d)

I am using the pst-solides3d package to draw polytopes in the following way: \begin{pspicture}[showgrid=false](-2,-0.5)(1.5,2.7) \psset{viewpoint=26 10 5,Decran=60} \psSolid[object=new, ...
3
votes
3answers
200 views

Is there a trick to iterate a set of multidimensional values with \psforeach?

I have, for example, a set of multidimensional values: {{red,1,12pt},{blue,3,10pt},{green,2,15pt}}. With \psforeach I want to iterate the values with 3 variables: \clr, \x, and \size. Is there a ...
2
votes
1answer
135 views

Convert from float to length

I am using \pst@divide to divide a length in half \setlength{\RLEN}{4cm} \addlength{\RLEN}{\OFFSET} \pst@divide{\RLEN}{2cm}\RLEN ... \setlength{\DIST}{2cm} \addlength{\DIST}{\RLEN} % does not work. ...
5
votes
2answers
1k views

Compilation issue with pdfLaTeX and auto-pst-pdf

I am using a lot of png/jpg images in a document, so I decided to use pdfLaTeX. The main issue of this approach is that PSTricks is not directly supported. Since I found a package (auto-pst-pdf) ...
18
votes
5answers
962 views

Convert font letters to vector format and fill with a pattern

I have worked with Illustrator and CorelDraw and I usually take fonts and convert them to curves after which I would fill in the curves with patterns, merge them with other vectors or the sort. Is it ...
4
votes
1answer
3k views

latex-dvips-ps2pdf

I use pdflatex, Windows7, and TeXnicCenter. I am interested in using \psbarcode in combination with \usepackage{auto-pst-pdf}. A possible solution is to use latex-dvips-ps2pdf. The question is how to ...
15
votes
2answers
1k views

How to attach a 2D rectangular image to a 3D curved surface with TikZ or PSTricks?

I want to do so called texture mapping which is to attach an image to a curved surface. How to attach a 2D rectangular image to a 3D curved surface with TikZ or PSTricks? For the sake of ...
2
votes
2answers
301 views

Declare the point for incomming arrows on nodes

is there a way to tell the a node, where the arrow shall arrive? At this example, the Arrow from Node B to A should arrive exactly in the middle of the "D" from "Dies". It should start on top-center ...
0
votes
1answer
812 views

How to draw a diagram for packets scheduling in networks or task scheduling?

I would like to draw a diagram for packets scheduling in networks similar to the this one: The same type of diagram (or very similar) can be used also for tasks scheduling. Can you please indicate ...
4
votes
3answers
948 views

How to translate a set of PSTricks objects and rotate it?

To illustrate the problem, consider a simple example with which you are familiar: A mechanical system that consists of a block lying on an inclined plane. I attached a Cartesian coordinate system to ...
3
votes
1answer
241 views

How to use dup which is one of PostScript RPN keywords?

According to the pstricks-add manual on near the last page, dup is used to duplicate the value of the previous stack. Duplicating can simplify an RPN expression. For the sake of simplicity, let's ...
3
votes
1answer
602 views

Superimposed Boxes in a flowchart with PStricks

I'm performing a flowchart using pstricks . The problem is how to do superimposed Boxes (in gray and light gray ) included in the flow chart like those in the picture below . Is there any specific ...