diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/metapost/latexmp/README | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/latexmp/examples.pdf | bin | 126612 -> 0 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/metapost/latexmp/latexmp.pdf | bin | 90561 -> 174008 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/metapost/latexmp/lmp-grph.mp | 34 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/latexmp/lmp-mc-text.tex | 23 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/latexmp/lmp-mc.mp | 11 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/latexmp/lmp-mfun.mp | 34 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/latexmp/lmp-pkg.mp | 41 | ||||
-rw-r--r-- | Master/texmf-dist/metapost/latexmp/latexmp.mp | 69 |
9 files changed, 42 insertions, 179 deletions
diff --git a/Master/texmf-dist/doc/metapost/latexmp/README b/Master/texmf-dist/doc/metapost/latexmp/README index 829eeb5943c..604654ab872 100644 --- a/Master/texmf-dist/doc/metapost/latexmp/README +++ b/Master/texmf-dist/doc/metapost/latexmp/README @@ -3,9 +3,10 @@ interface to access LaTeX-based typesetting capabilities in MetaPost. The text to be typeset is given as string. This allows even dynamic text elements, for example counters, to be used in -labels. Compared to other implementations it is much more -flexible, since it can be used as direct replacement for -btex..etex, and much faster, compared for example to -the solution provided by tex.mp. +labels. All files of the package belong to the Public Domain. + +Since version 1.2 the MP prologues value is not set by +latexMP anymore. Additionally, the compatibility with +the normal btex..etex behaviour has been improved. diff --git a/Master/texmf-dist/doc/metapost/latexmp/examples.pdf b/Master/texmf-dist/doc/metapost/latexmp/examples.pdf Binary files differdeleted file mode 100644 index 2ef6cf299a2..00000000000 --- a/Master/texmf-dist/doc/metapost/latexmp/examples.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/metapost/latexmp/latexmp.pdf b/Master/texmf-dist/doc/metapost/latexmp/latexmp.pdf Binary files differindex e96ff5a4e5a..297d4b4c78c 100644 --- a/Master/texmf-dist/doc/metapost/latexmp/latexmp.pdf +++ b/Master/texmf-dist/doc/metapost/latexmp/latexmp.pdf diff --git a/Master/texmf-dist/doc/metapost/latexmp/lmp-grph.mp b/Master/texmf-dist/doc/metapost/latexmp/lmp-grph.mp deleted file mode 100644 index 1602717b6ab..00000000000 --- a/Master/texmf-dist/doc/metapost/latexmp/lmp-grph.mp +++ /dev/null @@ -1,34 +0,0 @@ -input latexmp ; -input graph ; - -% create data file -write "10 2e-2" to "lmp-data.dat" ; -write "20 3e4" to "lmp-data.dat" ; -write "30 8e4" to "lmp-data.dat" ; -write "100 7e4" to "lmp-data.dat" ; -write "130 2e5" to "lmp-data.dat" ; -write "200 4e5" to "lmp-data.dat" ; -write "500 8e5" to "lmp-data.dat" ; -write "600 1e7" to "lmp-data.dat" ; -write "1000 2e7" to "lmp-data.dat" ; -write "2000 8e7" to "lmp-data.dat" ; -write EOF to "lmp-data.dat" ; -% - -setupLaTeXMP( - mode=normal,% 'graph' package does not work in rerun mode - packages="mathpazo") ; - - -init_numbers(textext("$-$"),textext("$1$"),textext("${\times}10$"), - textext("${}^-$"),textext("${}^2$")) ; -Fe_base:=textext("$10$") ; - -beginfig(1); - draw begingraph(6cm,4cm) - setcoords(linear,log); - gdraw "lmp-data.dat" ; - endgraph ; -endfig; - -end diff --git a/Master/texmf-dist/doc/metapost/latexmp/lmp-mc-text.tex b/Master/texmf-dist/doc/metapost/latexmp/lmp-mc-text.tex deleted file mode 100644 index d9f2dd20aaf..00000000000 --- a/Master/texmf-dist/doc/metapost/latexmp/lmp-mc-text.tex +++ /dev/null @@ -1,23 +0,0 @@ -\textcolor[rgb]{0.9,0.65,0}{\bfseries Der Löwe und die Mücke} -\color[gray]{0.4}Eine Mücke forderte mit den übermütigsten Worten -einen Löwen zum Zweikampf heraus: \textcolor{blue}{Ich -fürchte dich nicht, du großes Ungeheuer}, rief sie ihm -zu, \textcolor{blue}{weil du gar keine Vorzüge vor mir hast; -oder nenne sie mir, wenn du solche zu haben glaubst; etwa -die, dass du deinen Raub mit Krallen zerreißest und -mit Zähnen zermalmest? Jedes andere feige Tier, wenn es -mit einem Tapfern kämpft, tut dasselbe, es beißt und -kratzt. \color[rgb]{0.7,0,0}Du sollst aber empfinden, -dass ich stärker bin als du!} -Mit diesen Worten flog sie in eines seiner -Nasenlöcher und stach ihn so sehr, dass er sich vor -Schmerz selbst zerfleischte und sich für überwunden -erklärte. - -\color[rgb]{0,0.6,0}Stolz auf diesen Sieg flog die Mücke davon, -um ihn aller Welt auszuposaunen, übersah aber das Gewebe einer Spinne -und verfing sich in demselben. Gierig umarmte die Spinne -sie und sog ihr das \textcolor{red}{Heldenblut} aus. Sterbend empfand -die Mücke ihre Nichtigkeit, indem sie, die Besiegerin des -Löwen, einem so verächtlichen Tiere, einer Spinne, -erliegen musste. diff --git a/Master/texmf-dist/doc/metapost/latexmp/lmp-mc.mp b/Master/texmf-dist/doc/metapost/latexmp/lmp-mc.mp deleted file mode 100644 index 3b75c270648..00000000000 --- a/Master/texmf-dist/doc/metapost/latexmp/lmp-mc.mp +++ /dev/null @@ -1,11 +0,0 @@ - -input latexmp ; - -setupLaTeXMP(mode=rerun, - fontencoding="T1",inputencoding="latin1",language="ngerman", - textextlabel=enable, multicolor=enable) ; - -beginfig(1); - label("\parbox{12cm}{\input{lmp-mc-text}}", origin) ; -endfig; -end diff --git a/Master/texmf-dist/doc/metapost/latexmp/lmp-mfun.mp b/Master/texmf-dist/doc/metapost/latexmp/lmp-mfun.mp deleted file mode 100644 index a5b44f1b2be..00000000000 --- a/Master/texmf-dist/doc/metapost/latexmp/lmp-mfun.mp +++ /dev/null @@ -1,34 +0,0 @@ -input metafun ; -cmykcolors:=true ;% enable cmyk-specials in MetaFun -input latexmp ; - -% - mode is set to 'normal' since MetaFun doesn't work in rerun-mode; -% please rerun manually -% - the file has to be converted in PDF using MPtoPDF in order -% to interpret the MP-specials generated by MetaFun - -setupLaTeXMP(packages="helvet", - preamble="\renewcommand{\familydefault}{\sfdefault}", - textextlabel=enable,multicolor=enable) ; - -beginfig(1); - save p,c ; pair p ; color c ; - - for i=1 upto 100: - p:= (uniformdeviate 8cm, uniformdeviate 5cm) ; - label.urt("\bfseries\transparent{0.2}{MetaFun}",p) ; - endfor; - - for i=1 upto 20: - c:= (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1) ; - p:= (-50pt+uniformdeviate 100pt, -50pt+uniformdeviate 100pt) ; - label("\bfseries\Huge\color[rgb]{" & - (decimal redpart c) & "," & (decimal greenpart c) & "," & - (decimal bluepart c) & "}" & - "\transparent{0.4}{MetaFun}",(5cm,2.5cm)+p) ; - endfor; - - label.top("two different greens: one in \textcolor[cmyk]{1,0,1,0}{cmyk} " & - "and one in \textcolor[rgb]{0,1,0}{rgb}", (5cm,2.5cm)) ; -endfig; -end diff --git a/Master/texmf-dist/doc/metapost/latexmp/lmp-pkg.mp b/Master/texmf-dist/doc/metapost/latexmp/lmp-pkg.mp deleted file mode 100644 index fd6613cf884..00000000000 --- a/Master/texmf-dist/doc/metapost/latexmp/lmp-pkg.mp +++ /dev/null @@ -1,41 +0,0 @@ - -input latexmp ; - -string OrdMacro, OoosMacro, otherDefs ; - -OrdMacro := -"\newcommand*{\Ord}[1]{\ifcase #1\relax" & - " #1\textsuperscript{th}\or" & - " #1\textsuperscript{st}\or" & - " #1\textsuperscript{nd}\or" & - " #1\textsuperscript{rd}\else" & - " #1\textsuperscript{th}\fi}" ; - -OoosMacro := - "\newcommand*{\Ooos}[1]{\setcounter{Ooos}{1}O\whiledo{\value{Ooos}<#1}" & - "{o\stepcounter{Ooos}}h}" ; - -otherDefs := "\newcounter{Ooos}\renewcommand{\familydefault}{\sfdefault}" ; - -setupLaTeXMP( - mode=rerun, - inputencoding="latin1", - fontencoding="T1", - packages="helvet,calc,ifthen,mflogo", - preamble=(OrdMacro & OoosMacro & otherDefs) , - textextlabel=enable ); - -beginfig(1); - for i=1 upto 5: - label.urt( "\Ord{" & (decimal i) & "} {\MP} label",(0,-10*i) ) ; - endfor; -endfig; - -beginfig(2); - for i=1 upto 50: - label( "\Ooos{" & (decimal i)& "}",(0,10*i) ) ; - endfor; - currentpicture:= (currentpicture slanted 0.5) yscaled 0.7 ; -endfig; - -bye diff --git a/Master/texmf-dist/metapost/latexmp/latexmp.mp b/Master/texmf-dist/metapost/latexmp/latexmp.mp index 3be76550b79..fea35e5332d 100644 --- a/Master/texmf-dist/metapost/latexmp/latexmp.mp +++ b/Master/texmf-dist/metapost/latexmp/latexmp.mp @@ -1,11 +1,11 @@ %D \module %D [ file=latexmp.mp, %D system={latexMP}, -%D version=1.1.0, +%D version=1.2.1, %D title=latexMP, %D subtitle=LaTeX typesetting in \METAPOST, %D author=Jens-Uwe Morawski, -%D date={2003/10/02}, +%D date={2005/04/06}, %D copyright={none; this module is Public Domain}] %D %C - all variables start with prefix "latexmp_" @@ -20,16 +20,13 @@ boolean latexmp_module ; latexmp_module := true ; %D set the name of the temporary file string latexmp_lmpfile ; latexmp_lmpfile := "ltx-" & jobname & ".tmp" ; -%D since {\LaTeX} will be used a different \type{prologues} setting -%D makes not much sense -prologues:=2 ; - %D save some original \METAPOST\ definitions inner end ; inner bye ; let origEnd_latexmp=end ; let origBye_latexmp=bye ; let origShipit_latexmp=shipit ; string latexmp_extrabeginfig, latexmp_extraendfig ; +extra_endfig := extra_endfig & "; resetattachstrings_latexmp ;" ; latexmp_extrabeginfig := extra_beginfig ; latexmp_extraendfig := extra_endfig ; color latexmp_background ; @@ -89,7 +86,7 @@ def setupLaTeXMP(text kvps) = numeric mode, normal, rerun ; normal:=1 ; rerun := 2 ; %D declaration of keys and synonyms for the specials - save textextlabel, multicolor, debug ; + save textextlabel, multicolor, debug, enable, disable ; boolean textextlabel, multicolor, debug, enable, disable ; enable:=true ; disable := false ; @@ -191,24 +188,6 @@ enddef; def writeLaTeXpreamble_latexmp = write "verbatimtex" to latexmp_lmpfile ; write "%&latex" to latexmp_lmpfile ; - if latexmp_multicolor: - write ("\makeatletter") to latexmp_lmpfile ; - write ("\font\latexmp@special=cmtt8 scaled 250") to latexmp_lmpfile ; - write ("\def\reset@color{" & - "\parbox[t][0pt][t]{0pt}{\makebox[0pt][l]{\latexmp@special ecolorxxx}}}") - to latexmp_lmpfile ; - write ("\newcommand*{\color}[2][named]{\parbox[t][0pt][t]{0pt}{" & - "\makebox[0pt][l]{\latexmp@special bcolorxxx:#1:#2}}" & - "\aftergroup\reset@color\ignorespaces}") to latexmp_lmpfile ; - write ("\def\textcolor#1#{\@textcolor{#1}}") to latexmp_lmpfile ; - write ("\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}}") - to latexmp_lmpfile ; - write ("\newcommand*{\transparent}[3][1]{\parbox[t][0pt][t]{0pt}{"& - "\makebox[0pt][l]{\latexmp@special btransxxx:#1,#2}}"& - "#3\parbox[t][0pt][t]{0pt}{" & - "\makebox[0pt][l]{\latexmp@special etransxxx}}}") to latexmp_lmpfile ; - write "\makeatother" to latexmp_lmpfile ; - fi; %D If preamble file has been specified in the setup only a %D \type{\input} for this file will be used in the LaTeX preamble: if (length latexmp_preamblefile)>0: @@ -236,6 +215,24 @@ def writeLaTeXpreamble_latexmp = write latexmp_preamble to latexmp_lmpfile ; fi fi; + if latexmp_multicolor: + write ("\makeatletter") to latexmp_lmpfile ; + write ("\font\latexmp@special=cmtt8 scaled 250") to latexmp_lmpfile ; + write ("\def\reset@color{" & + "\parbox[t][0pt][t]{0pt}{\makebox[0pt][l]{\latexmp@special ecolorxxx}}}") + to latexmp_lmpfile ; + write ("\newcommand*{\color}[2][named]{\parbox[t][0pt][t]{0pt}{" & + "\makebox[0pt][l]{\latexmp@special bcolorxxx:#1:#2}}" & + "\aftergroup\reset@color\ignorespaces}") to latexmp_lmpfile ; + write ("\def\textcolor#1#{\@textcolor{#1}}") to latexmp_lmpfile ; + write ("\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}}") + to latexmp_lmpfile ; + write ("\newcommand*{\transparent}[3][1]{\parbox[t][0pt][t]{0pt}{"& + "\makebox[0pt][l]{\latexmp@special btransxxx:#1,#2}}"& + "#3\parbox[t][0pt][t]{0pt}{" & + "\makebox[0pt][l]{\latexmp@special etransxxx}}}") to latexmp_lmpfile ; + write "\makeatother" to latexmp_lmpfile ; + fi; write "\begin{document}" to latexmp_lmpfile ; write "etex" to latexmp_lmpfile ; write "picture latexmp_picture[];" to latexmp_lmpfile ; @@ -249,17 +246,26 @@ vardef textext@#(expr s)= latexmp_counter:= latexmp_counter+1 ; getpicture_latexmp ; addstring_latexmp(s) ; - thelabel@#(pic,origin) + if (length (str @#))>0 : + % V. 1.1 compatible with MetaFun + thelabel@#(pic,origin) + else: + % V. 1.2 better compatibility with btex..etex + pic + fi enddef; -%D setting \type{latexmp_attachstrings} to \type{1} enables attaching -%D of strings \type{latexmp_prepend} and \type{latexmp_append} to the -%D string passed to \type{textext}. This may be useful for package +%D strings \type{latexmp_prepend} and \type{latexmp_append} are attached +%D to the string passed to \type{textext}. This may be useful for package %D authors to implement styling interfaces. -newinternal latexmp_attachstrings ; latexmp_attachstrings:=0 ; string latexmp_prepend, latexmp_append ; latexmp_prepend:= "" ; latexmp_append := "" ; +%D is called at each endfig via extra_endfig +def resetattachstrings_latexmp = + latexmp_prepend:= "" ; latexmp_append := "" ; +enddef; + def addstring_latexmp(expr s)= if not latexmp_texinit: write EOF to latexmp_lmpfile ; @@ -267,8 +273,7 @@ def addstring_latexmp(expr s)= latexmp_texinit := true ; fi; write "latexmp_picture[" & (decimal latexmp_counter) & "]:= btex " & - if latexmp_attachstrings=1: latexmp_prepend & s & latexmp_append else: s fi - & " etex ;" to latexmp_lmpfile ; + latexmp_prepend & s & latexmp_append & " etex ;" to latexmp_lmpfile ; enddef; def getpicture_latexmp = |