Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What does the # symbol mean when it follows a variable name. e.g.

arrow_len# vs arrow_len

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Metafont works in a grid determined by the current resolution and only with numbers, not dimensions. In a parameter file you specify dimensions such as pt#, for example


and then you can work in the pictures with ht, after having said


For example,

ht#:=6pt#; define_pixels(ht);show ht;

will print 216 when the value of hppp is 36 (that corresponds to a resolution of 2602 dots per inch, the default when a mode has not been specified). In this way, ht will always represent the number of pixels necessary to cover a distance of 6pt. In the drawing of a character it would be safe to say


since the resolution is already known. In a parameter file such as cmr10.mf it's necessary to specify parameters as "sharp dimensions", so they will be resolution independent, since it's not known a priori when the resolution will be set (before or after setting the font parameters). For example, logo10.mf says

% 10-point METAFONT logo
font_size 10pt#;  % the "design size" of this font
ht#:=6pt#;    % height of characters
xgap#:=0.6pt#;    % horizontal adjustment
u#:=4/9pt#;    % unit width
s#:=0;      % extra space at the left and the right
o#:=1/9pt#;    % overshoot
px#:=2/3pt#;    % horizontal thickness of pen
input logo    % now generate the font
bye      % and stop.

and logo.mf starts with mode_setup which sets, among other things, the resolution.

Similarly, dimensions that must be "output" should be specified in "sharp form"; from digits.mf we get


because this will write the correct value in points in the gf file; but in the definition of the character's shape u is used. It's a bit complicated; one should keep in mind that


will assign the value 1 to a# and the value of hppp to a and you always know when you need the measure in points or the actual number of pixels.

Notice also that changing the value of a will not change the value of a#, it's the other way around with the help of the define_pixels function.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.