Introduction plus précise et invitation
[mp-gdd.git] / gdd-lbl.mp
1 string lblPreambule, lblLocal;
2 lblPreambule := "\usepackage[frenchb]{babel}\usepackage[garamond]{mathdesign}\usepackage{amsmath}\usepackage{mflogo}";
3 lblLocal     := "";
4
5 string lblS[];
6 lblS[0] = "alpha";
7 lblS[1] = "beta";
8 lblS[2] = "gamma";
9 lblS[3] = "delta";
10 lblN    = 3;
11
12 vardef scanchaine_label(expr s) =
13   save d,m,f,c,l,flag,i; string d,m,f,c;
14   d := ""; m := ""; f := "";
15   l = length(s); flag := 0;
16   for i:=0 upto l:
17     c := substring (i,i+1) of s;
18     if c = "'":
19       f := f & c; flag := 2;
20     elseif c = "_":
21       flag := 1;
22     else:
23       if flag = 0:
24         d := d & c
25       else:
26         m := m & c
27       fi;
28     fi
29   endfor;
30   for i:=0 upto lblN:
31     if d = lblS[i]: d := "\" & d fi
32   endfor;
33   d := d & "_{" & m & "}" & f; d
34 enddef;
35
36 vardef lTEX primary s =
37   write "verbatimtex" to "mptextmp.mp";
38   write "%&latex" to "mptextmp.mp";
39   write "\documentclass{article}" to "mptextmp.mp";
40   write lblPreambule to "mptextmp.mp";
41   write lblLocal to "mptextmp.mp";
42   write "\begin{document}" to "mptextmp.mp";
43   write "etex" to "mptextmp.mp";
44   write "btex $"& scanchaine_label(s) &"$ etex" to "mptextmp.mp";
45   write EOF to "mptextmp.mp";
46   scantokens "input mptextmp"
47 enddef;
48
49 vardef TEX primary s =
50   write "verbatimtex" to "mptextmp.mp";
51   write "%&latex" to "mptextmp.mp";
52   write "\documentclass{article}" to "mptextmp.mp";
53   write lblPreambule to "mptextmp.mp";
54   write lblLocal to "mptextmp.mp";
55   write "\begin{document}" to "mptextmp.mp";
56   write "etex" to "mptextmp.mp";
57   write "btex "& s &" etex" to "mptextmp.mp";
58   write EOF to "mptextmp.mp";
59   scantokens "input mptextmp"
60 enddef;
61
62
63 vardef Etiquette.@#(expr s,t,p) = label.@#(TEX(s) scaled t,p gddEnPlace) enddef;
64
65
66
67 vardef FICHIER primary s =
68     save _s; string _s; _s = "input " & s;
69     scantokens _s
70 enddef;
71
72 endinput

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.