Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Vertical versions of \llap and \rlap: \tlap and \blap

714 views
Skip to first unread message

Martin

unread,
Feb 10, 2009, 11:30:52 AM2/10/09
to
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}}

('\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

Lars Madsen

unread,
Feb 10, 2009, 12:35:00 PM2/10/09
to

might be an idea

note that the math lap macros are provided by the mathtools package

/daleif

Martin

unread,
Feb 10, 2009, 2:32:40 PM2/10/09
to

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

Dan Luecking

unread,
Feb 10, 2009, 3:49:32 PM2/10/09
to
On Tue, 10 Feb 2009 08:30:52 -0800 (PST), Martin
<mar...@scharrer-online.de> wrote:

>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

Robin Fairbairns

unread,
Feb 10, 2009, 4:01:06 PM2/10/09
to
Martin <mar...@scharrer-online.de> writes:

>On Feb 10, 5:35=A0pm, Lars Madsen <dal...@imf.au.dk> wrote:
>> Martin wrote:
>> > 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?
>>
>> might be an idea
>>
>> note that the math lap macros are provided by the mathtools package
>
>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'.

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

Martin

unread,
Feb 10, 2009, 4:04:03 PM2/10/09
to

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

0 new messages