Tag Info

14

Using bash or a similar command line, executing s="";for i in 4 2 1 add 1 sub add ; do s="$s$i"; echo " $s pstack" | gs -q -sDEVICE=pbm | sed -e "s/GS>/\\\\foo{$i}{/" -e "s/GS<[0-9]*>/}/" ; done produces \foo{4}{4 }\foo{2}{2 4 }\foo{1}{1 2 4 }\foo{add}{3 4 }\foo{1}{1 3 4 }\foo{sub}{2 4 }\foo{add}{6 } and then if you wrap that in some ...

10

9

Just for fun (or typing exercise or whatever) with TikZ. It's not complete, but should be trivial to implement the remaining postscript stack commands. \documentclass[border=0.125cm]{standalone} \usepackage{tikz} \makeatletter \newcount\stacktop \def\stackclear{\global\stacktop=0\relax} \def\stackpush#1{% \global\advance\stacktop by1\relax ...

8

Just for typing exercise with PSTricks. \documentclass[pstricks]{standalone} \usepackage{pst-eucl} \newcommand\Orbit[2][0]{\rput{#1}{% \psellipse[linewidth=0,linestyle=none,fillstyle=vlines,hatchcolor=#2!20,hatchsep=2pt](0,0)(4,1)% \psellipticarc[linecolor=#2!50](0,0)(4,1){180}{360}}} \begin{document} \pspicture[dimen=m](-5,-5)(5,5) ...

7

Without using Geogebra that generates inefficient PSTricks code. \documentclass[pstricks,border=25pt,12pt]{standalone} \usepackage{pst-eucl} \psset{PointSymbol=none,linejoin=2} \begin{document} \begin{pspicture}(8,5) \pstGeonode[PosAngle={180,0,135,45,-90}]{A}(8,0){B}(3,3){C}([nodesep=6]{C}A){D}([nodesep=5]{B}A){E} ...

6

With tikz. May need some polishing but, I put it as such. \documentclass[tikz]{standalone} \usetikzlibrary{patterns} \newcommand{\greatcircle}[5][]{% \path[#1,pattern=north west lines,pattern color=#1!60,rotate=#5,dashed] (#2) circle [x radius=#3, y radius=#4]; \begin{scope}[rotate=#5] \clip (#3,0) rectangle ([xshift=-0.1,yshift=-0.1]-#3,-#4); \draw[#1] ...

6

For rendering such a stack, I provide the below solution. But as Jake points out, it does not digest a raw postscript expression. However, see the end of this answer to see how I can digest David's bash output. Here, I use a bunch of nested stacks. The \psdepth (depth of stack tube), \pswidth (width of stack tube), and \psrule (stack rule thickness) may ...

6

My package 'calculus' (installed together with 'calculator') defines some commands to declare mathematical functions. Unfortunately these functions can not be drawn using PSTricks, but you can draw it using my package 'xpicture". Your example can be defined typing \newqpoly{\myMathFunction}{0}{5}{-1} (this declare the quadratic polynomial p(x)=0+5x-x^2). ...

5

You have to define the plane first: \documentclass[pstricks]{standalone} \usepackage{pst-solides3d} \begin{document} \begin{pspicture}[solidmemory](-4,-4)(5,5) \psset{Decran=50,viewpoint=25 25 15 rtp2xyz} \psSolid[object=octahedron,a=2,trunc=all,trunccoeff=.3333, fillcolor=gray!20!,name=my_octahedron,action=draw*] % The following draws a point. ...

4

That file runs fine in my up-to-date TeXLive 2013. However, try \usepackage[crop=off]{auto-pst-pdf} and, by the way, use \usepackage[T1]{fontenc}%%%%% use T1 encoded fonts \usepackage{concmath} \usepackage[euler-digits,euler-hat-accent]{eulervm}

4

As far as I know, any blank lines in pspicture will be ignored. Any trailing whitespace after the opening curly brace of \newcommand{\<macroname>} must be removed by using %. Any trailing whitespace after the closing curly brace of \pstVerb must be removed by using %. So there is no bug because they are all well-known facts. ...

4

that cannot work, because all PSTricks objects have inside TeX a width and height of 0pt. That is the reason why you can't expand "nothing" to 1x1. This will work: \documentclass{article} \usepackage{pstricks} \begin{document} \begin{pspicture}[showgrid](10,10) \psscaleboxto(1,1){\rule{5cm}{5cm}} \psframe*[unit=0.2,linecolor=red](5,5)(10,10) ...

4

4

Just 4 fun with PSTricks. \documentclass[pstricks,border=12pt]{standalone} \begin{document} \foreach \i/\c in {1/red,2/green,3/blue,4/magenta,5/cyan,6/orange,7/black,8/yellow,9/pink,10/gray}{% \begin{pspicture}(6,6) \psframe[fillstyle=vlines,hatchcolor=\c,hatchsep=\i pt](6,6) \end{pspicture}} \end{document}

4

\documentclass[pstricks,border=12pt,12pt]{standalone} \usepackage{pst-node} \newcommand\Right[2][1 1]{% \psscalebox{#1}{% \pnodes(1,1){#21}(3,1){#22}(1,4){#23}% \pspolygon(#21)(#22)(#23)% \uput[180](#21){\psscalebox{#1}{A}}% \uput[0](#22){\psscalebox{#1}{B}}% \uput[180](#23){\psscalebox{#1}{C}}% }} \begin{document} ...

4

there are some problems if pstricks is loaded before auto-pst-pdf. Use \documentclass[11pt, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[french]{babel} \usepackage{auto-pst-pdf,pstricks-add} \begin{document} [...]

4

For an expression with the basic operations and the square root extraction [and also logic operators and conditional evaluation] you can use \xintNewExpr or \xintNewFloatExpr from the xintexpr package to create a (completely expandable) mathematical function. The package core routines compute exactly, with an arbitrary number of digits, and natively with ...

4

The automatic generation is easy to realize with LuaTeX, which I leave to the reader ... \documentclass{article} \usepackage{array,multido} \newcount\stackNo \def\maxStackNo{6} \makeatletter \newtoks\ps@stack \def\addtotoks#1{\ps@stack=\expandafter{\the\ps@stack#1}} \newcommand*\psstack[2]{% \sffamily\stackNo=0 \ps@stack={\,\tabular[t]{ |c| } ...

4

As for generating the content for the stack pictures, I've been inspired by this thread to clean up some old code and now we can generate nice traces for arbitrary code. The code is posted to comp.lang.postscript, as it's more directly pertinent there, as this is also a step-wise debugger. The code is mostly level-1 postscript with the exception of << ...

3

Your problem is that the standalone class does not know which environment to put on single pages. Firt remove the pdfpic environment definition, you don't need it. You can tell the standalone package to put each pspicture environment on a separate page by either using the class option pstricks to the standalone class ...

3

A preamble that works with pdflatex, provided you have a relatively recent version, is without loading pdftricks and loading pstricks with the pdf option: \documentclass[margin=3pt]{standalone}% \usepackage[pdf]{pstricks} \usepackage{pst-node} \newcommand\nbox[2]{…} ............ and removing the pdfpic environment. This gives:

3

I saw this old problem showing up recently (because someone edited one of the answers of comments), and I felt like making a MetaPost solution of it. Here it is — a "rule-and-compass" solution. Since there is no native macro in MetaPost giving the tangents of a circle through an external point, I've created my own, which I use to solve the general problem. ...

3

For instance: \pspolygon[fillstyle=hlines, hatchcolor=blue,hatchsep=6pt]... or, if you want to set it for all what you want to fill: \psset{fillstyle=hlines, hatchcolor=blue,hatchsep=6pt} The other parameters re explained in § 14 of pstuser.doc(version 1.5, 2007). Here is a summary: hatchwidth = … defines the lines thickness (default 0.8pt) hatchsep ...

3

For some historical reason it is not possible. Labels are set on TeX level and all plotting is done on PostScript level. It is not a big deal to change that behaviour, but on PS level you do not really know which font was used in TeX for the labels. However, it has some advantages that the axes must be set by the user. Often the output of the automatic ...

3

It is a problem with beamer and pstricks-add. However, you shouldn't use the export of LaTeXDraw, it is extremly lousy. This does the same: \listfiles \documentclass{beamer} \usepackage{pstricks} \begin{document} \begin{frame}{First One} \begin{pspicture}(0,-1.38)(7.92,1.38) \psset{linewidth=0.04cm,showpoints} \psline(0.08,1.3)(0.46,0.93)(0.46,0.32) ...

2

What do you mean with "label"? However, I do not understand why you want for such a simple example a timeline. It is also possible without it: \documentclass{article} \usepackage{multido,pstricks,xcolor} \usepackage{animate} \SpecialCoor\psset{unit=2} \begin{document} \definecolor{mycolor}{RGB}{100,0,100} \begin{center} \begin{animateinline}[poster=first, ...

2

This is a nice example to illustrate the basic use of timeline files and of the animate JavaScript programming interface. JavaScript is being used to loop over a sub-range of animation frames. Instead of repeating the animation from the very beginning, we want to jump back to the start of the second cycle which starts with a green dot at the zero degree ...

2

You can also do with the following approach. Compile it with pdflatex -shell-escape main.tex where main.tex is as follows. % main.tex \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{figure.tex} \documentclass[pstricks,border=12pt]{standalone} \begin{document} \begin{pspicture}(4,5) \psframe(0.7,2)(3.3,3) \rput{90}(2,2.5){First ...

2

Quite oldish, but here you go: I implemented a new cspline plot style, which interpolates a given set of data points with cubic splines. The splines are calculates such, that the control points can be drawn with Postscript's curveto operator. The algorithm was implemented following ...

2

The crucial point is understanding the difference between a node (A), which is created by \pnode, and a pair of coordinates (x,y): A coordinate pair, e.g. (1,1) specifies a relative point. Its position depends on the current environment, whether its surrounded by \psdot(1,1) text, or shifted with \rput(2,2){\psdot(1,1)} etc. A node (A) refers to an ...

Only top voted, non community-wiki answers of a minimum length are eligible