| 1 |
Converting tpic \special's into \pdfliteral's by awk |
| 2 |
==================================================== |
| 3 |
|
| 4 |
The experimental awk-script tpic2pdftex builds one bridge between the |
| 5 |
"pic" graphics language and pdfTeX. |
| 6 |
|
| 7 |
What tpic2pdftex does: |
| 8 |
|
| 9 |
We start from one or more graphics described by the venerable pic language |
| 10 |
(see e. g., file example.pic), embedded inline within pdfTeX or pdfLaTeX |
| 11 |
code, and limited by classical .PS and .PE markers as known from groff. |
| 12 |
The pic graphics might be annotated by TeX or LaTeX text. This pic/TeX |
| 13 |
language-mix file is piped through the (groff-)pic preprocessor and the |
| 14 |
tpic2pdftex script. The result is a TeX file with inline \pdfliteral{} |
| 15 |
sections, for further processing by pdftex or pdflatex. |
| 16 |
|
| 17 |
|
| 18 |
Usage |
| 19 |
----- |
| 20 |
|
| 21 |
$ export LANG="C" |
| 22 |
$ pic -t somefile.pic | tpic2pdftex > somefile.tex |
| 23 |
|
| 24 |
Process somefile.tex by pdftex or pdflatex. |
| 25 |
|
| 26 |
|
| 27 |
Files |
| 28 |
----- |
| 29 |
|
| 30 |
tpic2pdftex |
| 31 |
The executable awk-script for converting tpic specials into pdfliterals |
| 32 |
for further processing by pdftex. For usage see head of this file. |
| 33 |
|
| 34 |
tpic2pdftex.1 |
| 35 |
The man-page for tpic2pdftex. |
| 36 |
|
| 37 |
example.pic |
| 38 |
A small pic sample file (plain-TeX), as input. |
| 39 |
|
| 40 |
example.pdf |
| 41 |
The resulting example PDF file (the dotted and dashed ellipses are |
| 42 |
part of gpic from version 1.19.1 on). |
| 43 |
|
| 44 |
beamerexample.pic |
| 45 |
Another small pic sample file (pdfLaTeX), which shows that images |
| 46 |
created by pic can be incrementally built up in the beamer class. |
| 47 |
|
| 48 |
beamerexample.pdf |
| 49 |
The resulting PDF file from beamerexample.pic. |
| 50 |
|
| 51 |
Makefile |
| 52 |
The Makefile used to produce file example.pdf and beamerexample.pdf |
| 53 |
from the input files. |
| 54 |
|
| 55 |
README |
| 56 |
This file. |
| 57 |
|
| 58 |
|
| 59 |
Portability |
| 60 |
----------- |
| 61 |
|
| 62 |
This awk-script should be useable on all systems on which a working awk |
| 63 |
program (e. g., awk, gawk, mawk) is installed. |
| 64 |
|
| 65 |
The script has been tested with GNU pic (groff), versions 1.18.1 and |
| 66 |
1.19.3, and pdftex, versions 1.40.9 and 1.50.0 on a debian lenny (5.0) |
| 67 |
x86_64 PC. |
| 68 |
|
| 69 |
|
| 70 |
Remarks |
| 71 |
------- |
| 72 |
|
| 73 |
1. If more than a single .pic file provide the source for the .tex file, |
| 74 |
there are two options: Either separately run all .pic files through the |
| 75 |
pic -t | tpic2pdftex pipe and combine them by TeX's \input statements |
| 76 |
as usual. Or make one big .pic file by using the soelim program from |
| 77 |
groff (with option -t), and then run the resulting .pic file through pic, |
| 78 |
tpic2pdftex, and TeX. File embedding by soelim is done by the request: |
| 79 |
|
| 80 |
.so somefile.pic |
| 81 |
|
| 82 |
The process call then could look like e. g.: |
| 83 |
|
| 84 |
$ soelim -t somefile.pic | pic -t | tpic2pdftex > somefile.tex |
| 85 |
|
| 86 |
2. Depending on the awk version, "locale" settings might have influence |
| 87 |
on the separator in floating point numbers. PDF requires decimal _dots_ |
| 88 |
(e. g., 3.14 rather than 3,14) which is checked by tpic2pdftex at the |
| 89 |
begin of the run. If you get an ERROR message, set LANG="C", so that |
| 90 |
decimal dots are used as float separators. |
| 91 |
|
| 92 |
|
| 93 |
Literature |
| 94 |
---------- |
| 95 |
|
| 96 |
Brian W. Kernighan: PIC -- A Graphics Language for Typesetting, User |
| 97 |
Manual, Revised, May, 1991. File cstr116.ps. |
| 98 |
|
| 99 |
Eric S. Raymond: Making Pictures With GNU PIC. File gpic.raymond.ps. |
| 100 |
|
| 101 |
Both files are available online from various places. |
| 102 |
|
| 103 |
|
| 104 |
Comments welcome. Have fun! |
| 105 |
|
| 106 |
Hartmut |
| 107 |
|
| 108 |
$Id: README,v 1.11 2010/01/16 12:38:21 hahe Exp hahe $ |