[tex-eplain] Marginal notes

Oleg Katsitadze olegkat at gmail.com
Sat Jun 14 07:11:06 CEST 2008

On Thu, Jun 12, 2008 at 11:31:18AM +0000, Adam Fenn wrote:
> My problem is that if I enable hyperlinks and use the indexing macros I get the following message:
> pdfTeX warning (dest): name {IDXPG2} has been referenced but does not exist, replaced by a fixed one.

This is because your handling of the .aux file interferes with that of
Eplain.  You shouldn't try to open/close it yourself, let Eplain
handle it.  Below I include a corrected sample.  I commented out all
.aux-related commands and replaced them with those from Eplain.
Another approach would be to use a different extension for the
marginalia aux file, e.g., .aum.  (Caveat:  don't try to use .tmp
either -- it might be used by Eplain under certain circumstances).

> The warning goes away if I use the optional argument [idxexact] with \enablehyperlinks

This is because idxexact-style index hyperlinks don't use the .aux


\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\def\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 \marginalia{a note in the margin} to see what happens.


More information about the tex-eplain mailing list