Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

PSTricks

From Wikipedia, the free encyclopedia
This article includes alist of references,related reading, orexternal links,but its sources remain unclear because it lacksinline citations. Please helpimprove this article byintroducing more precise citations.(October 2021) (Learn how and when to remove this message)

PSTricks is a set ofmacros that allow the inclusion ofPostScript drawings directly insideTeX orLaTeX source code. It was originally written byTimothy Van Zandt and has been maintained in recent years byDenis Girou,Sebastian Rahtz andHerbert Voss (de).

Basic usage

[edit]
PSTricks example (scaled)

There is a wide array of commands available for making graphics. Coordinates in PSTricks are always represented in parentheses, as the following example (scaled) illustrates:

\begin{pspicture}(5,5)%% Triangle in red:\pspolygon[linecolor=red](1,1)(5,1)(1,4)%% Bezier curve in green:\pscurve[linecolor=green,linewidth=2pt,%     showpoints=true](5,5)(3,2)(4,4)(2,3)%% Circle in blue with radius 1:\pscircle[linecolor=blue,linestyle=dashed](3,2.5){1}\end{pspicture}

Extensions

[edit]
Plottingsin(x) withpst-plot

PSTricks commands are low level, so many LaTeX packages have been made in order to ease the creation of several kinds of graphics that are commonly used on mathematicaltypesetting.

pst-plot provides commands for creatingfunction graphs.

Consider the following example:

\begin{pspicture*}(-7,-2)(7,2)\psaxes[labels=none](0,0)(-7,-2)(7,2)% sets up axis\psplot[linecolor=blue, linewidth=1.5pt]%    % plots the sinewave{-7}{7}{x 0.01745329252 div sin}% notice the RPN expression\uput[45](3.1415926,0){$\pi$}% these are the labels\uput[90](-1.570796,0){$-\pi/2$}% \uput is a box positioned at [angle]\uput[-90](1.570796,0){$\pi/2$}% relative to (x,y) coordinate\uput[-135](-3.1415926,0){$-\pi$}% and putting { content } on the box\psline[linewidth=1pt,linecolor=red,linestyle=dotted]%   % red dotted lines     (1.57079632,1)(1.57079632,0)\psline[linewidth=1pt,linecolor=red,linestyle=dotted]%     (-1.57079632,-1)(-1.57079632,0)\end{pspicture*}

The previous example also illustrate that TeX commands can be used as elements into the pictures.Since PostScript usesRPN style for mathematical operations, the argument to pst-plot must be supplied in the same form.An alternative is to use the optional argumentalgebraic, then the formula can be described as an algebraic expression.

pstricks-add extends pst-plot enabling alsopolar graphs and allowing the use algebraic notation for plots instead of RPN.

pst-math providestrigonometricfunctions inradians (since PostScript defaults to usingdegrees) and hyperbolic trigonometric functions.

pst-3dplot is used for creating 3D graphics like the following:

Hyperbolic paraboloid drawn using PSTricks packagepst-3dplot

multido provides basic loop functionality for programming graphs with repeating elements:

Plotting a graph while varying parameters withmultido

pst-eucl is a beta extension for easy creation ofgeometrical drawings.

Circumcircle of a triangle, illustrated withpst-eucl

There are many other extensions, for drawingCircuit diagrams,barcodes,graphs,trees, visualizing data, etc.

Compatibility

[edit]

PSTricks is only fully compatible with TeX systems using PostScript intermediates, including but not limited to eTeX and others. However, it isnot compatible with the widely usedpdfTeX engine inPDF mode. As pdfTeX is the default engine in most current installations, users of PSTricks must either force pdfTeX toDVI mode or useauto-pst-pdf.PGF/TikZ is an alternative to PSTricks thatis compatible with pdfTeX.

Software which supports PSTricks output

[edit]

See also

[edit]

Further reading

[edit]
  • Herbert Voss; PSTricks – Grafik für TeX und LaTeX, 7th edition, DANTE e.V. and Lehmanns.media, 1008 pages, Heidelberg and Berlin 2016,ISBN 978-3-86541-858-6.
  • Herbert Voss; PSTricks – Graphics for TeX and LaTeX, 1st edition, UIT, 916 pages, Cambridge 2011,ISBN 978-1-906860-13-4;review in TUGboat

External links

[edit]
Macro packages
Alternative TeX engines
Active
Deprecated
Distributions
Active
Deprecated
Community
Related
Bytype
2D
3D
See also
Retrieved from "https://en.wikipedia.org/w/index.php?title=PSTricks&oldid=1259304625"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp