[tex-eplain] Marginal notes

Oleg Katsitadze olegkat at gmail.com
Mon Jun 16 01:13:51 CEST 2008

On Sat, Jun 14, 2008 at 10:11:19AM +0000, Adam Fenn wrote:
> That works except that the marginal notes now all appear in the left
> margin whereas in the original macro marginal notes on odd pages
> appeared in the right margin and vice versa for even pages.

This was because Eplain's \readauxfile read the .aux file inside a
group.  Therefore marginalia-related \def's effectively didn't get
defined.  I've changed \def to \gdef in the definition of
\marginalpage, and now it works.

> Another problem is that when the \marginalia macro appears between
> two words it inserts some unwanted space between them. I've tried
> putting % at the end of lines but the space is still there.

I've removed empty lines and added comment chars to the end of some
lines in \marginalia, and now it seems to work correctly.


\input eplain
\hsize = 10cm

% \marginalia macro
\def\raggedleft{\spaceskip=.3333em \xspaceskip=.5em
     \parfillskip=0pt \leftskip=0pt plus\hsize}    

    \vtop to 0pt{%

    \vtop to 0pt{%

\newskip\inmarginspacing \inmarginspacing=1em


    \expandafter\gdef\csname marginalpage#1\endcsname{#2}}

%  \let\noaux=1
%  \immediate\openout\auxout\jobname.aux
%  \immediate\closeout\auxout
%  \let\noaux=0
%  \closein\auxin
%\input \jobname.aux

%  \ifx\noaux1
%    \newlinechar=`\^^J
%    \message{^^J(Run TeX a second time to resolve marginal note placing)}%
%  \fi

%\immediate\openout\auxout \jobname.aux

  \vtop to \strutdepth{%
%  \edef\writeit{\write\auxout{%
  \expandafter\ifodd0\csname marginalpage\number\marginalno\endcsname
% odd page stuff here
\rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces
\lmarginaliabox{{\it #1}}}%
% even page stuff here
\llap{\ignorespaces \rmarginaliabox{{\it #1}}\hskip\inmarginspacing}%

This is a test O\marginalia{a note in the margin}to see what happens.


More information about the tex-eplain mailing list