ConTeXt:边注重叠

ConTeXt:边注重叠

我正在处理带有右侧边注的 ConTeXt 文档。我有一个代码,虽然我并不完全理解,但它几乎可以满足我的要求。问题是,尽管我设置了选项 stack=yes 和 stack=continue,但注释仍局限于一页,而且它们重叠。有人可以避免这种情况吗?或者给我另一种方法,让我获得带有彩色文本标记和彩色数字的右侧边注,就像这个例子中定义颜色时那样?相关代码是:

\definemargindata [margintext]
[
  location=outer,
     align=flushleft,
     stack=continue, % or yes
]
\setupmargindata[location=right, location=flushright, stack=yes,   stack=continue] 
  \setupinmargin[stack=continue, stack=yes]
   \newcounter\MyMarginalNote

 \def\mnote{\dosingleempty\domnote}

   \def\domnote[#1]#2%
   {\doglobal\increment\MyMarginalNote
   \high{{\tfxx\color[marca]{\MyMarginalNote}}}%
   \inright
   {{\tfx\color[marca]{\MyMarginalNote:}}
    \doifsomething{#1}
     {\expanded{\textreference[#1]{\MyMarginalNote}}}\tfx\it {#2}}}

     \setupnotation[footnote][textstyle=\it, headcolor=blue,  numbercolor=blue]


    \starttext

     Hola\mnote{que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que  tal    aaaaaaaaaa aaa aaaaaaaa a  
     aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que   tal     aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  
   que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa     aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa   
    que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
    que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
   aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa    aaa aaaaaaaa a  aaaaaaa  aaa 
   que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa     aaaaaaaa a  aaaaaaa  aaa 
   que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa     aaaaaaaa a  aaaaaaa  aaa 
   que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa     aaaaaaaa a  aaaaaaa  aaa 
   que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa     aaaaaaaa a  aaaaaaa  aaa 
   que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa     aaaaaaaa a  aaaaaaa  aaa  
   que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa      aaaaaaaa a  aaaaaaa  aaa 
    que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa      aaa aaaaaaaa a  aaaaaaa  aaa 
    que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa      aaa aaaaaaaa a  aaaaaaa  aaa 
    que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa      aaa aaaaaaaa a  aaaaaaa  aaa 
    que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa         aaa aaaaaaaa a  aaaaaaa  aaa 
    que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa    aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa       aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
        } 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa  aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa  aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa  aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
     que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa  aaa aaaaaaaa a  aaaaaaa  aaa 
      que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa  aaa aaaaaaaa a  aaaaaaa  aaa 
      que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa   aaa aaaaaaaa a  aaaaaaa  aaa 
        que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
            que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
       que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
         que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
        que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa
        que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
          que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
          que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
         que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
         muy bien\mnote{

          que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal  aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
              que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal   aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  
              que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal  aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
            que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
             que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa 
                 que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa que tal aaaaaaaaaa aaa aaaaaaaa      aaaaaaaa  
                   aaa que tal aaaaaaaaaa aaa aaaaaaaa a  aaaaaaa  aaa   aaaaaaa  aaa y tu}

               \stoptext

抱歉,篇幅太长了,长篇注释会出现问题。谢谢。

答案1

另一种方法是将脚注放在页边距中。使用这种机制,注释不会跨页,也不会与引用它们的位置同步。

\definenote[sidenote]
           [
             way=bytext,
             location=text,
             width=\rightmarginwidth,
             scope=page,
             rule=,
             before=,
             after=,
            ]

\setupnotation[sidenote]
              [
                align={flushleft,hyphenated},
                style=small,
                headstyle=small,
                alternative=serried,
                numbercommand=,
              ]

\setuptexttexts[margin][][\vbox to \textheight{\placenotes[sidenote]\vfill}]


\starttext
Hola!\sidenote{\input ward}
\input knuth
Muy bien!\sidenote{\input reich }
\input zapf
\stoptext

这使

在此处输入图片描述

答案2

边注不能跨页。要防止它们重叠,请使用stack=continue。我尝试简化所有宏,希望它们仍能按预期工作。

\definecounter[marginnotes]

\setupmargindata
  [inouter]
  [
    align=flushleft,
    style=,
    color=middlered,
    stack=continue,
  ]

\starttexdefinition unexpanded marginnote #1
  \incrementcounter[marginnotes]
  \high{\convertedcounter[marginnotes]}
  \inouter{
    \convertedcounter[marginnotes][numberstopper={. }]
    #1
  }
\stoptexdefinition

\starttext

Hola!\marginnote{\input ward }
\input knuth
Muy bien!\marginnote{\input reich }
\input zapf

\stoptext

在此处输入图片描述

相关内容