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

4
votes
2answers
234 views

How to draw a point if the angle value and radial function are both given in algebraic (infix) form?

\documentclass[preview,border=12pt]{standalone} \usepackage{pst-plot} \psset{polarplot} \def\RPN#1{2 #1 10 div exp} \def\Infix#1{2^(#1/10)} \begin{document} \begin{pspicture}[showgrid=true](-3,-3)(3,...
0
votes
1answer
156 views

How to make a radian argument still get interpreted in radian when working with \psplot in PostScript form?

When using \psplot in PS form (or algebraic=false) the interval must be specified in degrees. However, sometimes, I need algebraic=false but interval is given in radian. Is it possible to achieve this ...
7
votes
3answers
398 views

Nautilus Shell in TikZ or PSTricks

Any ideas on how to recreate the cross-section of a nautilus shell like in the diagram below:
17
votes
3answers
288 views

How do I have to invoke \expandafter for a macro with multiple arguments?

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-node} \begin{document} \begin{pspicture}[showgrid](-5,-5)(5,5) \pnodes{A}(-2,3)(3,4)(2,-1)(-2,-4)(-4,0) \def\points{(0,0)} \...
15
votes
2answers
748 views

Polygon drawn with an offset

I'm looking for a more automated way to draw an area around a number of PStricks nodes. The area should be offset by a specific amount so that it will completely contain the vertices inside of it....
6
votes
2answers
120 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 ...
5
votes
2answers
288 views

Closed curve in PSTricks

