File: createlfs.tex

package info (click to toggle)
pyx3 0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: python: 27,656; makefile: 225; ansic: 130; sh: 17
file content (98 lines) | stat: -rw-r--r-- 3,756 bytes parent folder | download | duplicates (4)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
% Copyright (C) 2002 Jörg Lehmann <joerg@pyx-project.org>
% Copyright (C) 2002 André Wobst <wobsta@pyx-project.org>
%
% This file is part of PyX (https://pyx-project.org/).
%
% PyX is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% PyX is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with PyX; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

\endlinechar=-1 % don't add tailing space while \read

\message{latex style name (e.g. 12ptex)? }
\read-1 to\latexstylename

\message{latex class name (e.g. article)? }
\read-1 to\latexclassname

\message{latex class options (e.g. 12pt)? }
\read-1 to\latexclassopt

\message{initial commands (e.g. \string\usepackage\string{exscale\string})? }
\read-1 to\latexinit

\endlinechar=13

\newwrite\myfile

\newbox\mybox

\documentclass[\latexclassopt]{\latexclassname}

\latexinit

\newcommand{\writefontsize}[1]{
  \setbox\mybox=\hbox{#1
    a $a$
    \immediate\write\myfile{%
      \string\def\string#1{%
        \string\font\string\pyxfont=\fontname\font
        \string\pyxfont
        \string\font\string\pyxfonttfa=\fontname\textfont0
        \string\textfont0=\string\pyxfonttfa
        \string\font\string\pyxfontsfa=\fontname\scriptfont0
        \string\scriptfont0=\string\pyxfontsfa
        \string\font\string\pyxfontssfa=\fontname\scriptscriptfont0
        \string\scriptscriptfont0=\string\pyxfontssfa
        \string\font\string\pyxfonttfb=\fontname\textfont1
        \string\textfont1=\string\pyxfonttfb
        \string\font\string\pyxfontsfb=\fontname\scriptfont1
        \string\scriptfont1=\string\pyxfontsfb
        \string\font\string\pyxfontssfb=\fontname\scriptscriptfont1
        \string\scriptscriptfont1=\string\pyxfontssfb
        \string\font\string\pyxfonttfc=\fontname\textfont2
        \string\textfont2=\string\pyxfonttfc
        \string\font\string\pyxfontsfc=\fontname\scriptfont2
        \string\scriptfont2=\string\pyxfontsfc
        \string\font\string\pyxfontssfc=\fontname\scriptscriptfont2
        \string\scriptscriptfont2=\string\pyxfontssfc
        \string\font\string\pyxfonttfd=\fontname\textfont3
        \string\textfont3=\string\pyxfonttfd
        \string\font\string\pyxfontsfd=\fontname\scriptfont3
        \string\scriptfont3=\string\pyxfontsfd
        \string\font\string\pyxfontssfd=\fontname\scriptscriptfont3
        \string\scriptscriptfont3=\string\pyxfontssfd
      }%
    }
  }
}

\begin{document}
\immediate\openout\myfile=\latexstylename.lfs
{\catcode`\%=12\immediate\write\myfile{% This automatically generated file is part of PyX (https://pyx-project.org/).}}
{\catcode`\%=12\immediate\write\myfile{% \string\latexstylename="\expandafter\string\latexstylename"}}
{\catcode`\%=12\immediate\write\myfile{% \string\latexclassname="\expandafter\string\latexclassname"}}
{\catcode`\%=12\immediate\write\myfile{% \string\latexclassopt="\expandafter\string\latexclassopt"}}
{\catcode`\%=12\immediate\write\myfile{% \string\latexinit="\expandafter\string\latexinit"}}
\writefontsize{\tiny}
\writefontsize{\scriptsize}
\writefontsize{\footnotesize}
\writefontsize{\small}
\writefontsize{\normalsize}
\writefontsize{\large}
\writefontsize{\Large}
\writefontsize{\LARGE}
\writefontsize{\huge}
\writefontsize{\Huge}
\immediate\closeout\myfile
\end{document}