[tex-eplain] Marginal Notes?

Arctic Fidelity af at sacrificumdeo.net
Wed Aug 17 04:56:57 CEST 2005


Karl:

Thanks so much for this macro! I've learned quite a bunch, but I'm 
still lost. :-/  

On 2 Aug 2005 at 20:04, Karl Berry wrote:

>     Do you know of a good package or the proper commands to do this? 
> 
> I don't know of a package for plain TeX, but Knuth does discuss some
> basic approaches in the TeXbook.  Check "marginal notes" in the index
> (or search for it in texbook.tex if you don't have the printed copy).
> 
> The basic idea is to use \vadjust and \llap (or \rlap).

I found it out, and I had a little bit of fun trying to figure out what
in the world this was all doing, and I think that I've learned a little
bit more about TeX now. I still don't know enough to know how to get
what I want done though. I couldn't find anything that was teaching me
about these things in a simple and straightforward manner. I suppose my
TeX knowledge is just not that great.

> Here is a simplistic macro from texinfo.tex which maybe you can
> adapt, if your needs aren't too complex ... 

Well, I did try it out, and it works great, but I unfortunately do need
to have multiple line marginal notes. Is there any help you can provide
in how to achieve this? My ignorance about vbox's is quite great, and
I'm not sure I understand it. :-(

> % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
> % paragraph.  For more general purposes, use the \margin insertion
> % class.  WHICH is `l' or `r'.
> %
> \newskip\inmarginspacing \inmarginspacing=1cm
> \def\strutdepth{\dp\strutbox}
> %
> \def\doinmargin#1#2{\strut\vadjust{%
>   \nobreak
>   \kern-\strutdepth
>   \vtop to \strutdepth{%
>     \baselineskip=\strutdepth
>     \vss
>     % if you have multiple lines of stuff to put here, you'll need to
>     % make the vbox yourself of the appropriate size.
>     \ifx#1l%
>       \llap{\ignorespaces #2\hskip\inmarginspacing}%
>     \else
>       \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
>     \fi
>     \null
>   }%
> }}
> 

Thanks a bunch!

- Aaron Hsu

-- 
Extend beyond the Mortal...Sacrificum Deo: http://www.sacrificumdeo.net




More information about the tex-eplain mailing list