Consider the following example: \documentclass{article} \usepackage{pstricks-add} \def\side{% \psline(-2,2)(-1,2) \psarc(0,2){1}{180}{0} \psline(1,2)(2,2) \psline(-1,1)(0,2)(1,1) } \begin{...
6
votes
2answers
95 views

pstricks-doi package conflict?

The following does not work: \documentclass{minimal} \usepackage{doi} \usepackage[pdf]{pstricks} \begin{document} hello world \begin{pspicture}(1,1) \psline(0,0)(1,1) \end{pspicture} \end{...
8
votes
2answers
265 views

too tricky for pstricks?

I'm trying to copy the graph of a piecewise function created in GeoGebra into a LaTeX document but all I see are the axes -- no curves. I'm running TexShop and compiling with XeLaTex. In the log file ...
7
votes
2answers
344 views

Numerical calculations using PSTricks

Assume I have defined a constant \valueA as \def\valueA{25 2 sqrt sqrt mul } I would like to devide this value by the square root of 2, so I tried \pstFPdiv\valueB{\valueA}{2 sqrt} but this is ...
8
votes
1answer
253 views

Can TikZ emulate PSTricks' inline \Rnodes, scattered along a complex equation?

PSTricks' \Rnode makes it easy to add annotations to a complex equation typeset by (La)TeX: Simply add \Rnodes around existing elements of the equation, and the mathematical typesetting is ...
26
votes
1answer
1k views

Can TikZ dashed lines emulate PSTricks dashed lines?

Dashed lines differ between TikZ and PSTricks: PSTricks provides symmetry about the midpoint, and full dashes are guaranteed at each end. Can TikZ be configured to achieve this? (By default TikZ does ...
7
votes
2answers
141 views

\psdiabox is too big

How can I reduce the size of a \psdiabox, for instance: \documentclass[10pt,a4paper,twoside]{scrbook} \usepackage{pstricks} \usepackage{pst-all} \begin{document} \psset{unit=0.35} \begin{pspicture}(...
13
votes
3answers
546 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 ...
4
votes
1answer
176 views

Strange color in PSTricks

I draw a figure in pstricks, the code is here: \documentclass{minimal} \usepackage[dvipsnames]{pstricks} \definecolor{bg}{cmyk}{0,0,0.1,0} \begin{document} \begin{pspicture}[linewidth=1.5pt](-2,-1....
6
votes
3answers
892 views

Problem with \overlays

I latex the following tex. I got error in the line below \end{slide} as Undefined control sequence } I found out that the problem is related to \overlays. \documentclass[pdf,umbc4,slideColor,...
7
votes
1answer
109 views

Why are my post script commands not getting passed the LaTeX compiler?

The following MWE \documentclass{article} \usepackage{pstricks} \begin{document} \begin{pspicture} \rput{!240 6 div}(0,0){Hello World} \end{pspicture} \end{document} is not able to parse the ...
2
votes
2answers
122 views

Not equal spacing on both sides of PSTricks figure

Taking the code of PSTikZ's answer from "PSTricks figure way too big; normal scaling seems not to work" (and putting an \fbox around it to illustrate the problem), I get the following: \documentclass{...
5
votes
2answers
160 views

PSTricks figure way too big; normal scaling seems not to work

Consider the following example: \documentclass{article} \usepackage{pstricks} \begin{document} \begin{figure} \def\radius{19.2} \def\lige{33.3} \newlength\R \R=\radius\psunit \newlength\hW \hW=\...
5
votes
2answers
843 views

Draw an inclined ellipse in PStricks

I would like to draw an inclined ellipse in PStricks, but seems the angle command does not work here. How can I make my ellipse inclinde? \psellipse[linestyle=dashed,angle=-30,linecolor=red,dash=...
1
vote
1answer
921 views

Flashy text in beamer presentation

I'm creating a beamer presentation and I'm looking after some effects I could include to make my work more attractive. Is there a way to make a flashy text? I'm thinking about an alarm clock: you know ...
2
votes
0answers
101 views

Programmatically converting an integer into bits with graphical output [duplicate]

I just stumbled upon this interesting question about "how to automatically draw tree diagrams of prime factorization with LaTeX" and it rang a bell. I 'd like to create a command that displays the ...
3
votes
1answer
1k views

how to set font size in “\rput”?

I can set the font in \rput like this \rput(-0.76,0.7){\tiny $1$} But how can I set more exact font in rput? for example: 6pt?
1
vote
0answers
23 views

Problems using pst-node/Undefined Control Sequence— PStricks [duplicate]

The code is: \documentclass{article} \usepackage{pstricks} \usepackage{pst-plot} \usepackage{pst-node} \usepackage{pst-circ} \usepackage{pst-text} \usepackage{pst-tree} \usepackage{pst-coil} \...
4
votes
2answers
144 views

psgo.sty the goboards are not drawn

I use TeXlive on Debian Wheezy. I have psgo.sty installed (in texlive-games). I have downloaded psgomanual.tex. After I enter the command latex psgomanual.tex I get a .dvi file. With lots of warnings ...
54
votes
8answers
4k views

How to automatically draw tree diagram of prime factorization with LaTeX?

I want to have a simple interface to automatically draw tree diagrams of prime factorization. For example, by invoking the following code, \PrimeTree{36} \PrimeTree{90} \PrimeTree{112} \PrimeTree{...
3
votes
2answers
731 views

Redefining axes label in pst-plot

I am trying to redefine the labels for x-axis in a pst-plot diagram by putting \makeatletter \def\ps@@@hlabel#1{\small(#1)} \makeatother in the preamble (see top of page 25 in the manual) but then ...
2
votes
1answer
111 views

Missing data points in PSTricks plot

Consider the following example: \documentclass{article} \usepackage{pst-plot} \begin{document} \psset{xunit=0.1,yunit=0.002} \savedata{\data}[{1924,300},{1928,510},{1932,310},{1936,880},{1948,700},...
5
votes
1answer
96 views

Confusing Problems with LaTeX3/expl3 \pdftex_if_engine:TF Switch

For a number of days I've been confused with some problems I had when using the \pdftex_if_engine:TF switch in a LaTeX3/expl3 class of my own. I thought it would be equivalent to the \ifpdf switch, ...
2
votes
1answer
814 views

Grid and tick marks in the same PSTricks picture

Consider the following example: \documentclass{article} \usepackage{pst-plot} \begin{document} \psset{ xunit=0.05, yunit=0.003, algebraic } \begin{pspicture}(-17,-140)(213,2540) % Axes \...
2
votes
1answer
182 views

Vertical grid lines not showing when using `xticksize`

Consider the following example: \documentclass{article} \usepackage{pst-coil,pst-plot} \begin{document} \begin{figure} \centering \psset{unit=0.6} \begin{pspicture}(-2.0,-0.7)(18.2,11.2) % ...
3
votes
1answer
911 views

Axis specific subgrid devision using \psgrid

If I want to devide a grid into subgrids using PSTricks, I use the command \psgrid with the option subgriddiv=<integer>. This, however, sets the number of subgrids to the same on both axis; is ...
3
votes
1answer
126 views

How to get a tight output when using pst-tree package and standalone class?

\documentclass[preview,border=3pt,varwidth]{standalone} \usepackage{pst-tree} \psset{levelsep=2,treesep=-2,angleA=90,angleB=-90,arm=12pt} \def\psedge#1#2{\ncangle{#2}{#1}} \begin{document} \psTree{...
1
vote
1answer
882 views

PSTricks, how to move and rescale a picture

How can I scale and change position of a PSTricks picture on a beamer slide? I draw a picture and save it in tex format using Inkscale. This is an example of the beginning of the picure %LaTeX with ...
1
vote
0answers
311 views

Revisiting auto-pst-pdf Fundamental Problem (<jobname>-pics.pdf not created) [closed]

The code provided as an answer on this post used to work. To ease things, I reproduce it here, only in a more condensed form since I'm interested just in the PSTricks part -- the minted part working ...
4
votes
1answer
65 views

pstricks and caa.cls

I have a TeX file that my prof gave me and I can't get it to work. First, I don't know what package allows me to use \documentclass[12pt,reqno]{caa}. Next, I have a bunch of pscurves, pslines, and ...
3
votes
0answers
74 views

angular spring macro

Does anyone have a macro for an "angular spring" ? I'm looking for something similar to that in pst-coil (PS-Tricks package) but the geometry of the "spring" is not straight but an arch (with ...
14
votes
2answers
1k views

How to draw spherical triangles?

Does anyone know how to draw spherical arcs and spherical triangles using LaTeX?
4
votes
1answer
193 views

How to do a surface with pstricks using data from a surveying?

For each point of the grid a have the coordinates (X,Y) and height (Z), like: X 1 2 3 1 2 3 1 2 3 Y 1 1 1 2 2 2 3 3 3 Z 2 1 0 4 5 1 8 4 3
6
votes
2answers
1k views

Resources for PSTricks examples

What resources for PSTricks examples do you know? Please feel free to add nice work of your own here as well! Background: I am constantly looking for PSTricks examples to get ideas how to solve my ...
4
votes
1answer
142 views

Drawing of PSTricks figure not precise

Consider the following code: \documentclass{article} \usepackage{pstricks-add} \usepackage[locale=DE]{siunitx} \ExplSyntaxOn \cs_new_eq:NN \calculate \fp_eval:n \ExplSyntaxOff \def\ORb{\...
5
votes
1answer
176 views

Need for loading of expl3 code?

Consider the following example: \documentclass{article} \usepackage{pst-plot} \usepackage[locale=DE]{siunitx} % Self-brewed macro. \def\andel#1{% \calculate{#1/(\Nord+\MidtVest+\Oestjylland+\Syd+\...
6
votes
1answer
118 views

Wrong x-axis with pst-plot

Consider the following example: \documentclass{article} \usepackage{pst-coil,pst-plot} \def\tilskud#1#2{% \psline[linewidth=1.5pt,linecolor=red]% (!#1 1986 sub 0)% (!#1 1986 sub #2 8 sub 2 ...
2
votes
1answer
124 views

pstricks output garbled on Ubuntu 13.04

I recently installed Ubuntu 13.04 and tried to recompile a pstricks document I had previously created on an older version of Ubuntu. However all the images came out wrong and consist of all the text ...
3
votes
1answer
665 views

Issue on pdf(La)TeX with named colors in dvipsnames

When compiled on pdfLaTeX, the following code (and MWE) returns a PostScript error message: \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{pstricks} \usepackage[pdfcrop={--hires}...
13
votes
3answers
489 views

Draw Polygonal Number Using PSTricks (or TikZ)

I would like to draw the following using PSTricks (or TikZ): (Found on http://i1.wp.com/mathandmultimedia.com/wp-content/uploads/2012/08/polygonal-numbers.png.) I can do it myself using an ...
3
votes
1answer
122 views

Good way to cut off extra range data in listplot

Using listplot, is there a way to cut off extra range data? The option yEnd=10 simply removes the points above y=10 so that it changes the overall shape of the curve. Here is example code: \...
1
vote
0answers
153 views

How to load pstricks private header files under MiKTeX? [closed]

Under MikTeX, the method to load private header files containing custom postscript macros seems to have changed. What is the current preferred method for including such macros? For years I have ...
9
votes
3answers
323 views

PSTricks: Wrong axis labels

Consider the following example: \documentclass{article} \usepackage{pstricks-add} \def\sandsynlighed#1#2{% \psframe[ linecolor=red, fillstyle=solid, fillcolor=blue!50 ](#1,0)(!#1 \...
10
votes
1answer
531 views

PSTricks figure turned 90 degrees

Consider the following example: \documentclass{article} \usepackage{pstricks-add} \def\RPut(#1)#2{% \rput[r]{90}(!#1 1980 sub 2 div 0){#2 \quad} \rput[l]{90}(!#1 1980 sub 2 div 0){\quad #1} } \...