2

I am writing a Textbook with much marginal notes and even images in the margin to explain words. I think it works best to use consequently the same command for text and images: \margintext. I want the comment to line out so that when I have more comments, they align vertically around the commented line(s): they have to move upward and downward to find a certain optimum.

How can I do this?

Here I have an MWE which shows the problems:

\setuppapersize [A5]
\language[la]
%page layout
\setuplayout
  [width=85mm,
   rightmargin=30mm,
   rightmargindistance=6mm]

% setup the side notes
\setupnarrower[left=2.5mm]
   \starttexdefinition unexpanded exdent #1
     \blank[-line] % Remove the newline from the following \startnarrower
     \startnarrower[left]
       \setupindenting[-\leftskip,yes]
       #1
     \stopnarrower
   \stoptexdefinition
\setupmargindata[margintext]
     [location=outer,
     align=flushleft,
     width=3cm,
     stack=yes, % what means stack=continue?
     style={\tfx\setupinterlinespace[line=10pt]},
     command=\exdent]

\setupcaptions
    [number=no, 
     width=3cm]

\starttext
rōstrō sūmit et eum aperit.\margintext{This works fairly well} In eō cāseum magnum reperit. Frustum cāseī rōstrō sumit et cubiculum relinquit.magnum reperit. Frustum cāseī rōstrō sumit et cubiculum relinquit.magnum reperit. Frustum cāseī rōstrō sumit et cubiculum relinquit.magnum reperit. Frustum cāseī rōstrō sumit et cubiculum relinquit.
Dum per fenestram volat, Syra accurrit et exclāmat: ''Improbe corve, revenī!\margintext{re-venīre = I would like to vertically align so that the comment centers on the line it comments to.} Redde\margintext{red-dere = rūrsus dare} mihi\margintext{mihi \it{dat} mē \it{acc}} cāseum dominī meī!'' Sed corvus sē vertere nōn vult et abit. Iam procul ā Syrā est.\margintext{\placefigure{cow: sometimes the cow interferes with the comment above. Why?}{\externalfigure[cow][width=30mm]}}

Etiam Iūlius cubiculum intrat et cāseum abesse videt. Ōstium post sē claudit et īrātus Syram interrogat accūsatque: ''Ubi est cāseus meus? Quis habet cāseum meum? Tūne?\margintext{Tū-ne?} Improba ancilla! Mala est ancilla, quae cāseum dominī ēst!'' Dominus eam verberāre vult neque potest; nam baculum eius in ātriō est. Ergō exit ē cubiculō et cum baculō suō revenit. rōstrō sūmit et eum aperit. In eō cāseum magnum reperit. Frustum cāseī rōstrō sumit et cubiculum relinquit.
Dum per fenestram volat, Syra accurrit et exclāmat: ''Improbe corve, revenī!rōstrō sūmit et eum aperit. In eō cāseum magnum reperit. Frustum cāseī rōstrō sumit et cubiculum relinquit.
Dum per fenestram volat, Syra accurrit et exclāmat:\margintext{\placefigure{why does this image line out more than one line below the line its comments to (exclamat)?}{\externalfigure[cow][width=30mm]}} ''Improbe corve, revenī!
\stoptext

And here the result:

enter image description here

  • 1
    You have to use \blank[-line] instead of \blank[-8pt], as I had it in my original answer. – Henri Menke Mar 30 '19 at 22:59
  • Thank you. I have changed it back to '\blank[-line]'. The reason I changed it was that in the TL-version the distance decreased too much between different notes. This problem does not occur when I use ConTeXt live online. I'll delete this part of the question. Remains the main issue. – Jan Apr 1 '19 at 7:03
  • 1
    ConTeXt live online uses a version of ConTeXt standalone (although not always the latest beta). You should consider using ConTeXt standalone as well, instead of TeX Live's version. Standalone can coexist with a TeX Live installation without issues. – Henri Menke Apr 1 '19 at 7:31
  • I know. However, I have issues to get it working. SciTe doesn't do it's job and complains about me not having installed ruby. But that doesn't make sense because ruby isn't needed in mkiv. So I'm stuck for the moment. Once there seems to have been a right away Windows installation, but it's link is broken in contextgarden. – Jan Apr 1 '19 at 13:58
  • @Jan Have you tried wiki.contextgarden.net/… ? – DG' Apr 2 '19 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.