[dev-context] \note doesn’t work when notes are placed in the text

Wolfgang Schuster wolfgang.schuster at gmail.com
Tue Oct 16 11:07:02 CEST 2012


Hi,

in the following example the \note commands shows only unknown references. It has something to do with “location=text” because “location=page” or “location=column” have working references.

\setupfootnotes[location=text]

\starttext

Second Note\note[footnote][2]
 First Note\note[footnote][1]

\setnotetext[footnote][1]{Footnote 1}
\setnotetext[footnote][2]{Footnote 2}

Second Note\note[footnote][2]
 First Note\note[footnote][1]

\placenotes[footnote]

\stopfootnote


I tried to find a fix for thus bug but wasn’t able to find a good solution. There is a little hack below which works (it is only used for “location=text” and “location=none”) but I guess there is a better solution.

\unexpanded\setvalue{\??constructionnotehandler\v!notation:\v!note}% in the running text
  {\ifnotesenabled
     % do be done elsewhere
     %
     %let\currentnote\currentconstructionmain
     \let\currentnote\currentconstruction % else wrong inheritance
     %
     \iftrialtypesetting
        \strc_notes_inject_dummy
     \else
       \begingroup
       \edef\currentnotenumber{\ctxcommand{storenote("\currentnote",\currentconstructionlistentry)}}%
       \settrue\processingnote
       \ifconditional\c_strc_notes_skip
         \globallet\lastnotesymbol\strc_notes_inject_symbol
+        \ifconditional\c_strc_notes_delayed
+          \currentconstructionsynchronize
+        \fi
       \else
         \iftypesettinglines % otherwise problems with \type <crlf> {xxx}
           \ignorelines % makes footnotes work in \startlines ... \stoplines
         \fi
         \ifconditional\c_strc_notes_symbol
           \strc_notes_inject_symbol
         \else
           \unskip\unskip
           \globallet\lastnotesymbol\strc_notes_inject_symbol
         \fi
       \fi
       \ifconditional\postponingnotes % todo: per note class
         \global\settrue\postponednote
       \else\ifconditional\inlocalnotes % todo: per note class
         \global\settrue\postponednote
       \else
         \handlenoteinsert\currentnote\currentnotenumber % either an insert or just delayed
       \fi\fi
       \endgroup
     \fi
   \fi
   \ifconditional\c_strc_notes_skip
     \global\setfalse\c_strc_notes_skip
   \else
     \kern\notesignal\relax % \relax is needed to honor spaces
   \fi}

Wolfgang


More information about the dev-context mailing list