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

17
votes
2answers
319 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} ...
11
votes
4answers
353 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
723 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
899 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
163 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 ...
3
votes
2answers
285 views

How can I draw this diagram of my function's domain?

How can I do this? I do not know how to do this. Is it possible to do it in LaTeX or should I create a figure with GeoGebra and insert it?
2
votes
2answers
197 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} ...
14
votes
3answers
652 views

Draw a 3D diamond structure

I want to draw a 3D crystal structure. The point where I struggle is quite in the beginning to draw connecting 3D rods: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} ...
12
votes
3answers
317 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 ...
7
votes
2answers
231 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
201 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
2k 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
418 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
171 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} ...
3
votes
2answers
804 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 ...
12
votes
1answer
194 views

What is the equivalent for ([nodesep=10pt]{B}A) in TikZ?

\documentclass[pstricks,border=20pt]{standalone} \usepackage{pst-eucl} \begin{document} \begin{pspicture}(3,3) \pstGeonode(0,0){A}(3,3){B} \pnode([nodesep=10pt]{B}A){A'} ...
8
votes
2answers
173 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? ...
5
votes
3answers
408 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
324 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
375 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
353 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 ...
2
votes
2answers
458 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
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
2answers
754 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
362 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
951 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 ...
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}, ...
42
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 ...
26
votes
2answers
591 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?
25
votes
5answers
2k views

How to draw a coffee cup

Topologists need to explain that coffee cups are homeomorphic to donuts. There are nice ways to draw donuts. So far, my best attempt is \documentclass{standalone} \usepackage{tikz} ...
27
votes
3answers
1k 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 ...
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 ...
14
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 ...
16
votes
1answer
618 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
409 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
946 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 ...
7
votes
1answer
798 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
1k 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
264 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 ...
9
votes
1answer
271 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 ...
8
votes
6answers
444 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 ...
7
votes
6answers
984 views

Graphics: Clip or cutout a circle from a circle

I have a very specific problem that needs solving: I would like to produce a shape which can be most easily thought of as a circle or an ellipsis cut out of another bigger circle: Think e.g. the apple ...
5
votes
1answer
1k views

xelatex compilation of pstricks fails

I just needed to compile the following lines (minimal example) \documentclass{standalone} \listfiles \usepackage{pstricks} \begin{document} Ein \begin{pspicture}(-5,-3)(5,8) \psline(0,1)(2,3) ...
17
votes
4answers
2k views

How can I draw a transparent cube in 3D perspective?

I would like to draw a transparent, `flattened cube' in perspective with dotted lines from both vanishing points to each of the vertices of the 3D solid. Is there a PSTricks package for this? It is ...
17
votes
2answers
683 views

equivalent of pstricks rput in tikz

A very powerful feature of pstricks is its possibly nested rput command that can be used to rotate and move a portion of a drawing. Is there something similar in tikz?
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?
10
votes
1answer
130 views

Shape driven formatting

I'm not exactly sure how to call it, so I've had a hard time search for it online. What I have is a solid block of text. What I want is to change the formatting of part of this block of text (make it ...
7
votes
3answers
432 views

Create heatmap with PSTricks or TikZ

I have a huge amount of 2D-coordinates, associated with a value, e.g.: x | y | value 27.50 52.15 12.51 61.83 13.32 57.56 36.23 21.83 41.73 40.46 85.67 25.20 ... The data is ...
7
votes
2answers
574 views

PSTricks transparency does not work with MikTeX's XeLaTeX

I use MikTeX and have updated all packages several minutes ago. The problem is that XeLaTeX produces a weird result where the transparency parts become opaque. It is not caused by preview as ...
6
votes
1answer
611 views

Is it possible to implement an equivalent syntax of (*x {\f(x)}) but the ordinate is specified first?

PSTricks provides us with a useful syntax (*x {\f(x)}) to specify a point with abscissa x and ordinate \f(x). For example, let \def\f(#1){#1+.5}, a point (1,1.5) can be written as (*1 {\f(x)}). I ...