From: Rik <rik@panix.com>
To: ntg-context@ntg.nl
Subject: Movable code, was Re: starttexdefinition error in standalone, works in TL2013
Date: Wed, 12 Mar 2014 15:49:09 -0400 [thread overview]
Message-ID: <5320BA35.2070702@panix.com> (raw)
In-Reply-To: <4FDA647E-AA4E-4619-88EE-65DE254BA093@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2311 bytes --]
On 2014-03-01 07:32, Wolfgang Schuster wrote:
>
> \unexpanded\def\startTranslation
> {\begingroup
> \dosingleempty\dostartTranslation}
>
> \def\dostartTranslation[#1]%
> {\iffirstargument
> \getrawparameters[Translation][setups=,language=en,#1]%
> \fi
> \grabbufferdata[Translation][startTranslation][stopTranslation]}
>
> \def\stopTranslation
> {\language[\Translationlanguage]%
> \Translationsetups
> (\,\getbufferdata[Translation]\removeunwantedspaces\,)%
> \endgroup}
>
> \starttext
>
> \startTranslation[language=nl]
> It betrays a slow-witted mentality to pursue the streams, but not to see the sources of things.
> \stopTranslation
>
> \stoptext
>
> Wolfgang
>
Wolfgang (and list),
The above code works fine with simple texts, but is not movable. Adding
a footnote, as in the following, to the text section shows that:
\starttext
\startTranslation[language=en]
It betrays a slow-witted mentality to pursue the streams, but not to
see the sources of things.%
\footnote{%
\startTranslation[language=la]
Tardi ingeni est rivulos consectari, fontes rerum non videre.
\stopTranslation%
}
\stopTranslation
\stoptext
or even by:
\starttext
It betrays a slow-witted mentality to pursue the streams, but not to
see the sources of things.%
\footnote{%
\startTranslation[language=la]
Tardi ingeni est rivulos consectari, fontes rerum non videre.
\stopTranslation%
}
\stoptext
In LaTeX, this might be dealt with by a combination robust command
definitions and \protected. When I wrote an endnotes routine in LaTeX, I
used those and wrote the notes to a file which was then read back in at
the appropriate time, but that does not help with pagenotes.
I imagine that at the time the footnote is processed the
Translationsetups and Translationlanguage macros are no longer defined,
and I have no idea how one would reference the buffer contents, although
it does look like they have stable names in the log file.
Can this be made movable?
Also, am I correct that the \iffirstargument test in the definition of
dostarttranslation is redundant? My understanding is that \dosingleempty
assures the presence of [#1].
--
Rik
[-- Attachment #1.2: Type: text/html, Size: 3389 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 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
___________________________________________________________________________________
prev parent reply other threads:[~2014-03-12 19:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 4:08 Rik Kabel
2014-02-27 15:13 ` Rik Kabel
2014-03-01 12:32 ` Wolfgang Schuster
2014-03-01 17:01 ` Rik Kabel
2014-03-12 19:49 ` Rik [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5320BA35.2070702@panix.com \
--to=rik@panix.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).