66

From a publishers perspective, I think, the only fundamental reason is legacy software. Postscript has been a long-lasting and broadly accepted standard. Updating the existing tool chains to PDF would require a massive investment. So I think, it is all about history. There is a great Q&A that discusses the fundamental differences between Postscript (PS)...


62

Postscript is still used as an intermediate document format, since it is a fully fledged programming language allowing you to compute graphics, which PDF doesn't. PDF shows just the result (after some conversions, sometimes called "Distillation") of the computation Postscript is able to do. The Postscript based PSTricks package is an example that heavily ...


32

PostScript and TeX are designed for different purposes and for this reason one would never exchange one for the other as a replacement. However, from a purely theoretical point of view, both are Turing-complete languages and therefore anything that could be expressed in TeX could be also expressed in PostScript and vice versa. That aside, PostScript is ...


16

Both Herbert and Alexander have offered solutions for dvips. Here, I'm taking inspiration from those answers plus the more convenient approach available in pdfTeX, plus a modified version of the pgf method for XeTeX, and combining into a single approach. First, note that I'm assuming e-TeX and also using a somewhat 'LaTeX3-like' programming approach. I've ...


15

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 latex: ...


15

As you've already experienced, there's a tendency for modest-sized ps files to blow up to enormous pdf files. This is because postscript, being a general programming language, has enormous potential for algorithmic compression. For a simple example, consider a sheet of 5mm graph paper. A pdf would contain the end-points for every line. In postscript, ...


13

First, a bit of background. With traditional (La)TeX, including an EPS file is relatively straight-forward at the TeX end. The approach taken by LaTeX is to read the EPS (a text file) to find the bounding box, then leave enough space for this to appear in the output. A link is included in the DVI file using a \special, and the TeX engine is done. Actually ...


13

There have been many attempts to use Postscript's programming power to implement a fuller document-production environment. AFAIK they all fall short of TeX's line-fitting abilities. The most basic is the typewriter emulator from the Postscript Tutorial (Blue Book), which is then extended in the later Reid books (the Green Book and Thinking In Postscript) to ...


13

The problem with including the same PostScript graphics multiple times is very well explained in chapter "16 Including An EPS File Multiple Times" of Keith Reckdahl, "Using Imported Graphics in LaTeX and pdfLaTeX", 2006, URL: http://mirror.ctan.org/info/epslatex.pdf The trick is that the original PostScript file is split in two parts. A header file for ...


12

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 \...


10

There's an unprotected end of line in fp-exp.sty; add this to your preamble \makeatletter \def\FP@pow#1#2#3{% <---- This was unprotected % #1 macro, which gets the result % #2 base % #3 exponent % \FP@beginmessage{POW}% % {\def\FP@beginmessage##1{}% \def\FP@endmessage##1{}% % \FPifzero{#2}% \FP@pow@zero{#3}% \else% \...


10

DVI is TeX' own DeVice Independent format, it isn't understood outside the TeX world. PostScript was Adobe's first own "device independent" format (it is a vector format, really a program to define what to paint on the page). PDF (Portable Document Format) is a development by Adobe on PostScript to make it more compact and add other capabilities. PDF is the ...


10

There is also a Latex-specific historical reason why some publishers still request PS versions of documents. This is relevant primarily in cases in which the publisher just takes an author-prepared document and prints it (or puts it online); for example, many conference proceedings in computer science are produced this way. Previously, the typical toolchain ...


9

You need supp-pdf.mkii, see its comments for details. The hard part is to get the MPS file into a macro (or token register). Macro \savemps saves the MPS code as macro. Care need to be taken for the percent characters and the line ends should be preserved. Macro \includemps is then quite easy, it calls \convertMPtoPDF with a redefined \input that rereads ...


9

setrgbcolor is the PostScript primitive to set an RGB colour. TeXcolorrgb is the name dvips inserts into the PostScript stream if you use a color \special with model rgb, this indirection allows for user specified models, but in the case of rgb the header file color.pro just defines TeXcolorrgb to be setrgbcolor /TeXcolorrgb { setrgbcolor } def so the two ...


8

