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
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
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
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 -----------------------------------------------------------------
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
john Culleton
-
Sietse Brouwer