#! /bin/sh /usr/share/dpatch/dpatch-run
## 20_transfig_pdftex.dpatch by Jindrich Makovicka <makovick@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Support pdftex output in transfig
@DPATCH@
diff -urNad transfig~/transfig/mkfile.c transfig/transfig/mkfile.c
--- transfig~/transfig/mkfile.c
+++ transfig/transfig/mkfile.c
@@ -34,7 +34,7 @@
argument *a;
char *i;
enum language to;
- int needps, needeps, needpic, needfig;
+ int needps, needeps, needpic, needfig, needpdf;
fprintf(mk, "#\n# TransFig makefile\n#\n");
@@ -48,7 +48,7 @@
i = a->name;
to = a->tolang;
- needps = needeps = needpic = needfig = 0;
+ needps = needeps = needpic = needfig = needpdf =0;
fprintf(mk, "\n# translation into %s\n\n", lname[(int)to]);
@@ -108,6 +108,7 @@
puttarget(mk, i, "tex", "pdf");
fprintf(mk, "\tfig2dev -L pdftex_t -p %s.pdf ", i);
putoptions(mk, altfonts, a->f, a->s, a->m, a->o, i, "tex");
+ needpdf = 1;
break;
case pictex:
@@ -177,6 +178,21 @@
putclean(mk, i, "ps" );
}
+ /* conversion to PDF */
+ if (needpdf && a->type != i_pdf) {
+ if ( a->topdf ) {
+ puttarget(mk, i, "pdf", iname[(int)a->type]);
+ fprintf(mk, "\t%s %s.%s > %s.pdf\n", a->topdf, i, iname[(int)a->type], i);
+ }
+ else {
+ putfig(mk, (to == pdftex ? pdftex : pdf),
+ altfonts, a->f, a->s, a->m, a->o, i, "pdf");
+ a->interm = mksuff(i, ".pdf");
+ needfig = 1;
+ }
+ putclean(mk, i, "pdf" );
+ }
+
/* conversion to eps */
if (needeps && a->type != i_eps) {
if ( a->tops ) {
diff -urNad transfig~/transfig/transfig.c transfig/transfig/transfig.c
--- transfig~/transfig/transfig.c
+++ transfig/transfig/transfig.c
@@ -249,6 +249,7 @@
a->tofig = NULL;
a->topic = NULL;
a->tops = NULL;
+ a->topdf = NULL;
a->tolang = tolang;
/* PIC */
@@ -268,6 +269,14 @@
return a;
}
+ /* PDF format */
+ if (strip(arg, ".pdf"))
+ {
+ a->name = mksuff(arg, "");
+ a->type = i_pdf;
+ return a;
+ }
+
/* EPS format */
if (strip(arg, ".eps"))
{
diff -urNad transfig~/transfig/transfig.h transfig/transfig/transfig.h
--- transfig~/transfig/transfig.h
+++ transfig/transfig/transfig.h
@@ -35,11 +35,11 @@
textyl, tiff, tk, tpic, xbm, xpm};
#define MAXLANG xpm
-enum input {i_apg, i_fig, i_pic, i_ps, i_eps};
+enum input {i_apg, i_fig, i_pic, i_ps, i_eps, i_pdf};
#define MAXINPUT xps
typedef struct argument{
- char *name, *interm, *f, *s, *m, *o, *tofig, *topic, *tops;
+ char *name, *interm, *f, *s, *m, *o, *tofig, *topic, *tops, *topdf;
enum language tolang;
enum input type;
struct argument *next;
diff -urNad transfig~/transfig/txfile.c transfig/transfig/txfile.c
--- transfig~/transfig/txfile.c
+++ transfig/transfig/txfile.c
@@ -116,6 +116,11 @@
fprintf(tx, "\\typeout{TransFig: figures in PostScript.}\n");
break;
+ case pdftex:
+ fprintf(tx, "\\typeout{TransFig: figure text in LaTeX.}\n");
+ fprintf(tx, "\\typeout{TransFig: figures in PDF.}\n");
+ break;
+
case psfig:
fprintf(tx, "\\typeout{TransFig: figures in PostScript w/psfig.}\n");
fprintf(tx, "\\%s{psfig}\n",INCLFIG);