diff options
Diffstat (limited to 'info/symbols/comprehensive/source/makerawtables')
-rwxr-xr-x | info/symbols/comprehensive/source/makerawtables | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/info/symbols/comprehensive/source/makerawtables b/info/symbols/comprehensive/source/makerawtables index 34cfc6f709..f39c26e948 100755 --- a/info/symbols/comprehensive/source/makerawtables +++ b/info/symbols/comprehensive/source/makerawtables @@ -41,10 +41,11 @@ sub find_valid_fonts () { # Build the CLSL under strace to acquire a list of .tfm files. my %unique_tfms; - open(STRACE, "strace -e trace=open -s 32768 -f pdflatex -jobname symbols-letter-pdf '\\RequirePackage{snapshot}\\PassOptionsToClass{letterpaper}{article}\\input symbols' 2>&1|") || die "open: $!\n"; + open(STRACE, "strace -e trace=open,openat -s 32768 -f pdflatex -jobname symbols-letter-pdf \"\\\\RequirePackage{snapshot}\\\\PassOptionsToClass{letterpaper}{article}\\\\input symbols\" 2>&1|") || die "open: $!\n"; while (my $oneline = <STRACE>) { print $oneline; - next if $oneline !~ /open\(\"(.*?)\.tfm\",.*\)\s+=\s+(\S+)/; + next if $oneline !~ /open\(\"(.*?)\.tfm\",.*\)\s+=\s+(\S+)/ && + $oneline !~ /openat\(\w+, \"(.*?)\.tfm\",.*\)\s+=\s+(\S+)/; my ($tfm, $retcode) = (basename($1), $2); next if $retcode eq "-1"; $unique_tfms{$tfm} = 1; @@ -127,7 +128,7 @@ foreach my $tfm (@tfmlist) { # Produce a series of font tables in a single PDF file. open(PDFTEX, ">", "rawtables-$paper.tex") || die "open: $!\n"; -printf PDFTEX "\% Specify %s paper.\n", $paper eq "a4" ? "A4" : "U.S. letter-sized"; +printf PDFTEX "\%\% Specify %s paper.\n", $paper eq "a4" ? "A4" : "U.S. letter-sized"; print PDFTEX "\\pdfpagewidth=$paperwidth\n"; print PDFTEX "\\pdfpageheight=$paperheight\n"; print PDFTEX <<'TESTFONT'; @@ -190,7 +191,7 @@ print PDFTEX <<'TESTFONT'; \vskip1cm plus 24pt minus 24pt } -% Prepare fonts we'll need for the text. +% Prepare fonts we'll need throughout the text. \input plnfss \input ot1cm.pfd \font\titlefont=cmbcsc10 at 24pt @@ -275,7 +276,59 @@ beneath that in the table can be produced by either \texttt{\string\char52} and \texttt{\string\char60}, and their character equivalents are ``\texttt{4}'' and ``\texttt{<}'', respectively. -% + +\font\txexa=txexa at 10pt +\def\sqiiint{% + \setbox0=\hbox{\txexa\char"52}% + \raise 10pt\box0\relax +} +\def\cs#1{\hbox{\texttt{\expandafter\string\csname#1\endcsname}}} + +To put this means of character usage in contact, suppose we want to +typeset \cs{sqiiint} (``\sqiiint\kern3pt'') from the \textsf{txfonts} +package. \textsf{txfonts} is a large package that redefines all text +and math fonts, which may not be desirable just to typeset a single +symbol. The following is how we employ a single \textsf{txfonts} +symbol without having to load the entire package. + +We observe that the symbol in question is character 52 hexadecimal (or +122 octal) in the \texttt{txexa} table in this document. The first +step is to associate \texttt{txexa} with a \TeX\ control sequence; +here we call it \cs{myfont}: + +\vskip 10pt +\texttt{\string\font\string\myfont=txexa at 10pt} +\vskip 10pt + +(If our document were typeset in a font size other than 10~pt., we +would specify that size in the above.) We then define a macro, here +\cs{mysqiiint}, that sets the font and typesets a single character: + +\vskip 10pt +\texttt{\string\newcommand*% +\string{\string\mysqiiint\string}\string{% +\string{\string\myfont\string\char"52\string}\string}} +\vskip 10pt + +The extra pair of curly braces in the above limit the font change to +the single character we want to typeset. We can now use +\cs{mysqiiint} without having to load the \textsf{txfonts} package. + +Alas, in this case the symbol winds up being typeset below the +baseline. This is an artifact of typesetting a mathematical symbol +outside of math mode. The solution is to explicitly raise the symbol +to the desired height: + +\vskip 10pt +\texttt{\string\newcommand*% +\string{\string\mysqiiint\string}\string{% +\string\raisebox\string{10pt\string}% +\string{\string\myfont\string\char"52\string}\string}} +\vskip 10pt + +Note that the \textsf{amstext} package's \cs{text} command is a useful +mechanism for typesetting text characters in math mode. + \vfill\eject % Use Knuth's testfont.tex to typeset a bunch of tables. |