09.07.2015 Views

The Comprehensive LaTeX Symbol List

The Comprehensive LaTeX Symbol List

The Comprehensive LaTeX Symbol List

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

scheme [Ber01]; the Berry font-naming scheme is largely irrelevant for symbol fonts, which generally lack bold,italic, small-caps, slanted, and other such variants.mode setup;define pixels(em, cap, sb);define corrected pixels(o);%% Define a light bulb at the character position for “A”%% with width 1 / 2 em # , height cap # , and depth 1pt # .beginchar("A", 1 / 2 em # , cap # , 1pt # ); "A light bulb";pickup pencircle scaled 1 / 2 pt;%% Define the points we need.top z 1 = (w/2, h + o);rt z 2 = (w + sb + o − x 4 , y 4 );bot z 3 = (z 1 − (0, w − sb − o));lft z 4 = (sb − o, 1 / 2 [y 1 , y 3 ]);path bulb;bulb = z 1 . . z 2 . . z 3 . . z 4 . . cycle;% Target a given printer.% Convert to device-specific units.% Same, but add a device-specific fudge factor.% Use a pen with a small, circular tip.% z 1 is at the top of a circle.% z 2 is at the same height as z 4 but the opposite side.% z 3 is at the bottom of the circle.% z 4 is on the left of the circle.% Define a path for the bulb itself.% <strong>The</strong> bulb is a closed path.z 5 = point 2 − 1 / 3 of bulb; % z 5 lies on the bulb, a little to the right of z 3 .z 6 = (x 5 , 0); % z 6 is at the bottom, directly under z 5 .z 7 = (x 8 , 0); % z 7 is at the bottom, directly under z 8 .z 8 = point 2 + 1 / 3 of bulb; % z 8 lies on the bulb, a little to the left of z 3 .bot z 67 = ( 1 / 2 [x 6 , x 7 ], pen bot − o − 1 / 8 pt); % z 67 lies halfway between z 6 and z 7 but a jot lower.%% Draw the bulb and the base.draw bulb;draw z 5 - - z 6 . . z 67 . . z 7 - - z 8 ;% Draw the bulb proper.% Draw the base of the bulb.%% Display key positions and points to help us debug.makegrid(0, sb, w/2, w − sb)(0, −1pt, y 2 , h); % Label “interesting” x and y coordinates.penlabels(1, 2, 3, 4, 5, 6, 67, 7, 8);% Label control points for debugging.endchar;endFigure 3: Sample METAFONT size-independent file (lightbulb.mf)<strong>The</strong> code in Figures 2 and 3 is heavily commented and should demonstrate some of the basic conceptsbehind METAFONT usage: declaring variables, defining points, drawing lines and curves, and preparing todebug or fine-tune the output. Again, <strong>The</strong> METAFONTbook [Knu86b] is the definitive reference on META-FONT programming.METAFONT can produce “proofs” of fonts—large, labeled versions that showcase the logical structure ofeach character. In fact, proof mode is METAFONT’s default mode. To produce a proof of lightbulb10.mf,issue the following commands at the operating-system prompt:prompt> mf lightbulb10.mf ⇐ Produces lightbulb10.2602gfprompt> gftodvi lightbulb10.2602gf ⇐ Produces lightbulb10.dviYou can then view lightbulb10.dvi with any DVI viewer. <strong>The</strong> result is shown in Figure 4. Observe how thegrid defined with makegrid at the bottom of Figure 3 draws vertical lines at positions 0, sb, w/2, and w − sband horizontal lines at positions 0, −1pt, y 2 , and h. Similarly, observe how the penlabels command labels allof the important coordinates: z 1 , z 2 , . . . , z 8 and z 67 , which lightbulb.mf defines to lie between z 6 and z 7 .Most, if not all, TEX distributions include a Plain TEX file called testfont.tex which is useful for testingnew fonts in a variety of ways. One useful routine produces a table of all of the characters in the font:prompt> tex testfontThis is TeX, Version 3.14159 (Web2C 7.3.1)(/usr/share/texmf/tex/plain/base/testfont.texName of the font to test = lightbulb1097

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!