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

29
votes
2answers
1k views

How to plot a lattice of points on the surface of a torus?

I am doing a report on the Ising model, without going into the complex details of the model, in its two-dimensional form it involves a lattice of points. Which, when periodic boundary conditions ...
18
votes
1answer
3k views

How to draw nanotubes with TeX?

I am working in the field of Nanostructures and have to draw many figure like :
11
votes
4answers
2k views

How can I draw these polygons with shaded regions?

I don't know how to draw this by LaTeX.
22
votes
1answer
536 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 ...
15
votes
4answers
1k views

Can PSTricks or others draw the 4 common tangent lines of 2 “disjoint” circles without having to do extra calculations?

There are two disjoint circles. Their centers and radii are given. Without doing extra calculations, can we draw the 4 tangent lines using PSTricks (preferred) or others? I asked many Illustrator, ...
14
votes
3answers
1k views

Deactivating Anti-Aliasing when typesetting QR-Code

Using the following LaTeX-Code: \documentclass[a4paper]{article} \usepackage[pdf]{pstricks} \usepackage{pst-barcode} \begin{document} \begin{pspicture}(0.7in,0.7in) ...
12
votes
2answers
263 views

Is there another better way to have a region with gradient opacity?

My objective is to get a region with gradient opacity. In the following MWE, the region is a quarter of a disk on the top a bird. I made the gradient opacity by partitioning the sector into 45 ...
6
votes
2answers
201 views

How to highlight a pair of terms with compact, rectangular, semi-transparent, colored regions?

I want to create a GIF animation showing the process of multiplying 2 binomials. Each frame must only show a pair of terms that are highlighted with a compact, rectangular, semi-transparent, colored ...
5
votes
3answers
6k views

How do I include PSTricks pictures in a LaTeX document?

I use LaTeX regularly, and several times I have included .eps images. I am learning how to use PSTricks. I have used it to create .ps and .pdf files with images. There is plenty of free information ...
18
votes
2answers
347 views

Does a zero-length line with an arrow make sense? Is it a bug?

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \multido{\i=0+30}{12}{% \begin{pspicture}(-2,-2)(2,2) \pscircle{1} \pnode(1;\i){R} ...
12
votes
3answers
377 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 ...
11
votes
4answers
378 views

How to improve my PSTricks code to construct a triangle diagram?

This question is similar to How to improve my PSTricks code to construct a triangle number diagram?. Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} ...
10
votes
4answers
799 views

How to randomly shuffle a sliced image?

I have no idea to shuffle the following grids of a sliced image. How to do this in (La)TeX or PostScript level? \documentclass[pstricks,border=12pt]{standalone} \usepackage{multido} ...
6
votes
1answer
979 views

Automagically externalising pdftricks and TikZ pictures

My thesis currently has a few pdftricks pictures and tikz pictures. It takes a while to compile over here Scott says he has some scripts to automate externalising TikZ pictures. I'm looking ideally ...
5
votes
3answers
483 views

Improvement of PSTricks code for drawing of balls in a triangular box

Consider the following. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pst-eucl} \usepackage{expl3} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n ...
2
votes
2answers
229 views

Definition of PSTricks constant (again) and improvement of code

Consider the following example. (This is either the last one or the second to last.) Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} ...
8
votes
1answer
744 views

LuaLaTeX and PSTricks

Is there the possibility to produce PSTricks graphics in LuaLaTeX? I tried it, but i get ! Undefined control sequence. <recently read> \c@lor@to@ps l.9 \psline( ...
7
votes
2answers
378 views

psplot: square root of negative number

Is there a possibility to have psplot automatically ignore an invalid range? Example: x 2 sub sqrt This cann't be plotted requesting \psplot{0}{10}, but only when using \psplot{2}{10}. Of course ...
7
votes
2answers
214 views

How to improve my PSTricks code to construct a triangle number diagram?

This question is similar to How to improve my PSTricks code to construct a triangle diagram?. Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} ...
6
votes
3answers
580 views

Putting a coloured background behind text without adding whitespace

Consider this: I want to be able to highlight text like this without adding space around it -- so each word in the first line should line up with the corresponding word in the second line. (I know ...
4
votes
2answers
202 views

Definition of PSTricks constant

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} \usepackage[locale=DE]{siunitx} ...
4
votes
2answers
450 views

ps2pdf produces /undefined in Blue when setting gridlabelcolor to dvipsnames' Blue

latex-dvips-ps2pdf compilation sequence produces a weird result when I change the grid style. The problem does not happen when I compile the same code with xelatex. ...
4
votes
2answers
997 views

What is the unit of the coordinate system in PSTricks?

If I use the following code, there two different kinds of units. One for the coordinate system used to declare \begin{pspicture} with (0,0) to (20,10), and the centimeter used in 4.2cm. ...
3
votes
2answers
884 views

XeLaTeX and EPS figure with consistent fonts

I'm using Miktex 2.9 and XeLaTeX plus some EPS figures. For consistent fonts along the document, I used to play with psfrag or directly use pstricks. I'm facing the situation where none of the above ...
8
votes
2answers
194 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? ...
7
votes
2answers
1k views

3D-plotting sine integral (PSTRICKS)

I'd like to build up a 3D-Plot (based on pst-solides3d), where the function looks like x=u, y=v and z=\int_0^x \frac{\sin\left(\pi t \right)}{\pi t} - \frac{1}{3} ...
5
votes
3answers
465 views

Visualization in LaTeX of hamming distance

I have for example the following two strings: 1: 00101101 2: 00100100 I would like that each number will be place in a box and the boxes with the number one should be higher then the ones with ...
4
votes
3answers
357 views

let operation vs tkz-euclide

