[Textures] pdfpages

Bruno Voisin bvoisin at me.com
Sat Sep 30 05:19:38 EDT 2017


> Le 30 sept. 2017 à 01:47, Paul Cizmas <cizmas at mac.com> a écrit :
> 
> Is any of you able to use pdfpages package with Textures?

The short answer: no, unfortunately, pdfpages is incompatible with Textures. 

Should you want more details, trying to present things in an understandable way:


pdfpages: the theory
====================

pdfpages uses low-level functionalities of the PDF format, hence requires a modern TeX engine, designed from the ground up with PDF in mind. Such are pdfTeX and LuaTeX (which output PDF directly from the .tex code), or XeTeX (which outputs XDVI, an extended version of the DVI format, then converts it transparently to PDF using xdvipdfmx).   

Such are not dvips, nor Textures, which were both designed with the PS format in mind. The way the original TeX worked was by outputting DVI and using dvips to convert it to PS; then Ghostscript was invoked, to either print the result or (on present-day setups) convert it to PDF.

Similarly, Textures outputs DVI and converts it internally to PS; then built-in Mac OS functions are invoked via the Print dialog, to either print the result or save it to PS or (on OS X) PDF.

That leaves most of what's required by pdfpages out of the way, unfortunately. Specifically, pdfpages requires existence of PDF-specific \special commands, that neither dvips nor Textures provide.

On top of that, even regarding Postscript alone, Carbon Textures never implemented the full PS support documented in the Textures manual for Classic Textures (only "\special illustration", no "\special postscript" nor "\special rawpostscript", for example). Details on what was and wasn't supported can still be browsed from the internet archive, for example

http://web.archive.org/web/20121014163446/http://www.bluesky.com/news/220a.html
http://web.archive.org/web/20121013232707/http://www.bluesky.com/news/220b.html

I don't know exactly how Carbon Textures added PDF support to "\special illustration". Possibly the PDF file was converted internally to PS before inclusion, using /usr/libexec/cups/filter/cgpdftops or whatever equivalent instruction exists in Apple's API.

Even though, that support was pretty limited: as documented on the above web pages, only the first page of PS or PDF files could be included with "\special illustration", something which would seriously compromise the use of pdfpages.

Another limitation is that pdfpages requires the existence of a TeX command specifying the media size (the size of the PDF page), for various resizing operations. This has been \pagewidth and \pageheight in pdfTeX, LuaTeX and XeTeX these last two years or so, previously it was \pdfpagewidth and \pdfpageheight. Equivalently dvips has "\special papersize", but Textures has nothing: the media size isn't specified inside the .tex file, it can only be specified using Page Setup in the File menu, making it inaccessible to pdfpages.


pdfpages: the practice
======================

Enough talk: if you have MacTeX, the pdfpages package lives at

/Library/TeX/Root/texmf-dist/tex/latex/pdfpages

and its documentation at

/Library/TeX/Root/texmf-dist/doc/latex/pdfpages

You can browse the first location, to see how pdfpages is implemented: there is a definition file pp<engine>.def for each supported engine, implementing the high-level PDF manipulation commands of pdfpages in terms of the low-level PDF \special syntax of each engine.

The file ppdvips.def essentially issues error messages telling that dvips isn't supported, and for Textures it would be the same. This is verified by typesetting the example/test file pdf-ex.tex from the second above location, with either TeXShop in TeX and DVI mode, or with Textures: for both, you get essentially blank output pages and lots of error messages in the Console/Log window, such as

Package pdfpages Warning: I will use a dummy \includepdf command which
(pdfpages)                will insert empty pages instead of the actual PDF,
(pdfpages)                because we are running in DVI mode or with
(pdfpages)                dvips driver.


A workaround
============

Given the above, pdfpages is a dead end. The only thing Textures can do with PDF files is include their first page using the graphics/graphicx package and \includegraphics.

This assumes that you use the file textures.def that was shipped with Textures (on the Classic Textures CD, in the archive Inputs.zip that was available at the Blue Sky web site, or in the distribution CarboneTextures.zip put together by Reinhard Diestel), not the one from MacTeX. This file includes

\ProvidesFile{textures.def}%
[1997/5/28 v0.3
  Graphics extensions for Textures 1.7 and later
  (Arthur Ogawa/ogawa at teleport.com)%
]%

Even though, you'll be limited to what \includegraphics can do, and will have to manipulate boxes the usual LaTeX way (resize, rotate, etc.). You'll also have to convert multi-page PDF files into collections of single-page PDF files before inclusion.

Last I tried, also, if I remember correctly, graphicx.sty works better with Textures than graphics.sty (namely, \includegraphics[width=...,height=...]{file.pdf} better than \resizebox{...}{...}{\includegraphics{file.pdf}}).


Finally: as I already wrote on this list, I think using Textures nowadays is a waste of time. (And this advice comes from someone who wasted lots and lots of time on Textures, stubbornly persisting even when sensible people -- like Gary Gray, our list admin -- told him this was a waste and the best was to just let go.)

Textures uses a design from 20 years ago, at the very least. In the early 2000s it was painfully updated to work on OS X, supporting only a subset of what Classic Textures did. But in the meantime, the TeX world progressed -- a lot!

As a consequence, trying to use any current LaTeX package with Textures is Russian roulette. Most of the time this won't work, and even if it does the functionality may be limited. And I'm not even speaking of fonts!

The current LaTeX sources don't even compile with Textures: they require the e-TeX extensions, which Textures never included.

I stopped using Textures a couple of years ago, and even last month finally removed it from my Dock, where it had been since Mac OS X Public Beta. I still keep it around on my Mac, so that one day I'll save all my old Textures files to PDF, but that's all.

TeXShop, as installed by MacTeX, provides a modern alternative to Textures, using similar design and user interface but with infinitely more possibilities, and full compatibility with TeX as distributed for Linux and Windows.

If you want something more integrated, more user-friendly, in particular with something resembling Textures' Flash Mode, I recommend switching to Texpad <https://www.texpad.com>. (It also allows to use both Mac and iPad, thought I've never tried as I don't own an iPad.)

TeXShop is almost as fast as Textures, especially in pdfTeX mode. Texpad is slower.

That's it, I hope the above can be useful despite the length.

Bruno




More information about the Textures mailing list