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

82
votes
8answers
7k views

Simulating hand-drawn lines

I am working on a project that will have some vector graphics, perhaps using TikZ (or a similar tool). All of the graphics consists of lines, in shades of gray. However, the lines from TikZ appear too ...
70
votes
11answers
7k views

What are the advantages of TikZ/PGF over PSTricks?

The first time I saw the PSTricks' 3D Galleries, I immediately felt in love with it. I have spent much time to learn and use it. In this forum, I see many people using TikZ. I have not used TikZ yet. ...
69
votes
3answers
3k views

Fundamental differences : PSTricks, TikZ/PGF and others

OK, since this is a pretty vague and subjective question. I need to set up some borders around the discussion that I intend to benefit from. But before anything, I certainly do NOT want to excite the ...
51
votes
11answers
2k views

How can I define a mathematical function as a LaTeX macro?

I am attempting to create a usable function within LaTeX such that its inputs are transformed mathematically. However, I cannot find any documentation that can perform such mathematical function ...
51
votes
3answers
34k views

How to use PSTricks in pdfLaTeX?

I thought that PSTricks package was not possible to use in pdfLaTeX but the user Dima claims otherwise. How can I force pdfLaTeX to use PSTricks then?
47
votes
6answers
2k 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} ...
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 ...
41
votes
1answer
543 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 ...
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 ...
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}, ...
38
votes
5answers
959 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 ...
34
votes
5answers
1k views

Please improve my logo to resemble our TeX.SX logo

It is free to use TikZ or PSTricks to answer my question. I want to recreate our TeX.SX logo. But my attempt is far from perfect. Please help me to make it more similar to the original one. ...
33
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 ...
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} . ...
29
votes
1answer
2k views

Topological Quantum Field Theory diagrams with pstricks or tikz

This question led to a new package: tqft — Blog: The TQFT Package I'm going to write a brief note about topological quantum field theories, so I need to draw some copies of the "pair of ...
28
votes
2answers
706 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 ...
28
votes
2answers
3k views

What is the clearest way to graph a piecewise function?

I have a function defined as: How can I graph that using functions instead of coordinates? I'm currently working with pgfplots but I'm open to something else if it's better.
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 ...
26
votes
6answers
5k views

Why draw diagrams using LaTeX when there are open source tools like OpenOffice?

I was looking at recent questions here and was surprized that people were drawing diagrams in LaTeX, when it can be done in SmartDraw, OpenOffice or other programs. Is there any benefit to using LaTeX ...
26
votes
3answers
3k views

How to draw tangent vectors and component vectors on a curve

I am searching for a way to have a figure drawn using LaTeX. I am aware of some packages TikZ and PSTricks that could accomplish this, and have been tinkering around with them recently but do not have ...
26
votes
2answers
2k views

Making a Calendar for TUG

