]> git.lyx.org Git - features.git/commitdiff
(Johnathan Burchill): clever latex to input an xfig .pstex_t file if it
authorAngus Leeming <leeming@lyx.org>
Thu, 4 Sep 2003 10:17:39 +0000 (10:17 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 4 Sep 2003 10:17:39 +0000 (10:17 +0000)
exists, else print a warning.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7660 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/external_templates

index ec1f7803fcac4caec46077fc2230f4e19bad1d88..f046ccbaa42b2d77231da981e0765d7577ef15cd 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-04  Johnathan Burchill  <jkerrb@shaw.ca>
+
+       * external_templates: add some clever LaTeX to the XFIG template so that
+       we input the file if it exists, else print a warning encased in an fbox.
+
 2003-09-03  Angus Leeming  <leeming@lyx.org>
 
        * scripts/fig2pdftex.sh: 
index d8b9ac4fd34035f8a301d1b008c5daf8f3ab99e4..32fdc95e6c8b8f474829ebd943c1b4739d3d76d0 100644 (file)
@@ -11,16 +11,38 @@ Template XFig
        EditCommand "xfig $$FName"
        AutomaticProduction true
        Format LaTeX
-               Product "\\input{$$Basename.pstex_t}"
+               Product "\\xfiginput{$$Basename.pstex_t}"
                UpdateFormat pstex
                UpdateResult "$$Basename.pstex_t"
                Requirement "graphicx"
+               Preamble
+               %% This inputs the file if it exists, else prints a warning
+               %% encased in an fbox.
+               \def\stripprefix#1>{}
+               \newcommand*{\xfiginput}[1]{%
+                       \edef\tempfilename{#1}%
+                       \InputIfFileExists{#1}{}{%
+                       \fbox{Could not find
+                       \ttfamily\expandafter\stripprefix\meaning\tempfilename
+               !}}}
+               PreambleEnd
        FormatEnd
        Format PDFLaTeX
-               Product "\\input{$$Basename.pdftex_t}"
+               Product "\\xfiginput{$$Basename.pdftex_t}"
                UpdateFormat pdftex
                UpdateResult "$$Basename.pdftex_t"
                Requirement "graphicx"  
+               Preamble
+               %% This inputs the file if it exists, else prints a warning
+               %% encased in an fbox.
+               \def\stripprefix#1>{}
+               \newcommand*{\xfiginput}[1]{%
+                       \edef\tempfilename{#1}%
+                       \InputIfFileExists{#1}{}{%
+                       \fbox{Could not find
+                       \ttfamily\expandafter\stripprefix\meaning\tempfilename
+               !}}}
+               PreambleEnd
        FormatEnd
        Format Ascii
                Product "$$Contents(\"$$Basename.asc\")"