Before put my question to give some explanation of why I do this question. When I started to use the TeX a matter of luck that I started working with LaTeX (xelatex) and not with LuaTex for example. ...
4
votes
2answers
477 views

Replacement for \curveto in the tikz library - Inkscape export svg to tikz

I need to draw a complex curve and I wanted to help a vector program Inkscape. In first step I tried to use Inkscape to TikZ exporter (http://code.google.com/p/inkscape2tikz/)to convert curve to tikz, ...
3
votes
1answer
484 views

psgraph with y-axis on left and right of graph and axis labels

I'm attempting to plot two quantities on one graph each with their own vertical axis. I've got as far as the MWE below but am stuck on two problems. Can I make the right hand axis have the same line ...
3
votes
1answer
4k views

auto-pst-pdf Problem

I'd like to use pstricks with auto-pst-pdf. However, running the example code on http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput#autopstpdf gives me the following error: Package auto-pst-pdf ...
2
votes
2answers
520 views

Scaling a pst-3dplot to fit a Beamer frame

I'm new to pstricks. I was looking for an automatic way of resizing a plot. I'm trying to fit a 3d plot, generated using pst-3dplot, into a beamer frame. However, I'm not able to make it look good ...
1
vote
2answers
88 views

XeLaTeX and pst-node

I have problems with XeLaTeX and pst-node: If I want to draw a line between two nodes, but there is nothing drawn in the pspicture. If I only put the nodes with some stuff withoud a line in, the nodes ...
1
vote
0answers
158 views

Improved PSTricks figure for everyone interested [closed]

First: This post might not be appropirate for this site, so feel free to close it if necessary. I have improved on the drawing by Thomas Söll from here and I thought someone might find it useful. % ...
1
vote
1answer
4k views

PSTricks picture not compiling with pdfLaTeX [duplicate]

Possible Duplicate: How to use PSTricks in pdfLaTeX? What is wrong with this code: \documentclass{article} \usepackage{pstricks} \begin{document} \begin{pspicture}(-0.5,0)(2.5,1) ...
1
vote
1answer
545 views

How to define a global constant in postscript statement?

I want to define a constant globally within my pspicture environment as follows: \begin{pspicture}(4,2) \psgrid \SpecialCoor \def\length{2} \pnode(!\length 1){C} \uput[90](C){$C$} % other codes ...
1
vote
2answers
944 views

How can I create PDF & EPS exactly as big as my PSTricks picture but without using pdfcrop?

This question is made to accompany the existing question: How can I create a pdf document exactly as big as my tikz picture?. Constraints: It is not allowed to use pdfcrop by any means whatsoever. ...
0
votes
1answer
387 views

How to avoid this error when redefining `\psgrid` to be `\relax`?

Scenario \pspicture with showgrid will be regarded as a PERMANENT grid. \psgrid in \pspicture WITHOUT showgrid will be regarded as a TEMPORARY grid. If I want to remove all temporary grids, I just ...
39
votes
5answers
1k views

Showcase of translations to Asymptote from TikZ/PSTricks

So you already know TikZ and/or PSTricks, but you would like to expand your knowledge by learning Asymptote as well? Here's your chance. The task/question: Find an example of an impressive diagram ...
37
votes
4answers
2k views

How to create a Sierpinski triangle in LaTeX?

I have been trying to recreate the following image in LaTeX and for me personally it has to be done with pdflatex. Although answers using pst-fractals From Jake I got a good start which led to the ...
35
votes
4answers
2k views

How can we make a pumpkin, jack-o-lantern, or other halloween spirit, ghoul, or skeleton?

So we have questions about Christmas trees and Hearts for Valentines But we have no questions that specialize in Halloween or Dia de los Muertos art. So here it goes.... Using TikZ or pstricks or ...
31
votes
6answers
2k views

How to make the length of a car moving on a roller coaster track remain unchanged?

For any arbitrary parametric smooth curve, how can I make the length of a car remain unchanged? \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot,pst-node} \pstVerb { ...
45
votes
13answers
2k views

What is the simplest way to draw this triangle exactly?

I want to see how we can exactly construct the following diagram as simple as possible. It means that the manual calculation should be avoided. Note that the angle marks attached to angles ...
40
votes
9answers
3k 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}, ...
28
votes
3answers
2k views

How can I draw nucleosomes with wrapped DNA in tikz or pstricks?

The nucleosome is the fundamental unit of DNA packing in cells, and I am trying to generate some figures for regular use in manuscripts and presentations. The nucleosome is commonly abstracted to a ...
26
votes
2answers
709 views

Chaotic billiard with TikZ

I'm looking for a TikZ library that could help me to represent different shapes of chaotic billiards. Any idea?
15
votes
7answers
3k views

How to draw a square wave?

Everything is in the title... I'm trying to draw a simple square wave , but I'm reading that tikz cannot draw the vertical line of the discontinuity... Is there a way to overpass this ? PSTricks ...
15
votes
4answers
1k views

Can we imitate the behavior of \pscurve in TikZ?

Here it is with the pictures. PSTricks has the very neat command \pscurve. The manual gives the example \pscurve[showpoints=true]{<->}(0,1.3)(0.7,1.8) (3.3,0.5)(4,1.6)(0.4,0.4) which yields ...
16
votes
2answers
520 views

Blend/transparency styles in pstricks and TikZ

As depicted below, Illustrator offers various transparency styles: It is my understanding that, at this point, pstricks and TikZ are both limited to the normal style listed above. Could the other ...
18
votes
1answer
744 views

Drawing of a helix

On this blog I found a 3D drawing of a transformer by Thomas Söll. After a few changes, I have the following code: \documentclass{article} \usepackage{pst-solides3d} \usepackage{expl3} % ...