summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/latexmp/lmp-pkg.mp
blob: fd6613cf884262b4ead84bef85706710ff2cc6fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

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