Changes

Jump to navigation Jump to search
simplified the code, removed some outdated stuff
==First View==
<texcodecontext source="yes">\section{First} Way to \ConTeXt\footnote{First footnote.} is painful. \section{Second} But \ConTeXt\ is amazing.\footnote{Second footnote} \placetable {Complex Table\footnote{A table head footnote.}} {\startlocalfootnotes \placelegend {\starttablesetuppapersize[|l|l|A7] \HL \NC First Column \NC Second Column \NC \FR \HL \NC East\footnote{Footnote inside graphic.} \NC North \NC \FR \NC West \NC South \NC \LR \HL \stoptable} {\placelocalfootnotes} \stoplocalfootnotes}</texcode> <context>
\starttext
\strut\vfill\
\section{First}
The reference is optional, and can be used to refer to the same footnote again. Footnotes can be referenced with the usual {{cmd|in}} and {{cmd|at}} macros (see [[References]]), or the note itself can be reproduced with {{cmd|note|[reference]}}. For example:
<texcodecontext source="yes">This\footnote[footA]{Or that, if you prefer.} is a sentence with a footnote\footnote{Actually,two footnotes; this one and \in{footnote}[footA] on \at{page}setuppapersize[footAA7], denoted by \note[footA].}. </texcode> <context>
\starttext
\strut\vfill % A hack to shorten the page.
This\footnote[footA]{Or that, if you prefer.} is a sentence with a footnote\footnote{Actually,
two footnotes; this one and \in{footnote}[footA] on \at{page}[footA], denoted by \note[footA].}.
</context>
Thanks to Oblomov, it’s also possible to use footnotes in footnotes, as in this example.
Thanks to Oblomov, it's also possible to use footnotes in footnotes, as in this example. <texcodecontext source="yes">This\footnote{Or that\footnote{Or possibly even the other.}, if you prefer.} is a sentencewith a footnote. </texcode> <context>setuppapersize[A7]
\starttext
\strut\vfill % A hack to shorten the page.
This\footnote{Or that\footnote{Or possibly even the other.}, if you prefer.} is a sentence
with a footnote.
==Footnote Numbering==
You can setup the exact behaviour of footnotes with {{cmd|setupnotation|[footnote]}} (MkII: or {{cmd|setupfootnotes}}).(The command page for the MkIV version is still missing, refer to the old version; translate location to alternative and conversion to numberconversion.) For example, to use footnotes with standard footnote symbols (which ConTeXt has defined as the conversion "set 2"), with the footnote counter resetting on each page, one would use the following: <texcode>\setupnotation[footnote][way=bypage,numberconversion=set 2]</texcode> In MkII this was: <texcode>\setupfootnotes[way=bypage, conversion=set 2]</texcode>
This produces For example, to use footnotes with standard footnote symbols like asterisks and daggers (which ConTeXt has defined as the following footnotesconversion "set 2"), using with the text of footnote counter resetting on each page, one would use the previous example.following:
<contextsource="yes" text="This produces the following footnotes:">\setuppapersize[A7]
\setupnotation[footnote][way=bypage,numberconversion=set 2]
\starttext
\strut\vfill % A hack to shorten the page.
This\footnote[footA]{Or that, if you prefer.} is a sentence with a footnote\footnote{Actually,
two footnotes; this one and \in{footnote}[footA] on \at{page}[footA], denoted by \note[footA].}.
==Alternate Footnote Locations==
The {{cmd|setupfootnotessetupnotation}} (MkII) command offers some options for the placement of footnotes; for instance, the <code>location=columns</code> option places the footnotes in a single column (of a multicolumn page) rather than across the whole page. The <code>location=text</code> option places the footnotes in text at a location specified by {{cmd|placefootnotes}}; this can be easily used to create endnotes, or even to place footnotes after each paragraph or subsection. <texcode>\setupfootnotes[location=text] % MkIIThis\footnote[footA]{Or that, if you prefer.} is a sentence with a footnote\footnote{Actually,two footnotes; this one and footnote \note[footA].}. \placefootnotesThis is some more text, with more footnotes\footnote{Specifically, this one.}.\placefootnotes</texcode>
<contextsource="yes">\setuppapersize[A7]\setupnotation[footnote][location=text]
\starttext
\setupfootnotes[location=text]
This\footnote[footA]{Or that, if you prefer.} is a sentence with a footnote\footnote{Actually,
two footnotes; this one and footnote \note[footA].}.
=== Footnotes at the end of each chapter ===
Another elegant (MkIV) example places all footnotes in a subject (unnumbered section) at the end of each chapter. It is intelligent and will not create an empty subject when there are no footnotes to be placed. At no extra cost, the subject title "Footnote" will be singular or plural depending if there is only one or several footnotes to be placed:
<texcode>
\stoptext
</texcode>
 
You can also just use {{cmd|endnote}} and {{cmd|placeendnotes}}.
===Footnotes in the margin===
\stoptext
</texcode>
 
