ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \note and \footnote
@ 2010-12-23 20:11 Jon Crump
  2010-12-23 20:36 ` Yury G. Kudryashov
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Crump @ 2010-12-23 20:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 20:11 \note and \footnote Jon Crump
@ 2010-12-23 20:36 ` Yury G. Kudryashov
  2010-12-23 20:47   ` Jon Crump
  0 siblings, 1 reply; 11+ messages in thread
From: Yury G. Kudryashov @ 2010-12-23 20:36 UTC (permalink / raw)
  To: ntg-context

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?

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 20:36 ` Yury G. Kudryashov
@ 2010-12-23 20:47   ` Jon Crump
  2010-12-23 20:58     ` Thomas A. Schmitz
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Crump @ 2010-12-23 20:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

On Thu, Dec 23, 2010 at 12:36 PM, Yury G. Kudryashov <urkud@ya.ru> wrote:

> 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

[-- Attachment #2: doublefoot.xml --]
[-- Type: text/xml, Size: 465 bytes --]

<?xml version="1.0" encoding="utf-8"?>
<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>


[-- Attachment #3: doublefoot.tex --]
[-- Type: application/x-tex, Size: 1112 bytes --]

[-- Attachment #4: doublefoot.pdf --]
[-- Type: application/pdf, Size: 11888 bytes --]

[-- Attachment #5: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 20:47   ` Jon Crump
@ 2010-12-23 20:58     ` Thomas A. Schmitz
  2010-12-23 21:17       ` Jon Crump
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas A. Schmitz @ 2010-12-23 20:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 20:58     ` Thomas A. Schmitz
@ 2010-12-23 21:17       ` Jon Crump
  2010-12-23 21:20         ` Thomas A. Schmitz
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Crump @ 2010-12-23 21:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Dec 23, 2010 at 12:58 PM, Thomas A. Schmitz
<thomas.schmitz@uni-bonn.de> wrote:
>
> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 21:17       ` Jon Crump
@ 2010-12-23 21:20         ` Thomas A. Schmitz
  2010-12-23 21:34           ` Jon Crump
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas A. Schmitz @ 2010-12-23 21:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 21:20         ` Thomas A. Schmitz
@ 2010-12-23 21:34           ` Jon Crump
  2010-12-23 21:41             ` Thomas A. Schmitz
  2010-12-23 21:42             ` Jon Crump
  0 siblings, 2 replies; 11+ messages in thread
From: Jon Crump @ 2010-12-23 21:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

On Thu, Dec 23, 2010 at 1:20 PM, Thomas A. Schmitz
<thomas.schmitz@uni-bonn.de> 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

[-- Attachment #2: doublefoot.pdf --]
[-- Type: application/pdf, Size: 11888 bytes --]

[-- Attachment #3: doublefoot.tex --]
[-- Type: application/x-tex, Size: 1521 bytes --]

[-- Attachment #4: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 21:34           ` Jon Crump
@ 2010-12-23 21:41             ` Thomas A. Schmitz
  2010-12-23 21:47               ` Jon Crump
  2010-12-23 21:42             ` Jon Crump
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas A. Schmitz @ 2010-12-23 21:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]


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


[-- Attachment #2: doublefoot.pdf --]
[-- Type: application/pdf, Size: 10527 bytes --]

[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 21:34           ` Jon Crump
  2010-12-23 21:41             ` Thomas A. Schmitz
@ 2010-12-23 21:42             ` Jon Crump
  1 sibling, 0 replies; 11+ messages in thread
From: Jon Crump @ 2010-12-23 21:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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 <jjcrump@uw.edu> wrote:
> On Thu, Dec 23, 2010 at 1:20 PM, Thomas A. Schmitz
> <thomas.schmitz@uni-bonn.de> 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
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 21:41             ` Thomas A. Schmitz
@ 2010-12-23 21:47               ` Jon Crump
  2010-12-23 22:03                 ` Jon Crump
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Crump @ 2010-12-23 21:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Dec 23, 2010 at 1:41 PM, Thomas A. Schmitz
<thomas.schmitz@uni-bonn.de> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \note and \footnote
  2010-12-23 21:47               ` Jon Crump
@ 2010-12-23 22:03                 ` Jon Crump
  0 siblings, 0 replies; 11+ messages in thread
From: Jon Crump @ 2010-12-23 22:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Dec 23, 2010 at 1:47 PM, Jon Crump <jjcrump@uw.edu> wrote:
> On Thu, Dec 23, 2010 at 1:41 PM, Thomas A. Schmitz
> <thomas.schmitz@uni-bonn.de> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-12-23 22:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-23 20:11 \note and \footnote Jon Crump
2010-12-23 20:36 ` Yury G. Kudryashov
2010-12-23 20:47   ` Jon Crump
2010-12-23 20:58     ` Thomas A. Schmitz
2010-12-23 21:17       ` Jon Crump
2010-12-23 21:20         ` Thomas A. Schmitz
2010-12-23 21:34           ` Jon Crump
2010-12-23 21:41             ` Thomas A. Schmitz
2010-12-23 21:47               ` Jon Crump
2010-12-23 22:03                 ` Jon Crump
2010-12-23 21:42             ` Jon Crump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).