I want to add margin notes in the Tufte style to my Plain TeX document. (I'm using eplain, if that matters.) I know that if I were using LaTeX I could just use tufte-latex, but as a thorough contrarian I enjoy coding these things myself.
I'm almost there but my current macro will place text relative to the current location when I invoke it, instead of the margin. In my MWE, the note is placed smack dab in the middle of things. But if you move the invocation of \sidenote
around, the side note may appear closer to the left margin. How can I reposition my sidenote text relative to the left (or right) margin, instead of the current location? (I used the left margin in my MWE.)
The thing I really do like about my macro is that the baselines of the first line of the side note and the main body text to which it refers align. I want to keep that. And any other suggestions about my macro are welcome.
MWE:
\input eplain
\leftmargin=2in
\font\sidenotefont= pxi at8.5pt
\long\def\sidenote#1{\llap{\smash{\vtop{%
\parindent=0pt\hsize=1.5in\rightskip=.87in\parfillskip=0pt\leftskip=-1in plus1fil%
\baselineskip=10pt\sidenotefont #1}}}}
When we are working at a difficult task and strive after a good thing, we are
fighting a righteous battle, the direct reward of which is that we are kept from
\sidenote{This note has been brought to you by the letter pi and
the number e. Please make a note of it. The reason for its existence is the
great lengths I went to do things.}much evil. As we advance in life it becomes more and more difficult, but in
fighting the difficulties the inmost strength of the heart is developed. Indeed
life is a have to defend and protect ourselves, and with a cheerful and brace
spirit we must battle; we plan and calculate in order to make progress.
\bye
\insert
-based solution work for you? i.e., output routine.\insert
yesterday. I was concerned that I wouldn't be able to easily get the alignment right; sidenotes must be beside the text the're commenting on. Do you know if this can be done?\pagetotal
could somehow be used for those calculations, but the problems (again: at least for me) arise when there are more than one sidenote on a page.