diff options
author | Karl Berry <karl@freefriends.org> | 2010-11-21 19:50:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-11-21 19:50:25 +0000 |
commit | 99a14bc93fb7ae3f8825aa721f9517388371035e (patch) | |
tree | d671941b55a8a3aad2a200189aa2bd0a72e02fc2 /Master/texmf-dist/metapost/drv | |
parent | ab3e01d6373ee7eda3eeeaad98a096c1525cb8cf (diff) |
drv 0.96 (20nov10)
git-svn-id: svn://tug.org/texlive/trunk@20511 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost/drv')
-rw-r--r-- | Master/texmf-dist/metapost/drv/drv.mp | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/Master/texmf-dist/metapost/drv/drv.mp b/Master/texmf-dist/metapost/drv/drv.mp index a5791649f82..8323b9f00af 100644 --- a/Master/texmf-dist/metapost/drv/drv.mp +++ b/Master/texmf-dist/metapost/drv/drv.mp @@ -1,4 +1,4 @@ -%% drv 0.95 +%% drv 0.96 %% Copyright 2010 Laurent M\'ehats % % This work may be distributed and/or modified under the @@ -17,7 +17,7 @@ % This work consists of the file drv.mp newinternal drv_version; -drv_version:=0.95; +drv_version:=0.96; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -368,7 +368,29 @@ fi % copying LaTeX preamble % -vardef drv_read (expr search_str) (suffix accum_str)= +vardef drv_find_verbatimtex= + save readfrom_str; + string readfrom_str; + forever: + readfrom_str:=readfrom jobname; + exitif (readfrom_str="verbatimtex%&latex") + or (readfrom_str="verbatimtex %&latex") + or (readfrom_str=EOF); + endfor + if readfrom_str="verbatimtex %&latex": + drv_message "warning, "&ditto&"verbatimtex %&latex"&ditto& + " is deprecated, you should use "&ditto&"verbatimtex%&latex"&ditto& + " instead."; + fi + if readfrom_str=EOF: + closefrom jobname; + drv_errhelp ("`"&jobname&".mp' should contain "& + ditto&"verbatimtex%&latex"&ditto&" on a single line."); + drv_errmessage (ditto&"verbatimtex%&latex"&ditto&" is missing"); + fi +enddef; + +vardef drv_find (expr search_str) (suffix accum_str)= save readfrom_str, readfrom_substr; string readfrom_str, readfrom_substr; accum_str:=""; @@ -387,19 +409,19 @@ vardef drv_read (expr search_str) (suffix accum_str)= enddef; string tex_preamble_str[]; -% tex_preamble_str[0] from "verbatimtex %&latex" to "\begin{document}" +% tex_preamble_str[0] from "verbatimtex%&latex" to "\begin{document}" % tex_preamble_str[1] from "\begin{document}" to "etex;" drv_message ("reading `"&jobname&".mp' LateX preamble."); - drv_read ("verbatimtex %&latex", tex_preamble_str[0]); - drv_read ("\begin{document}", tex_preamble_str[0]); - drv_read ("etex;", tex_preamble_str[1]); + drv_find_verbatimtex; + drv_find ("\begin{document}", tex_preamble_str[0]); + drv_find ("etex;", tex_preamble_str[1]); closefrom jobname; write "%"&char(10)& "% AUTOMATICALLY GENERATED BY DRV.MP - DO NOT MODIFY."&char(10)& "%"&char(10)&char(10)& - "verbatimtex %&latex"&char(10)& + "verbatimtex%&latex"&char(10)& tex_preamble_str[0]& "\begin{document}"&char(10)& tex_preamble_str[1]& @@ -1594,14 +1616,14 @@ enddef; vardef drv_bot_check[]= if unknown jdg[@]: - drv_errhelp "An index must be used to declare a both a judgment and an"& + drv_errhelp "An index must be used to declare both a judgment and an"& " inference."; drv_errmessage (decimal @)&" has been used as an inference index but not"& " as a judgment index"; elseif unknown prm_num[@]: - drv_errhelp "An index must be used to declare a both a judgment and an"& + drv_errhelp "An index must be used to declare both a judgment and an"& " inference."; - drv_errmessage (decimal @)&" has been used as a judgment index but not"& + drv_errmessage (decimal @)&" has been used as a premise index but not"& " as an inference index"; else: save i_sty, prm_idx; @@ -1630,14 +1652,14 @@ enddef; vardef drv_top_check[]= if unknown jdg[@]: - drv_errhelp "An index must be used to declare a both a judgment and an"& + drv_errhelp "An index must be used to declare both a judgment and an"& " inference."; drv_errmessage (decimal @)&" has been used as an inference index but not"& " as a judgment index"; elseif unknown prm_num[@]: - drv_errhelp "An index must be used to declare a both a judgment and an"& + drv_errhelp "An index must be used to declare both a judgment and an"& " inference."; - drv_errmessage (decimal @)&" has been used as a judgment index but not"& + drv_errmessage (decimal @)&" has been used as a premise index but not"& " as an inference index"; else: save i_sty, prm_idx; |