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

6
votes
1answer
142 views

How to write a bounding box information in PostScript to an external file and read it in TeX at the second compilation?

Scenario I want to create a new environment, e.g., pscanvas that does not need any size specification but just a unique filename. It can contain any graphic objects that pspicture can contain. Thus ...
39
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 ...
3
votes
1answer
77 views

PDFTricks with standalone class

This is a PDFTricks question much more than a PSTricks question. I am trying to use PDFTricks to compile a PSTricks document with the standalone class. I believe I have followed the manual's ...
2
votes
2answers
66 views

PSTricks with standalone class and newpage or pagebreak

Can I use page breaks with the standalone class with PSTricks? Are there limitations? Or is there some mistake in my code? I have been nearly successful in running the code below with PSTricks and ...
4
votes
2answers
601 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
3answers
107 views

What is the RPN operator defined in PSTricks to convert an infix expression to the postfix one?

The following code does not compile as I failed to convert the abscissa from infix to postfix. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} % defining an RPN operator that ...
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. ...
7
votes
3answers
200 views

How to automatically draw the images of a point placed between 2 inclined mirrors?

Consider a point X placed between two inclined mirrors as follows. \documentclass[pstricks,border=20pt,12pt]{standalone} \usepackage{pst-eucl} \def\Angle{37}% extreme case in which 360/\Angle-1 is ...
2
votes
1answer
131 views

Multiple files with new command causes undefined control sequence

I am working on a scientific paper and recently I moved from Ubuntu with TeX Live to Mac OS. My document is splitted on more .tex files, to make it easier to work over it. With my old latex machine I ...
1
vote
1answer
162 views

Example from PSTricks manual not rendering

Can you set me straight in the very first attempt to use PSTricks drawing features please? The ultimate goal is to draw a triangle with the vertices angles marked on the inside with \alpha, \beta, and ...
3
votes
1answer
112 views

Building a flowchart with PSTricks

