ConTeXt 边注和注释

ConTeXt 边注和注释

我正在编写一本教科书,里面有很多边注,甚至还有图片来解释单词。我认为对文本和图像使用相同的命令效果最好:\margintext。我希望注释排成一行,这样当我有更多注释时,它们会围绕注释行垂直对齐:它们必须上下移动才能找到某个最佳位置。

我怎样才能做到这一点?

这里我有一个 MWE,它显示了问题:

\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

结果如下:

在此处输入图片描述

相关内容