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

11
votes
4answers
2k views

How can I draw these polygons with shaded regions?

I don't know how to draw this by LaTeX.
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, ...
13
votes
3answers
945 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
250 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 ...
5
votes
3answers
5k 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
338 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
351 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
360 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
754 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
947 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
2answers
186 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
451 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
216 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} ...
7
votes
2answers
288 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
206 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} ...
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 ...
6
votes
3answers
505 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
182 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
423 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. ...
3
votes
2answers
861 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
184 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
433 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
345 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
433 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
430 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
493 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
0answers
126 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
3k 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
499 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
855 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
375 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 ...
38
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 ...
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 { ...
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}, ...
44
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 ...
15
votes
7answers
2k 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 ...
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
661 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
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
432 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 ...
17
votes
1answer
703 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} % ...
13
votes
2answers
446 views

How to get the intersection nodes of 2 arbitrary curves?

This question led to a new package: pst-intersect In my experience, there is no macro in PSTricks to get the intersection nodes of two curves. Is it possible to do this in PSTricks? Or Am I am ...
10
votes
4answers
1k views

What is the easiest way to plot a function and its tangent lines at the turning points?

I want to plot graphs like this and embed them as Tikz or Pstricks code in my handouts. I know that there are software such as Ipe, LaTeXDraw etc. But none of them can satisfy me. Because Ipe doesn't ...
10
votes
1answer
300 views

How to mimic the behavior of \ncput* but without the unwanted opaque effect?

My objective is to have a label with transparent background but any connecting curve passing through the hypothetical box of the label must be hidden. Opaque Label \ncput* produces an opaque label ...
7
votes
1answer
883 views

PSTricks to SVG

I would like to make block diagrams using the pst-sigsys package (as demonstrated here: http://squobble.blogspot.com/2009/12/drawing-beautiful-block-diagrams-in_04.html). I can do that and export to ...
7
votes
1answer
2k views

How to place in a document a VCard using a psbarcode?

I would like to put a QRCode that contains contact information (VCard). However I don't know how to encode the newline character so VCard is correctly read. Here is a sample document with QRCode ...
9
votes
6answers
303 views

Create association lines between characters

I intend to create "association lines" between characters, where the start of the line is one or more characters inside a word, and the end of the line is a single character. Something like this ...
8
votes
6answers
491 views

How to draw a ring-like diagram with some labels on its arcs?

I would like to draw a figure that looks like the following scenario: Consider a circle of radius $r$, described parametrically by $x = cos(t) and y = sin(t)$. I'd like to draw a figure where the ...