I am building several flow-charts similar to this. They represent a procedure (algorithm) for dividing a triangle. Right now, I use the following code: \newcommand{\thetriangle}{ ...
2
votes
1answer
118 views

LaTeX table creation

I am new to LaTeX and really stuck in creating a table. A table created in Word is attached. Can someone help me create this table in LaTeX as it is? I tried, but couldn't connect the arrows and ...
7
votes
3answers
77 views

pdfLaTeX with PSTricks: is it possible to get one .pdf for each figure?

I know that it is possible to use pdfLaTeX in a document with PSTricks figures by adding \usepackage[pdf]{pstricks} in the preamble and then running pdflatex --shell-escape <file> Then, ...
2
votes
1answer
73 views

pst-3dplot and drawing cylinders

I am drawing a cylinder with \psCylinder from pst-3dplot, as shown here in a MWE from the manual: \documentclass{article} \usepackage{pst-3dplot} \begin{document} \begin{pspicture}(-3,-2)(3,7) ...
4
votes
1answer
60 views

Using PSTricks with TeXmaker

I want to do some drawings using LaTeX. I use TeXmaker. What the commands that I need to set up to start using the PSTricks?
8
votes
4answers
366 views

Drawing cylinder with PSTricks

I am trying to draw a simple cylinder with PSTricks, similar to what is attached. Is there a smart way to do this, or do I just have to manually draw each line? If there is no other way, then it is ...
2
votes
1answer
44 views

pst-pulley produce big red dots

Based on the document I use the pst-pulley package by XeLaTeX in TeX Live 2013, but (without grid) produces the big red dots. What is wrong? Here the codes: \documentclass[11pt]{article} ...
9
votes
1answer
176 views

Pie Chart with text outside pie

I'm able to draw pie chart using tex code mentioned below: \documentclass[landscape,a3paper,11pt]{article} \usepackage{pstricks-add} \usepackage{pgfplots, pgfplotstable} \begin{document} ...
6
votes
1answer
135 views

Pie Chart : Overlapping Text

I'm able to draw pie chart using tex code mentioned below: \begin{center} \begin{pspicture}(-7,-4)(7,4) \psset{unit=1.2} ...
7
votes
2answers
130 views

What causes two identical instances to produce different result?

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \pstVerb { /updateCP {2 copy CPy add /CPy ED CPx add /CPx ED} bind def /updateA {1 sub sqrt 1 exch atan Angles add ...
3
votes
0answers
62 views

Why can't the abscissa and ordinate obtained from \psGetNodeCenter be reflected? [duplicate]

Consider the following simplified code. \documentclass[pstricks,border=2cm]{standalone} \usepackage{pst-eucl} \psset{saveNodeCoors} %\def\xy#1{!\psGetNodeCenter{#1} #1.x #1.y}% cannot be ...
3
votes
1answer
61 views

How to use \psVector as a replacement for \rlineto in drawing Theodorus' spiral?

Consider the following minimal working example. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \begin{pspicture}[showgrid](-5,-5)(5,5) ...
4
votes
1answer
64 views

XeTeX pstricks larger page size is cropped to A4

In a Plain-XeTeX document, if I set the page size to anything bigger than the default page size, (A4 in my case) then all the pstricks elements beyond the size of an A4 page are trimmed of, so only a ...
8
votes
2answers
189 views

How to make my protractor able to accept both points and nodes?

I want to make my \protractor can accept points in all available format defined in PSTricks. How to do this? \documentclass[pstricks,border=12pt]{standalone} \SpecialCoor ...
4
votes
1answer
71 views

How to use PostScript for to plot the sum of cos(n*x) for n=0 to n=100?

I want to plot the function f(x) which is the sum of cos(n*x) for n=0 to n=100. The domain is from 0 to 2π. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \begin{document} ...
5
votes
1answer
77 views

How can I write accented letter “ő” in PSTricks?

I'd like to write accented (hungarian) letters in PSTricks. With the solution below I can write "é", "á" and other similar characters but this doesn't work for "ő". Here is what I tried: ...
9
votes
1answer
131 views

Why does \nodexn{(1,1)}{A} produce strange N-A.x and N-A.y?

\documentclass[preview,border=2cm]{standalone} \usepackage{pst-tools} \usepackage{pst-node} \psset{saveNodeCoors} \begin{document} \section*{With pnode} \begin{pspicture}(3,3) \pnode(1,1){A} ...
4
votes
1answer
116 views

Cabinet projection in PSTricks (2)

I'd like to draw 3D-objects in cabinet projection with angle α=26.565° (i.e. atan(α) = 0.5) and scaling factor k=0.5590 = sqrt(5)/4, because the objects should be drawn on a grid, as in the left ...
4
votes
1answer
46 views

How do I ignore lines to points with y=0 using pst-plot and a logarithmic y-scale?

I am using pst-plot to visualize data sets in linear x and logarithmic y scale. The data set should be plotted by connecting all points with a solid line style. This all works fine by using ...
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?
12
votes
1answer
2k 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) ...
3
votes
2answers
55 views

Moving the common angle to \pstVerb produces incorrect result

Consider the following complete code first. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \begin{pspicture}(-5,-5)(5,5) \def\points{(0,0)(1,0)}% ...
5
votes
1answer
93 views

How to draw a line from the origin to the last point of \psrline?

Consider the following code to draw the Theodorus' spiral. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \begin{pspicture}[showgrid](-5,-5)(5,5) ...
5
votes
2answers
134 views

Is it possible to exit from the PostScript expression and abort the drawing?

I just want to draw a dot if the condition is satisfied and otherwise cancel the drawing of the single dot. The following code is the simplified version of my real scenario. Please don't suggest other ...
2
votes
1answer
123 views

high resolution table of numbers

I'd like to design a table of numbers for poster-size printing, say like a multiplication table, so I'm looking for: high resolution, colors, pretty fonts. Does it sound like it could be done in ...
2
votes
2answers
66 views

How to change the label color of \psaxes?

\documentclass[pstricks,border=12pt,12pt]{standalone} \usepackage{pst-plot} \begin{document} \begin{pspicture}(-5,-1)(5.5,5.5) ...
38
votes
9answers
2k views

The Spiral of Roots in TikZ

How can one create a spiral of roots as shown in the diagram below: where one can use a command to draw more parts to the spiral. For example, a command like \sqrtspiral{1}, \sqrtspiral{2}, ...
6
votes
2answers
90 views

Macro psGTriangle leads to pdfLatex ignoring the figure

I've noticed that the pstricks macro psGTriangle, to draw triangles with Gouraud shading does not work in combination with auto-pst-pdf/pdflatex. There is no error message, the pspicture environment ...
2
votes
1answer
52 views

How to separately access the abscissa and ordinate of the current point?

Consider the following code. \documentclass[pstricks,border=12pt]{standalone} \SpecialCoor \begin{document} \begin{pspicture}[showgrid](-5,-5)(5,5) \pscustom { \psline(1,0) ...
41
votes
1answer
544 views

Given a PS interpreter, can pstricks be converted to pgf?

When producing pdf directly, PostScript code cannot be used, which means that pstricks macros do not work. Now, it is still possible to include pstricks code using external tools (running LaTeX on ...
5
votes
1answer
58 views

Problem Creating a Polar Grid using PSTricks

I am a MacTeX 2013 user that uses PDFLaTeX to create my files. After a recent update, the following code stopped producing a polar grid. I checked the documentation for any changes as well as the ...
10
votes
3answers
1k views

Define a “square” command

I try to define the following command, for drawing a square in pstricks: \newcommand{\square}[4] { \rput(#1,#2){\psframe[linecolor=#4](0,0)(#3,#3)} } I use it like this (for drawing a red square ...
29
votes
1answer
537 views

Randomly bouncing balls with constant tails in a spherical constraint

How easy is the following animation made with TikZ, PSTricks, and Asymptote? Use the following as a starting template to save your time. \documentclass[border=12pt]{standalone} \begin{document} . ...
5
votes
1answer
55 views

What makes the looping index in \foreach produce compile-time error?

Consider the following code and error message. \documentclass[pstricks,12pt]{standalone} \usepackage{pst-node} \psset{saveNodeCoors} \degrees[13] \begin{document} \makeatletter ...
6
votes
2answers
100 views

Problems to get two graphics in different pages with standalone

In the following MWE I get a single page with the two graphics within: \documentclass[multi]{standalone} \standaloneenv{pspicture} \usepackage[dvipsnames, svgnames, prologue]{xcolor} ...
13
votes
3answers
347 views

How to invert even-odd filling?

Consider the following code. It uses eofill filling rule where only the region bounded by odd number of strokes will be filled. Is it possible to invert this rule such that the region bounded by even ...
1
vote
1answer
54 views

Clash between animate and hyperref on pdfLaTeX

When I compile the MWE below on pdfLaTeX I get the error message `! pdfTeX error (ext4): destinations cannot be inside an XForm. right before the \newframe* command is read. I have tried by switching ...
5
votes
2answers
121 views

How to assign a random value to opacity key in PostScript phase rather than TeX phase?

I want to have a random opacity but I don't want to use fp package. Shortly speaking, is it possible to pass PostScript expression to opacity? Here is the minimal not-working example to save your ...
7
votes
1answer
120 views

How to use even-odd filling rule either as a clipper or with gradient?

I just noticed that even-odd filling rule can only be used for solid and hatched filling. Sometimes, I need even-odd rule for gradient and as a clipper. How to do so? My code speaks the details. ...
4
votes
2answers
110 views

How to adjust radius for \cnodeput and \circlenode?

I am trying to change the global default or customise individual size of the node plotted in the following code, however regardless what I do it seems I can only have two input for each node, either ...