All, Something elementary, I'm sure, that I'm not understanding. I'm trying to achieve parallel footnotes in arab/english texts, ie. each footnote in the Arabic text has a corresponding footnote in the English text. Both should point to the same footnote text. Like this: <body> <text> <div type='arText'> <lb /> some arab <ref target="#N01">text</ref> <lb /> more arab <ref target="#N02">text</ref> </div> <div type='enText'> <lb /> some english <ref target="#N01">text</ref> <lb /> more english <ref target="#N02">text</ref> </div> <div type='fnotes'> <note xml:id="N01">text for note ONE</note> <note xml:id="N02">text for note TWO</note> </div> </text> </body> I thought to use TeX's \note[ref], but the following doesn't seem to work. \startxmlsetups xml:ref \define\thisRefName{\xmlatt{#1}{target}} \xmldoifelse{#1}{parent::div[@type='arText']} {\footnote[\thisRefName]{\xmlfirst{#1}{root::/body/text/div[@type='fnotes']/note[@xml:id==string.sub('\xmlatt{#1}{target}',2)]}}} {\note[\thisRefName]} \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:div:fnotes \placefootnotes \stopxmlsetups I just get ?? for the reference markers in the English text. Any clues as to what I'm doing wrong; or, is there a better way altogether to approach this? Jon
Jon Crump wrote:
All,
I thought to use TeX's \note[ref], but the following doesn't seem to work.
\startxmlsetups xml:ref \define\thisRefName{\xmlatt{#1}{target}} \xmldoifelse{#1}{parent::div[@type='arText']} {\footnote[\thisRefName]{\xmlfirst{#1} {root::/body/text/div[@type='fnotes']/note[@xml:id==string.sub('\xmlatt{#1} {target}',2)]}}} {\note[\thisRefName]} I'm not sure about expansion order. Probably \thisRefName is not expanded in one of the commands above. Could you please attach either a minimal working example (test.xml and test.tex that one can save and run context test), or log file?
On Thu, Dec 23, 2010 at 12:36 PM, Yury G. Kudryashov
I'm not sure about expansion order. Probably \thisRefName is not expanded in one of the commands above. Could you please attach either a minimal working example (test.xml and test.tex that one can save and run context test), or log file?
Thanks Yury, Attached is a minimal working example, along with the pdf output I got running: context --environment=doublefoot.tex doublefoot.xml context --version reports: MTXrun | current version: 2010.12.10 15:15
On Dec 23, 2010, at 9:47 PM, Jon Crump wrote:
Attached is a minimal working example, along with the pdf output I got running: context --environment=doublefoot.tex doublefoot.xml
Why do you use the intermediate step of creating a macro? I think this does what you want: \startxmlsetups xml:ref \xmldoifelse{#1}{parent::div[@type='arText']} {\footnote[\xmlatt{#1}{target}] {\xmlfirst{#1} {root::/body/text/div[@type='fnotes']/note[@xml:id==string.sub('\xmlatt{#1}{target}',2)]} } } {\note[\xmlatt{#1}{target}]} \xmlflush{#1} \stopxmlsetups Thomas
On Thu, Dec 23, 2010 at 12:58 PM, Thomas A. Schmitz
On Dec 23, 2010, at 9:47 PM, Jon Crump wrote:
Attached is a minimal working example, along with the pdf output I got running: context --environment=doublefoot.tex doublefoot.xml
Why do you use the intermediate step of creating a macro? I think this does what you want:
\startxmlsetups xml:ref \xmldoifelse{#1}{parent::div[@type='arText']} {\footnote[\xmlatt{#1}{target}] {\xmlfirst{#1} {root::/body/text/div[@type='fnotes']/note[@xml:id==string.sub('\xmlatt{#1}{target}',2)]} } } {\note[\xmlatt{#1}{target}]} \xmlflush{#1} \stopxmlsetups
Thomas
Thanks Thomas, My thought, ill-informed perhaps, was simply for clarity: to make it clear that I'm using the same value in both \note[] and \footnote[]. In any case, sadly, using what you suggest still gets me the same result. Jon
On Dec 23, 2010, at 10:17 PM, Jon Crump wrote:
My thought, ill-informed perhaps, was simply for clarity: to make it clear that I'm using the same value in both \note[] and \footnote[]. In any case, sadly, using what you suggest still gets me the same result.
I get correct output here. Try deleting the doublefoot.tuc file and rerunning ConTeXt.
On Thu, Dec 23, 2010 at 1:20 PM, Thomas A. Schmitz
On Dec 23, 2010, at 10:17 PM, Jon Crump wrote:
My thought, ill-informed perhaps, was simply for clarity: to make it clear that I'm using the same value in both \note[] and \footnote[]. In any case, sadly, using what you suggest still gets me the same result.
I get correct output here. Try deleting the doublefoot.tuc file and rerunning ConTeXt.
mysterious: I tried that and got the same output; both for your version and mine attached .tex and .pdf
On Thu, Dec 23, 2010 at 1:41 PM, Thomas A. Schmitz
On Dec 23, 2010, at 10:34 PM, Jon Crump wrote:
mysterious: I tried that and got the same output; both for your version and mine
Here's mine. Are you using the same version?
ConTeXt ver: 2010.12.22 20:18 MKIV fmt: 2010.12.23 int: english/english
Rats. That's just what I was trying to get. My version reports: ConTeXt ver: 2010.12.10 15:15 MKIV fmt: 2010.12.11 int: english/english So I guess I'll re-figure out how to update, and try again. Thanks for your efforts. Jon
On Thu, Dec 23, 2010 at 1:47 PM, Jon Crump
On Thu, Dec 23, 2010 at 1:41 PM, Thomas A. Schmitz
wrote: On Dec 23, 2010, at 10:34 PM, Jon Crump wrote:
mysterious: I tried that and got the same output; both for your version and mine
Here's mine. Are you using the same version?
ConTeXt ver: 2010.12.22 20:18 MKIV fmt: 2010.12.23 int: english/english
Rats. That's just what I was trying to get. My version reports: ConTeXt ver: 2010.12.10 15:15 MKIV fmt: 2010.12.11 int: english/english
So I guess I'll re-figure out how to update, and try again. Thanks for your efforts.
Jon
Well that was relatively painless. Context now reports: ConTeXt ver: 2010.12.22 20:18 MKIV fmt: 2010.12.23 int: english/english And the doublefoot example now produces the expected results, Huzzah! Many thanks Yury and Thomas. Jon
even more minimal, I tried running context on this:
\starttext
some text with footnote\footnote[f]{footnote text} \\
some text with reference\note[f]
\stoptext
and got the same phenomenon:
some text with footnote 1
some text with reference ??
Something about the \note[] mechanism I'm not getting?
Jon
On Thu, Dec 23, 2010 at 1:34 PM, Jon Crump
On Thu, Dec 23, 2010 at 1:20 PM, Thomas A. Schmitz
wrote: On Dec 23, 2010, at 10:17 PM, Jon Crump wrote:
My thought, ill-informed perhaps, was simply for clarity: to make it clear that I'm using the same value in both \note[] and \footnote[]. In any case, sadly, using what you suggest still gets me the same result.
I get correct output here. Try deleting the doublefoot.tuc file and rerunning ConTeXt.
mysterious: I tried that and got the same output; both for your version and mine
attached .tex and .pdf
participants (3)
-
Jon Crump
-
Thomas A. Schmitz
-
Yury G. Kudryashov