[texhax] Avoiding \special{} conflicts

Tom Rokicki rokicki at gmail.com
Sat Feb 27 02:21:13 CET 2016

```Typically you pick a verb (like psfile) which starts the special; most
drivers look for and
support specific verbs.  As long as you pick a unique verb you should be
okay.

Dvips has a long and perhaps tortured history with specials.  It recognizes
the following
prefixes.  The ones with colons require the colons.  The ones with = signs
generally
require an equals sign.

landscape
papersize
xtex:
background
color
"
!
em:
ps:
psfile=
ifffile=
tekfile=
hsize=
vsize=
hoffset=
voffset=
hscale=
vscale=
angle=
llx=
lly=
urx=
ury=
rwi=
rhi=
clip=

If TPIC is compiled in, the following additional keywords are recognized:

pn pa fp ip da dt sp ar ia sh wh bk tx

These all require an immediate space afterwards, or that they have no
following characters.

My recommendation is to pick a reasonably verbose prefix such as
hypertex: or something.  Right now there's no special "registry" that I am
aware of, whether formal or informal, but if you ask on texhax if that
prefix is used, I think most maintainers can tell you.

I don't recommend examining the "dospecial.c" code of dvips unless
you have a ready and copious supply of eyewash.  I know that I will
be trying hard this evening to unsee some of the things I just saw.

-tom

On Fri, Feb 26, 2016 at 4:58 PM, Douglas McKenna <doug at mathemaesthetics.com>
wrote:

> \special{} commands insert arbitrary text strings into a box's contents.
> The strings are exported along with the box and its contents by the
> interpreter to whatever's on the back end willing to respond to the
> information (DVI tools, XDVI tools, PDF tools, in my case a custom eBook
>
> I'm assuming that the rule is that any backend that doesn't recognize a
> particular \special{} exported its way simply ignores it.  So far so good.
>
> I would like to implement some \specials{} so as to deliver to my backend
> (client program) information I place inside a box, using macro commands
> defined in the TeX source code.
>
> Is there an informal syntax or agreed-upon formatting standard in the TeX
> community for ensuring that a custom \special{} extension such as this
> doesn't conflict with or confuse an existing \special{} being used in some
> package, format, or other part of the greater TeX ecosystem?
>
> How does one determine the currently supported set of implemented
> \special{} commands that everyone in the TeX world depends upon, so I can
> avoid creating a conflict?
>
> How are such conflicts resolved?
>
> IMWTK!
>
>
> Doug McKenna
>
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
>

--
--  http://cube20.org/  --  [ <http://golly.sf.net/>Golly link suppressed;