{{todo|It got a bit easier in LMTX, we must adapt the example.}}
==Footnote Formatting==
{{cmd|setupfootnotedefinition|[before=\MyFontCommand]}}.
Footnotes can be placed in multiple columns, using the <code>n=<i>number</i></code> option of {{cmd|setupnotes}} or {{cmd|setupnote}} (MkII: {{cmd|setupfootnotes}}).
<texcodecontext source="yes">\setupfootnotessetuppapersize[n=3A7] % MkIIThis\footnotesetupnotes[footA](Or that\footnote{Or the other.}, if you prefer.} is a sentencewith a footnote\footnote{Actually, two footnotes; this one and \in{footnote}[footA]on \at{page}[footA], denoted by \note[footA].}. </texcode> <context>\setupfootnotes[n=3]
\starttext
\strut\vfill % A hack to shorten the page.
This\footnote[footA]{Or that\footnote{Or the other.}, if you prefer.} is a sentence
with a footnote\footnote{Actually, two footnotes; this one and \in{footnote}[footA]
==Footnotes in Floats==
[[Floating Objects|Floats]] cannot include have problems with normal footnotes, because they are likely to float to another page from the page on which they were defined, thus getting the footnotes out of order. Thus, to include footnotes in a float, one must use local footnotes. This table, which uses the {{cmd|placelegend}} command to create a place for the footnotes, illustrates the process: <texcode>\startlocalfootnotes[n=2]\placetable{A table with footnotes.} \placelegend {\starttable[|l|r|] \HL \VL One\footnote{First} \VL Two\footnote{Second} \VL\FR \VL Three\footnote{Third} \VL Four\footnote{Fourth} \VL\LR \HL \stoptable} {\placelocalfootnotes}\stoplocalfootnotes</texcode>
<contextsource="yes">\startlocalfootnotes[n=2]
\placetable{A table with footnotes.}
\placelegend
When using natural tables, the above leads to alignment problems. An alternative is to use:
<texcodecontext source="yes">\defineframed[noteframed]\setupframedsetuppapersize[noteframedA7] [width=\hsize, frame=off, align=right, %height=fit, top=\hbox\bgroup, bottom=\egroup] \starttext \startlocalfootnotes[n=0]\placetable{Caption}{\placelegend{\bTABLE\bTR\bTD One\footnote{First} \eTD\bTD Two\footnote{Second} \eTD\eTR\bTR\bTD Three\footnote{Third} \eTD\bTD Four\footnote{Fourth} \eTD\eTR\eTABLE}{\noteframed{\placelocalfootnotes}}}\stoplocalfootnotes \stoptext</texcode> <context>
\defineframed[noteframed]
\setupframed[noteframed]
\starttext
\startlocalfootnotes%[n=0]
\placetable
{Caption}
==Footnotes in a box==
Note that Before LMTX, it is was necessary to add the command {{cmd|automigrateinserts}} (for example before {{cmd|link=no|starttext}})
in order to correctly handle the placement of footnotes within a box such as {{cmd|framed}} or {{cmd|placeongrid}}...
==Placing Footnotes Manually==
In some cases, ConTeXt's ConTeXt’s footnoting system may not be able to do exactly what you want. For instance, you may want to place a footnote in a table so that the footnote appears with the rest of the footnotes on the page, or you may want to create a footnote to a footnote to a footnote(The examples mentioned were outdated. ) Many of these cases can be handled by using the {{cmd|footnotetext}} command (which creates a footnote without placing the corresponding symbol in the text) and the {{cmd|note}} command (which places the footnote symbol in the text, but does not create a footnote).
For example, to create a footnote to a footnote to a footnote, all but the first footnotes are created with {{cmd|footnotetext}} commands, which are placed in the main text – thereby ensuring that the footnotes are numbered and appear in the correct order. Then, these footnotes are referenced by {{cmd|note}} commands within the relevant footnotes. In this example, the lines are broken for clarity; note the <code>%</code> at the end of each line to prevent spurious spaces in the text.
<texcodecontext source="yes">This%\footnote{Or that\notesetuppapersize[footBA7], if you prefer.}%\footnotetext[footB]{Or possibly even the other\note[footC].}%\footnotetext[footC]{It could be something entirely different.}is a sentence with nested footnotes.</texcode> <context>
\starttext
\strut\vfill
This%
\footnote{Or that\note[footB], if you prefer.}%
\setupinteraction[state=start,color=black,contrastcolor=black]
</texcode>
 
You can also set the colors to empty (just a comma) to avoid changing text color at all.
== Changing footnote interlinespace ==
\setupnote[footnote][setups=footnote:interlinespace]
</texcode>
 
 
<texcode>
\starttext  \setupnote[footnote][align={normal,hyphenated}]  \setupalign[hyphenated] \input tufte \footnote{\input tufte \relax} \par
\setupalign[nothyphenated,stretch,toleranthyphenated] \input tufte \footnote{\input tufte \relax} \par
\stoptextsetupalign[nothyphenated,stretch,tolerant] \input tufte\footnote{\input tufte \relax} \par
</texcode>
<context source="yes" text="produces">
\definepapersize[wiki][width=8cm,height=8cm] \setuppapersize[wiki][wikiA7
\starttext
* Can the footnote rule be placed on the right-hand side?
This is possible via setting the <code>rule</code> key of {{cmd|setupnote}} and {{cmd|definenote}}. In right-to-left documents it is usually desirable to have right-to-left footnotes, where right-aligned footnote rules make more sense aesthetically. Set <code>rule=right</code> to achieve this. Prior to 01-04-2016 Beta, this would have turned off the footnote rule completely: one needed to use <code>rule={on,right}</code>.
In a BiDi document the direction of the surrounding text where the {{cmd|footnote}} is invoked determines the direction of the footnote block to come later. Therefore, some footnotes may be right-to-left whereas others can be left-to-right. Note that the text of the footnote does not play a role here. The style designer decides whether left or right footnote rules make more sense. However, there is a third option: setting <code>rule=paragraph</code> looks at the first paragraph in the footnote block and let that determine the position of the footnote rule. In other words, if the footnote block of the page starts with an RTL text we end up with a right-aligned footnote rule and a left-aligned rule is typeset otherwise. (The first line/paragraph of the footnote block on a page need not correspond to the start of a footnote; it can rather be the leftover from a long footnote that started on some previous page.)
For more fancy footnote rules, you can use <code>rulecommand=\MyRuleCommand</code>. Look at the definition of <code>\normalnoterule</code> in {{src|strc-not.mkvi }} for a starting point.
[[Category:Basics]]

Navigation menu