ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Code in  contextref-env.tex
@ 2012-08-22 20:14 john Culleton
  2012-08-22 20:18 ` Aditya Mahajan
  2012-08-22 21:02 ` Sietse Brouwer
  0 siblings, 2 replies; 4+ messages in thread
From: john Culleton @ 2012-08-22 20:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

In the file contextref-env.tex I find code like the following:

\setupsectionblock[\v!frontpart] [\c!page=\v!yes]
\setupsectionblock[\v!bodypart]  [\c!page=\v!yes]
\setupsectionblock[\v!appendix]  [\c!page=\v!yes]
\setupsectionblock[\v!frontpart] [\c!before=,\c!after=]

I have no idea what the sequences like "\v!"and "\c!" etc. mean.
Are they references to modes?

-- 
John Culleton
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Police Procedural and Expose: "Death Wore Black"
"Create Book Covers with Scribus"
http://www.booklocker.com/books/4055.html
___________________________________________________________________________________
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] 4+ messages in thread

* Re: Code in contextref-env.tex
  2012-08-22 20:14 Code in contextref-env.tex john Culleton
@ 2012-08-22 20:18 ` Aditya Mahajan
  2012-08-22 21:02 ` Sietse Brouwer
  1 sibling, 0 replies; 4+ messages in thread
From: Aditya Mahajan @ 2012-08-22 20:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 22 Aug 2012, john Culleton wrote:

> In the file contextref-env.tex I find code like the following:
>
> \setupsectionblock[\v!frontpart] [\c!page=\v!yes]
> \setupsectionblock[\v!bodypart]  [\c!page=\v!yes]
> \setupsectionblock[\v!appendix]  [\c!page=\v!yes]
> \setupsectionblock[\v!frontpart] [\c!before=,\c!after=]
>
> I have no idea what the sequences like "\v!"and "\c!" etc. mean.
> Are they references to modes?

Search for multi-lingual on this page:
http://wiki.contextgarden.net/System_Macros/Key_Value_Assignments

Aditya
___________________________________________________________________________________
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] 4+ messages in thread

* Re: Code in contextref-env.tex
  2012-08-22 20:14 Code in contextref-env.tex john Culleton
  2012-08-22 20:18 ` Aditya Mahajan
@ 2012-08-22 21:02 ` Sietse Brouwer
  2012-08-22 21:21   ` Hans Hagen
  1 sibling, 1 reply; 4+ messages in thread
From: Sietse Brouwer @ 2012-08-22 21:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> I have no idea what the sequences like "\v!"and "\c!" etc. mean.
> Are they references to modes?

I asked much the same question on tex.stackexchange.com two months
ago, except mine was not so nice and focused.
Aditya gave a very nice explanation of what the letters do; clearer
than the one on the wiki, I thought. Here's a link straight to his
answer:
http://tex.stackexchange.com/a/58716/2229

They are used as language-agnostic forms.
Using ConTeXt's English format, you'd type \startmarginblock
Using ConTeXt's French format, you'd type \demarreblocmarge
So to accomodate both, we define variables
\s!start --> start or demarre, and
\e!marginblock --> marginblock or blocmarge,
depending on the language, and then we tell TeX we want to run the
command named with the string
\s!start\e!marginblock --> startmarginblock or demarreblocmarge.
(Example not entirely accurate, I believe the variable for
startmarginblock is define holisticaly. But you get my point.)

Example of the need for the letter codes, paraphrased from mult-ini.mkiv:
Where English uses 'left', in Dutch one finds both 'links' for '(on)
the left' and 'linker' for 'the left one'. Hence the letter codes, so
we can have
\v!left --> links and
\c!left --> linker.

\c! is for keywords
\v! is for value names
\s! is for system bits
\e! is for elements

Hope this helps you in reading the sources!

Cheers,
Sietse
___________________________________________________________________________________
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] 4+ messages in thread

* Re: Code in contextref-env.tex
  2012-08-22 21:02 ` Sietse Brouwer
@ 2012-08-22 21:21   ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2012-08-22 21:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 22-8-2012 23:02, Sietse Brouwer wrote:
>> I have no idea what the sequences like "\v!"and "\c!" etc. mean.
>> Are they references to modes?
>
> I asked much the same question on tex.stackexchange.com two months
> ago, except mine was not so nice and focused.
> Aditya gave a very nice explanation of what the letters do; clearer
> than the one on the wiki, I thought. Here's a link straight to his
> answer:
> http://tex.stackexchange.com/a/58716/2229
>
> They are used as language-agnostic forms.
> Using ConTeXt's English format, you'd type \startmarginblock
> Using ConTeXt's French format, you'd type \demarreblocmarge
> So to accomodate both, we define variables
> \s!start --> start or demarre, and
> \e!marginblock --> marginblock or blocmarge,
> depending on the language, and then we tell TeX we want to run the
> command named with the string
> \s!start\e!marginblock --> startmarginblock or demarreblocmarge.
> (Example not entirely accurate, I believe the variable for
> startmarginblock is define holisticaly. But you get my point.)
>
> Example of the need for the letter codes, paraphrased from mult-ini.mkiv:
> Where English uses 'left', in Dutch one finds both 'links' for '(on)
> the left' and 'linker' for 'the left one'. Hence the letter codes, so
> we can have
> \v!left --> links and
> \c!left --> linker.
>
> \c! is for keywords
> \v! is for value names
> \s! is for system bits
> \e! is for elements
>
> Hope this helps you in reading the sources!

In practice users don't have to use that convention in their files, 
unless they are meant to be multilingual.

Btw, there is a nice story behind this:

- left    = 4 tokens
- \c!left = 1 token

so, when context grew harder than tex's string space (we're talking 
emtex times) it was also a way to save memory. To some extend it's also 
faster (less tokens to pass as argument) but at the same time there is a 
penalty of expanding the 1 into 4. So, in a single lingual interface 
there is not much gain. Some of the 'struggles with too small engines' 
has been removed in mkiv as nowadays we have no such constraints.

When I introduced the \c! and \v! prefixes context was still dutch and 
when there came interest from abroad, it had the nice side effect that I 
could make an (first german, later also english) interface in just a 
couple of hours (context was smaller at that time). The first module to 
actually be multilingual was 'ppchtex'.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2012-08-22 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-22 20:14 Code in contextref-env.tex john Culleton
2012-08-22 20:18 ` Aditya Mahajan
2012-08-22 21:02 ` Sietse Brouwer
2012-08-22 21:21   ` Hans Hagen

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).