<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
This macro for marginal notes is based upon an example by Robin Fairbairns along with some modifications from this list. It seems to work quite well although it contains a spurious space that I am unable to locate and I'm sure a number of refinements could be made to improve it.<br><br>My problem is that if I enable hyperlinks and use the indexing macros I get the following message:<br><br>pdfTeX warning (dest): name {IDXPG2} has been referenced but does not exist, replaced by a fixed one.<br><br>The warning goes away if I use the optional argument [idxexact] with \enablehyperlinks<br><br>Any suggestions how to sort this out?<br><br>Thanks,<br>Adam Fenn.<br><br><br>%------------- test file---------------<br><br>\input eplain<br>\enablehyperlinks%[idxexact]<br>\hsize = 10cm <br><br>% \marginalia macro<br>\def\raggedleft{\spaceskip=.3333em \xspaceskip=.5em<br> \parfillskip=0pt \leftskip=0pt plus\hsize}<br><br>\def\lmarginaliabox#1{%<br> \vtop to 0pt{%<br> \raggedright<br> \hsize=.9in<br> \parindent=0pt<br> #1<br> \vss<br> }} <br><br>\def\rmarginaliabox#1{%<br> \vtop to 0pt{%<br> \raggedleft<br> \hsize=.9in<br> \parindent=0pt<br> #1<br> \vss<br> }} <br><br>\newskip\inmarginspacing \inmarginspacing=1em<br>\def\strutdepth{\dp\strutbox}<br><br>\newcount\marginalno <br>\marginalno0 <br><br>\def\marginalpage#1#2{% <br> \expandafter\def\csname marginalpage#1\endcsname{#2}}<br><br>\let\protect\relax<br>\newread\auxin<br>\newwrite\auxout<br>\openin\auxin\jobname.aux<br>\ifeof\auxin<br> \let\noaux=1<br> \immediate\openout\auxout\jobname.aux<br> \immediate\closeout\auxout<br>\else<br> \let\noaux=0<br> \closein\auxin<br>\fi<br>\input \jobname.aux<br><br>\outer\def\bye{%<br> \par\vfill\supereject<br> \ifx\noaux1<br> \newlinechar=`\^^J<br> \message{^^J(Run TeX a second time to resolve marginal note placing)}%<br> \fi<br> \end<br>}<br><br>\immediate\openout\auxout \jobname.aux<br>\def\protect{\noexpand\protect\noexpand}<br><br>\def\marginalia#1{%<br>\strut\vadjust{%<br> \nobreak<br> \kern-\strutdepth<br> \vtop to \strutdepth{%<br> \vss<br><br> \global\advance\marginalno1<br> \edef\writeit{\write\auxout{%<br> \protect\marginalpage<br> {\number\marginalno}%<br> {\noexpand\number\count0}}}<br> \writeit<br> \expandafter\ifodd0\csname marginalpage\number\marginalno\endcsname<br> <br>% odd page stuff here<br>\rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces<br>\lmarginaliabox{{\it #1}}}<br>\else<br>% even page stuff here<br>\llap{\ignorespaces \rmarginaliabox{{\it #1}}\hskip\inmarginspacing}<br> \fi<br>\baselineskip=\strutdepth<br>\null<br>}}}<br><br><br>This is a test \marginalia{a note in the margin} to see what happens.<br><br><br>\vfill\eject<br>\idx{Test}<br>\vfill\eject<br>\readindexfile{i}<br>\bye<br>%------------------------------------<br><br /><hr />Get fish-slapping on Messenger! <a href='http://clk.atdmt.com/UKM/go/msnnkmgl0010000008ukm/direct/01/' target='_new'>Play Now</a></body>
</html>