I recently needed vertical versions of \llap and \rlap in LaTeX (yes,
I know there are TeX macros and I know also about \makebox[l] etc.),
so I defined the following macros which I like to share with you:
\def\tlap#1{\vbox to\z@{\vss#1}}
\def\blap#1{\vbox to\z@{#1\vss}}
('\z@' can be replaced by '0pt')
\tlap laps the block to the top and \blap to the bottom without
reserving any vertical space. I used this for pictures in a beamer
presentation to get better animation results.
Now, you don't have to stop here:
% Vertical centered box
\def\vclap#1{\vbox to \z@{\vss#1\vss}}
% Horizontal centered box
\def\clap#1{\hbox to \z@{\hss#1\hss}}
% Box which is vertical and horizontal aligned and laps over:
\def\vhclap#1{\vbox to \z@{\vss\hbox to \z@{\hss#1\hss}\vss}}
I also found this article about lap macros for the math mode:
www.tug.org/TUGboat/Articles/tb22-4/tb72perlS.pdf
Should I package this macros above into a package (maybe 'xlap') and
put it on CTAN or are they to trivial?
Best,
Martin
might be an idea
note that the math lap macros are provided by the mathtools package
/daleif
Thanks for the hint of the mathtools package.
I was actually going to ask in my original post if anyone knows a
package which already defines \tlap and \blap but forgot then to do
it.
While I was of course searching before I coded the macros I couldn't
find anything except the above article. I was searching after things
ala "latex vertical lap" etc. which doesn't returned results.
Just now I search for my own post, just for fun, using "latex tlap
blap" and found not only my OP but also two CTAN packages which also
define them: 'circ' and 'lhelp'.
:-)
Martin
>Hi my fellow TeX-nicans,
>
>I recently needed vertical versions of \llap and \rlap in LaTeX (yes,
>I know there are TeX macros and I know also about \makebox[l] etc.),
>so I defined the following macros which I like to share with you:
>
>\def\tlap#1{\vbox to\z@{\vss#1}}
>\def\blap#1{\vbox to\z@{#1\vss}}
If #1 is regular text, these will make boxes that are
\hsize wide and will include a paragraph indentation.
Chances are this is not what most people will expect.
I don't know if this is best dealt with by including a
wrapper: \hbox{#1}, or just a caution in the
documentation. Both have disadvantages.
Dan
To reply by email, change LookInSig to luecking
there are also more laps than i've ever used in the tugboat macros
(package tugboat on ctan). (they were there when i started on the
package -- i'm fairly certain i had not part in them.)
as to making a package ... it seems to me that these are rather
sophisticated ideas, and a little tutorial might be more valuable than
a mere package. would you be up for that? -- something with code
snippets and figures demonstrating what they look like.
--
Robin Fairbairns, Cambridge
Thanks for pointing this out to me. I only used it with graphics so
far.
Maybe two versions one with and one without \hbox{ }?
Martin