[tex-k] header special extension proposal

Akira Kakuto kakuto at fsci.fuk.kindai.ac.jp
Fri Aug 19 11:57:33 CEST 2005


Hi Hendri, Karl,

> I did find one problem with the current implementation which I have
> overlooked until now while working only locally: the header special only
> looks in the current dir and in (local)texmf/dvips for header files, while
> the psfile special also looks in the texmf/tex tree.

Files are also searched for by using TEXINPUTS (TEXPICTS if defined)
only in the extended case, by applying the following patch.
(Others are minor fixes.)

Thanks
Akira


--- dospecial.c.orig	Thu Aug 18 08:54:34 2005
+++ dospecial.c	Fri Aug 19 18:37:12 2005
@@ -398,8 +398,8 @@
 	 r = p-1 ;
 	 while ((*r <= ' ' || *r == ')') && r >= q)
 	    r-- ;
+	 if (*p != 0) p++ ;
 	 r[1] = 0 ; /* q is the file name */
-	 p++;
 	 while ((*p <= ' ' || *p == '=' || *p == '(') && *p != 0)
 	    p++ ;
 	 if(strncmp(p, "pre", 3) == 0) {
--- header.c.orig	Thu Aug 18 08:54:34 2005
+++ header.c	Fri Aug 19 18:40:30 2005
@@ -163,7 +163,7 @@
 void
 send_headers P1H(void) {
    struct header_list *p = header_head ;
-   char *q, *r ;
+   char *q ;
 
    while (0 != (q=get_name(&p))) {
 #ifdef DEBUG
--- output.c.orig	Thu Aug 18 08:54:36 2005
+++ output.c	Fri Aug 19 18:44:09 2005
@@ -194,6 +194,10 @@
 #endif
    default:
       f = search(headerpath, s, READBIN) ;
+      if(cur_header) {
+	 if(f==NULL)
+	    f = search(figpath, s, READBIN) ;
+      }
       (void)sprintf(errbuf, "! Could not find header file %s", s) ;
       break ;
    }
@@ -236,7 +240,7 @@
             (void)fprintf(bitfile, "%%%%BeginProcSet: %s 0 0\n", s) ;
       }
       if (cur_header && cur_header->precode) {
-         (void)fprintf(bitfile, "\n%s\n", cur_header->precode) ;
+         (void)fprintf(bitfile, "%s\n", cur_header->precode) ;
          free(cur_header->precode) ;
       }
       c = getc(f) ;



More information about the tex-k mailing list