I would use the full power of epstopdf: \documentclass{amsart} \usepackage{graphicx,epstopdf} \epstopdfsetup{update} \DeclareGraphicsExtensions{.ps} \epstopdfDeclareGraphicsRule{.ps}{pdf}{.pdf}{ps2pdf -dEPSCrop -dNOSAFER #1 \OutputFile} \begin{document} \includegraphics{my_ps_file} \end{document} This will run the conversion program only if the target file ...


8

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \pstVerb{/mySQRT { dup 0 lt { 0 }{ sqrt } ifelse } bind def }% \begin{document} \begin{pspicture}(10,6) \psaxes[labels=none]{->}(0,0)(10,6) \multido{\n=1.1+.3}{20}{% \psplot[linecolor=red]{0}{9}{5 2 Pi mul div \n\space 2 exp x 10 mul sin 2 exp mul 1 sub mySQRT mul}} \end{...


7

Rather than using the cmap package, you could use the pdftex built in functionality: \input glyphtounicode.tex \input glyphtounicode-cmr.tex \pdfgentounicode=1 This doesn't rely on the tex encoding so it should work.


7

\documentclass[pstricks,border=12pt]{standalone} \usepackage{graphicx} \def\Row{5} \def\Column{5} \def\FilenameMain{example-image-A} \def\FilenameChild{example-image-B} \def\ScaleMain{1} \def\ScaleChild{0.25} \newsavebox\IBoxMain \newsavebox\IBoxChild \savebox\IBoxMain{\includegraphics[scale=\ScaleMain]{\FilenameMain}} \savebox\IBoxChild{\includegraphics[...


7

Usually these days the postscript is converted to pdf or otherwise processed by a ghostscript based interpretor. ghostscript has an option to disable operations that you may not want to allow when running code from an unknown source: -dSAFER Disables the "deletefile" and "renamefile" operators and the ability to open files in any mode other than ...


7

Just a remark to question 2: The closest in terms of printing is probably PostScript (.ps). That's what laser printers understand directly and what is usually sent to the printer when you press "print" in your PDF reader. Nevertheless, pdfTeX with PDF is certainly the output format of choice these days (e.g., since it has the beautiful microtype). DVI is ...


7

The main problem is, that you must set output before plotting! set terminal postscript ps set output 'a03e02.ps' plot sin(2500*x)/(pi*x) I tested with dvipdf, and it worked for me (TeXLive 2013), but personally I always use the latex -> dvips -> ps2pdf chain. Some comments to the LaTeX-document: You must include the graphicx package You cannot use $...


7

Postscript dictionaries implement the concept of name spaces which allow for control of variable visibility. To see the command line output from the Postscript interpreter, run ps2pdf on the PS file produced by dvips. \documentclass{article} \usepackage{pstricks} \begin{document} Dictionaries implement the concept of name spaces to control variable ...


7

A PostScript printer would be useful (some work is done outside your computer) only to print PostScript files, however it is not necessary. If you want to print PDF's, a PostScript printer doesn't help, however you can still print them. See also http://desktoppub.about.com/cs/printing/a/postscriptprint.htm, especially If you are a professional desktop ...


7

The procedures Sin and Cos aren't native PostScript operators, but are defined in pst-solides3d.pro as: /Cos {rd cos} def /Sin {rd sin} def with /pi 3.14159 def /rd {180 pi div mul} def The native PostScript operators are sin and cos and take their argument in degrees. If you want to specify an angle in radians which should be used by rotateOpoint3d, ...


7

Automatic font expansion does not work with pdflatex in DVI mode (which is what is implicitly called when you run latex), therefore microtype will switch off font expansion by default. This results in the differences in output you observe. Traditionally, you would have to create and install expanded font instances in advance, which is not something I would ...


7

As far as I can see (postscript manual page 45 names have to be characters and characters have to be "printable ascii" and there are no ascii characters above 127. As noted in comments elsewhere the manual clarifies that the restriction to ASCII (that is characters below 128) is only a recommendation. A quick test with ghostscript shows that /Pi {3.14} def ...


6

You can use the picture environment; with the help of the picture and calc packages we can easily place both graphs, the important thing is that the inner one is typeset after the outer one. Notice that this does not depend on pstricks, so it is a more portable solution. \documentclass{article} \usepackage{graphicx,picture,calc} \usepackage{lipsum} \begin{...


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