This question is triggered by a post from Peter Wilson in comp.text.tex`. Peter wrote: TUG members produced a calendar for 2012 and, if I remember correctly, for some previous years as well. I really ...
26
votes
2answers
593 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} ...
25
votes
6answers
2k views

Are there examples written in PSTricks and they cannot be done using TikZ?

I am comparing the cores of PSTricks with TikZ and their capabilities. I am not considering whether or not a library has been implemented. Are there examples written in PSTricks and they cannot be ...
24
votes
4answers
1k views

A rather difficult ring like picture to be drawn

I desire a figure similar to the following: \documentclass[tikz,margin=10pt]{standalone} \usepackage{mathtools,amssymb} \begin{document} \begin{tikzpicture}[scale=2,transform shape] \draw (1,0) ...
23
votes
6answers
1k views

Spirograph, Continuous Rotations in TikZ or PSTricks

Spirograph-like drawings are obtained when one repeatedly draws a closed curve on a continuously rotated canvas. Is there a nice way to make spirograph drawings using TikZ or PSTricks? There is a nice ...
23
votes
2answers
469 views

Is there a TikZ equivalent to the PSTricks \ncbar command?

Although I now use TikZ, every so often I find myself looking for very useful PSTricks commands which don't seem to exist in TikZ. The pst-node package has an \ncbar command which allows one to ...
23
votes
1answer
681 views

More elegant way to achieve this same camera perspective projection model?

I just finished a camera perspective projection model using TikZ. Although, while I'm pretty satisfied with the result, it took me a lot of time to do it. It's easy to see from the code below that I'm ...
21
votes
4answers
357 views

Does the order of specified key-values matter?

The following screen shot shows how the order of specified key-values affects the output. When using dx=\psPiH,xunit=\psPi. When using xunit=\psPi,dx=\psPiH. Minimal Working Example ...
20
votes
2answers
1k views

How to convert pstricks animation to GIF file?

As an example, let's take this animation. How can I convert it to GIF file?
20
votes
1answer
382 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 ...
19
votes
2answers
3k views

How can I make a standard timeline?

I am looking to make a standard timeline, nothing fancy, like the one below (although, it does not have to be like that) using any library. How can I go about the achieving this in the best way?
18
votes
5answers
803 views

Convert font letters to vector format and fill with a pattern

I have worked with Illustrator and CorelDraw and I usually take fonts and convert them to curves after which I would fill in the curves with patterns, merge them with other vectors or the sort. Is it ...
18
votes
3answers
1k views

Letterpress effect through PSTricks or Tikz

I have already typed in the META section of the website a post addressing the question as to how the letterpress (or engraving-like) effect in the headers of the site had been achieved. I know it can ...
18
votes
1answer
575 views

What is the easiest way to automatically keep the fluid surface horizontal and the liquid's volume conserved when the container is rotated?

I have a symmetric container (a hollow object of revolution) that is partially filled with liquid. When we rotate the container about any axis perpendicular to our display, the surface of liquid must ...
17
votes
4answers
2k views

How to generate all possible Venn diagrams (with the case below) efficiently?

I can draw Venn diagrams but now my question is more complicated than just drawing Venn diagrams one by one. I need to draw all possible Venn diagrams efficiently. I need a combinatorical approach ...
17
votes
4answers
595 views

What is the best way to produce TikZ picture for discrete signals?

I would like to draw discrete signals, as shown in the illustration below, but not by way of drawings of individual lines.gnuplot could be used for this work? It would be nice to be able to choose the ...
17
votes
3answers
162 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)} ...
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
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} ...
17
votes
2answers
685 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?
17
votes
2answers
417 views

What to do with 237 eps files?

I have some 237 .eps files that represent the printer's ornaments from the small press The Underground Grammarian. I would like to build and provide (to CTAN) a package similar to the pgfornament ...
16
votes
2answers
2k views

Draw a prism in TikZ or PSTricks

Is there a way to define an polygon in plane and output an (orthogonal) prism with that polygon as its base? The prism should be drawn in 3D in parallel oblique perspective with controllable height h, ...
16
votes
1answer
620 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} % ...
15
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 :
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, ...
15
votes
5answers
364 views

How to automatically generate a stack diagram for a PostScript expression?

The following figure shows a PostScript expression and its stack diagrams step by step. Is there any package to generate it out of the box? If there is no such a package, how to generate it ...
15
votes
3answers
1k views

How to draw these diagrams (closed contours) using TikZ or PSTricks?

First, I must say I have no knowledge about PGF/TikZ nor PSTricks, but I would like to draw the following or similar closed contours using one of them or another adequate package. Where can I find the ...
15
votes
2answers
878 views

How to attach a 2D rectangular image to a 3D curved surface with TikZ or PSTricks?

I want to do so called texture mapping which is to attach an image to a curved surface. How to attach a 2D rectangular image to a 3D curved surface with TikZ or PSTricks? For the sake of ...
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 ...