1

I'm working in a ConTeXt document, with right marginal notes. I have a code I don't understand completely, but it almost do what I want. The problem is that although I am setting options stack=yes and stack=continue, notes are confined at a page and they overlap. ¿Could someone avoid that or give me another way of obtain marginal right notes with colored intext mark and colored number in margin, as does this example when you define the color in it? The relevant code is:

\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

Sorry for the length, the problem appears with long notes . Thanks.

  • For me the marginal notes do not overlap but already the first one is much larger than the page. This is of course not possible. Also it doesn't make any sense to break marginal notes across pages. – Henri Menke Aug 25 '16 at 8:17
3

Another alternative is to place the footnotes in the margin. With this mechanism, the notes don't break across the page and they are not synchronized with the location from where they are called.

\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

which gives

enter image description here

2

Margin notes cannot break across pages. To keep them from overlapping use stack=continue. I tried to simplify all of your macros, I hope they still work as intended.

\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

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.