[texhax] Fwd: Re: Combining symbols [picture, axis_height]
Uwe Lück
uwe.lueck at web.de
Wed Feb 11 09:39:32 CET 2009
Instead of previous/below on makebox(0,0), I could have done without
axis_height and my \piczzbox by just saying that \makebox(0,0){...} should
contain \mathstrut, at least when heights or depths of labels vary, or
sometimes perhaps \vphantom{\big(}, or ... . My summing-up example then reads:
\setlength{\unitlength}{1in}
\begin{picture}(5,4)
\put(2,2){\makebox(0,0){b\quad}\_\makebox(0,0){\quad p}} %% bad
\put(4,2){\makebox(0,0){b\mathstrut\quad}\_\makebox(0,0){\quad
p\mathstrut}} %% fine
\end{picture}
>Date: Mon, 09 Feb 2009 13:33:22 +0100
>To: johnp at bcs.org.uk, TeXhax discussion list <texhax at tug.org>, Donald
>Arseneau <asnd at triumf.ca>
>From: Uwe Lück <uwe.lueck at web.de>
>Subject: Re: [texhax] Combining symbols [picture, axis_height]
>
>At 20:32 29.12.08, John Palmer wrote:
>>On Monday 29 December 2008 03:54:11 Daniel Freedman wrote:
>> > position a bullet over the arrowhead
>>
>>I have done this sort of thing by using \raisebox for vertical and \kern for
>>horizontal movement, but there must be a more robust and elegant way, so
>>I'll
>>be interested in other replies !
>
>At 15:58 04.01.09, John Palmer wrote:
>>I was in a picture environment, drawing a map, and wanted to put symbols
>>centred on specified coordinates, so usually needed a shift leftwards and
>>downwards from the default position.
>
>This led me to think about vertical placement of labels near marks of
>certain points in the plain, and I wondered how \makebox(0,0) has been
>used to obtain this. A main application may be labelling the "tic" marks
>of the vertical axis of a diagram.
>
>I am curious about general conventions here, while I haven't tried to draw
>x-y-diagrams so far. (You can adapt your field of research to your
>graphical abilities, cf.
>http://www.webdesign-bu.de/uwe_lueck/writings.html). The PS-Tricks people
>may have clear convictions about this.
>
>\makebox(0,0){foo} (LaTeX picture environment) centers `foo' essentially
>by \vbox{\vss\hbox{foo}\vss}. With \put(<x>,<y>){\makebox(0,0){foo}}, <y>
>is half between top and bottom of `f' (their y-coordinates).
>
>So consider alignment of `b' and `p' in
>\put(<x>,<y>){\makebox(0,0){b\quad}\_\makebox(0,0){\quad p}}. Tops of `b'
>and `p' are aligned, likewise their bottoms, half in between the
>horizontal stroke. This horizontal stroke may be a tic mark on the
>vertical axis of an x-y-diagram.
>
>I think this is ridiculous, `b' and `p' should share a common baseline. I
>think that the label for a mark at vertical position <y> should have its
>*axis* at <y>, not half between its top and bottom. *axis* is here the
>vertical position of *fraction strokes* (those horizontal lines between
>numerators and denominators). I feel that this is the natural vertical
>"center" of a line.
>
>To keep some touch with reality, I would like to consider the case that
>the vertical axis of a diagram refers to an amount of *water*, in terms of
>g (grams) as well as in terms of ml (1/1000 litres). Due to different \dp
>and \hp (while there sums are the same), the names nad numbers of the
>units would have different base lines.
>
>Therefore I thought that vertical centering of `foo' around (<x>,<y>)
>should be just \put(<x>,<y>){$\lower\axisheight\hbox{foo}$}, with
>\def\axisheight{\fontdimen22\textfont2\relax}. I would replace \makebox(0,0) by
>
> \newcommand*{\piczzbox}[1]{%
> $\m at th\raisebox{-\fontdimen22\textfont2}[\z@][\z@]%
> {\hb at xt@\z@{\hss#1\hss}}$}
>
>Complete example:
>
> \setlength{\unitlength}{1in}
> \begin{picture}(5,4)
> \put(2,2){\makebox(0,0){b\quad}\_\makebox(0,0){\quad p}}
> \put(4,2){\piczzbox{b\quad}\_\piczzbox{\quad p}}
> \end{picture}
>
>Opinions? Or is this well-known? Of course the question may rise rarely,
>axis tics usually are numbered, labels usually have same \dp and \ht.
>
>Cheers,
>
> Uwe.
More information about the texhax
mailing list