From: Angus Leeming Date: Thu, 4 Sep 2003 10:17:39 +0000 (+0000) Subject: (Johnathan Burchill): clever latex to input an xfig .pstex_t file if it X-Git-Tag: 1.6.10~16177 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f2d97f93b4d9c9fa46d14672c461baf09ff1cc17;p=features.git (Johnathan Burchill): clever latex to input an xfig .pstex_t file if it exists, else print a warning. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7660 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ChangeLog b/lib/ChangeLog index ec1f7803fc..f046ccbaa4 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-09-04 Johnathan Burchill + + * 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 * scripts/fig2pdftex.sh: diff --git a/lib/external_templates b/lib/external_templates index d8b9ac4fd3..32fdc95e6c 100644 --- a/lib/external_templates +++ b/lib/external_templates @@ -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\")"