Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Preventing dvips from word-wrapping PostScript literals

5 views
Skip to first unread message

Scott Pakin

unread,
Apr 20, 2006, 2:50:02 AM4/20/06
to
Why does dvips word-wrap PostScript literals and can I make it not do
that? Here's an example of the problem:

\documentclass{minimal}
\begin{document}
\makeatletter
\null
\special{ps:\@percentchar\space
I'd really prefer it if dvips didn't wrap lines of PostScript that are included via a backend special.}
\makeatother
\end{document}

Run the above through LaTeX and you'll see that the whatsit is correct
in the DVI file:

$ dvitype junk.dvi | fgrep xxx
105: xxx 'ps:% I'd really prefer it if dvips didn't wrap lines of PostScript that are included via a backend special.'

However, dvips splits the text at ~70 characters:

$ dvips junk.dvi
This is dvips(k) 5.92b Copyright 2002 Radical Eye Software (www.radicaleye.com)
' TeX output 2006.04.20:0032' -> junk.ps
<texc.pro><special.pro>. [1]
$ grep -A1 prefer junk.ps
% I'd really prefer it if dvips didn't wrap lines of PostScript that
are included via a backend special.

Naturally, the resulting PostScript is invalid here.

Is there some way I can force dvips to include literal PostScript _literally_?

Thanks in advance,
-- Scott

Ulrike Fischer

unread,
Apr 20, 2006, 3:58:00 AM4/20/06
to
Scott Pakin <scot...@pakin.org> schrieb:

I guess you are trying to put a comment in the ps, right?

I found this in an old answer of David Carlisle which is perhaps
helpful:

> \catcode`\%=12
> \special{"%% This is a Comment in PS}
> \catcode`\%=14

Don't try that. don't try anything!
.....
% This is a Comment in PS

does end up in the resulting postscript, but you have no way to force
that it ends up on a line by itself. As postscript comments are line
based this means that whatever postscript code for the rest of the
document that dvips happens to put on the same line of the postscript
file will also get commented out.


You can put comments in a separate header .ps file and include them
with the header special or -h option. Then tex never sees the file and
dvips copies it verbatim, so the comments will get copied in to the
result.

--
Ulrike Fischer
e-mail: zusätzlich meinen Vornamen vor dem @ einfügen.
e-mail: add my first name between the news and the @.

Scott Pakin

unread,
Apr 20, 2006, 5:41:49 PM4/20/06
to
Ulrike Fischer wrote:
> I found this in an old answer of David Carlisle which is perhaps
> helpful:

Thanks. It's good to know that I'm not merely doing something stupid.

-- Scott

0 new messages