Re: [NTG-context] system macros/doquadrupleemtpy
On Wed, Sep 3, 2008 at 4:41 PM, Thomas A. Schmitz [EMAIL PROTECTED] wrote: Hi all, I'm trying to define a macro \Command which can either have four or five arguments. If it has five, I want to define them as \Command1[#1][#2][#3][#4]{#5} if it has four, as \Command2[#1][#2][#3]{4#} I thought this would be the way to go: \def\Command{% \doquadrupleempty\doCommand} \def\doCommand{% \iffifthargument% \doquadrupleargument\Command1% \else% \dotripleargument\Command2% \fi} but that gives me errors about too many }s. So I'm wondering: am I on the wrong track? Can this be done at all? Thanks, and best Thomas \def\Commanda {\doquadrupleempty\doCommanda} \def\doCommanda[#1][#2][#3][#4]% {\iffourthargument \def\next{\doCommandafive[#1][#2][#3][#4]}% \else \def\next{\doCommandafour[#1][#2][#3]}% \fi\next} \def\doCommandafive[#1][#2][#3][#4]#5% {five arguments} \def\doCommandafour[#1][#2][#3]#4% {four arguments} \def\Commandb {\doquadrupleempty\doCommandb} \def\doCommandb[#1][#2][#3][#4]% {\iffourthargument \def\next{\dodoCommandb[#1][#2][#3][#4]}% \else \def\next{\dodoCommandb[#1][#2][#3][]}% \fi\next} \def\dodoCommandb[#1][#2][#3][#4]#5% {\doifelsenothing{#4} {four arguments} {five arguments}} \starttext \Commanda[1][2][3][4]{5} \Commanda[1][2][3]{4} \Commandb[1][2][3][4]{5} \Commandb[1][2][3]4 \Commandb[1][2][3][]{4} % feature \stoptext Wolfgang ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] system macros/doquadrupleemtpy
Aditya, Peter, as always, thanks a lot for your help. Peter, you're certainly right that it's difficult to diagnose my problem - I'm sending only snippets, no example. But it's a fairly complex thing here for my presentation module and difficult to reduce in size. On Sep 3, 2008, at 6:58 PM, Aditya Mahajan wrote: On Wed, 3 Sep 2008, Thomas A. Schmitz wrote: Hi all, I'm trying to define a macro \Command which can either have four or five arguments. If it has five, I want to define them as \Command1[#1][#2][#3][#4]{#5} if it has four, as \Command2[#1][#2][#3]{4#} I thought this would be the way to go: \def\Command{% \doquadrupleempty\doCommand} You need something with possibly five arguments so you should use quint rather than quad: \def\Command% {\doquintupleargument\doCommand} \def\doCommand{% \iffifthargument% \doquadrupleargument\Command1% \else% \dotripleargument\Command2% \fi} The usual way is \def\doCommand[#1][#2][#3][#4][#5]% {\doifelsenothing{#5}%See below {\Command1[#1][#2][#3][#4][#5]} {\Command2[#1][#2][#3][#4]}} I use \doifelsenothing rather than \doiffirthargument. If I give \Command[...][...][...][...][] with \doifelsenothing \Commnad2 will be called while with \iffifthargument \Command1 will be called. Use whichever is more appropriate for your problem. OK, that does make sense, but now I also see where my problem lies. When I define \doCommand[#1][#2][#3][#4]#5 and then have \Command2[#1][#2][#3]#4 TeX picks up a closing bracket as #4. I suspect that my problem lies in the definition \doCommand[#1][#2][#3][#4]#5 . The two definitions don't match; when I look at \doCommand, the closing bracket is indeed argument #4, from TeX's point of view. Maybe I need to reverse the order of my arguments and make it \doCommand#1[#2][#3][#4][#5] ? but I'm not sure if this would play with quintupleempty... Anyway, thanks a lot for your help. I'll look further into it and will maybe come back with a real example later if I can't figure it out. 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Verbatim with color background
B. Tommy Jensen wrote: Hi, I have a short question about verbatim areas (\starttyping): I have been trying to define a background color to verbatim areas in a document. My method so far is to define a textbackground named verbatim and refer to this in the setuptyping method: \setuptyping[typing][margin=0.5cm,bodyfont=8.0pt, before={\starttextbackground[verbatim]}, after={\stoptextbackground}] This works only partly. For example, when using long verbatim texts that spans over more than one page, the background color disappears on the last page. Is there any other easy way of controlling the background color on verbatim areas? can you make a small example that shows where it goes wrong? - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] system macros/doquadrupleemtpy
On Sep 4, 2008, at 8:45 AM, Wolfgang Schuster wrote: \def\Commanda {\doquadrupleempty\doCommanda} \def\doCommanda[#1][#2][#3][#4]% {\iffourthargument \def\next{\doCommandafive[#1][#2][#3][#4]}% \else \def\next{\doCommandafour[#1][#2][#3]}% \fi\next} \def\doCommandafive[#1][#2][#3][#4]#5% {five arguments} \def\doCommandafour[#1][#2][#3]#4% {four arguments} \def\Commandb {\doquadrupleempty\doCommandb} \def\doCommandb[#1][#2][#3][#4]% {\iffourthargument \def\next{\dodoCommandb[#1][#2][#3][#4]}% \else \def\next{\dodoCommandb[#1][#2][#3][]}% \fi\next} \def\dodoCommandb[#1][#2][#3][#4]#5% {\doifelsenothing{#4} {four arguments} {five arguments}} \starttext \Commanda[1][2][3][4]{5} \Commanda[1][2][3]{4} \Commandb[1][2][3][4]{5} \Commandb[1][2][3]4 \Commandb[1][2][3][]{4} % feature \stoptext Wolfgang YES! That's the end of my suffering!! Thanks a lot, Wolfgang, you're my hero. Makes sense, too, now that I look at it. Now I'm gonna find out what \next does... Thanks! 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Bug in luatex?
Diego Depaoli wrote: Hi all, compiling this small file with luatex I get weird results. this is a bug in luatex itself taco: when i comment brokenpenalty here, it works ok \def\nopenalties {\widowpenalty\zerocount \clubpenalty \zerocount \brokenpenalty \zerocount % prevents \doublehyphendemerits\zerocount \finalhyphendemerits \zerocount \adjdemerits \zerocount } this is used in (supp-box) \processisolatedwords (btw, some day i will rewrite all annotation related stuff) test file: \setupinteraction[state=start] \useURL[161/63][http://www.regione.emilia-romagna.it/cra/pdf/161_63.pdf][][Legge 14 febbraio] \starttext \from[161/63] \stoptext somehow between 14 and febbraio no valid breakpoint occurs (a par is created with three lines that has to be split in three) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] error message query
On Wed, Sep 3, 2008 at 9:48 PM, Alan Bowen [EMAIL PROTECTED] wrote: It appears that the problem is my definition \def\ {|~|} Though this definition works in a simple test file, it apparently conflicts with something in my environment file and produces the error message reported previously. So, is there a safer way to define \space as {|~|}? \def\ {\thinspace} Wolfgang ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] interactionbuttons
Alan Stone wrote: What's missing for this to work ? \definereference[GoToToC][\goto{ToC}[myToC]] \def\myButtons {\interactionbuttons[width=1cm][ GoToToC,CloseDocument]} see symb-nav.tex - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Verbatim with color background
On Thu, 04 Sep 2008 10:12:47 +0200, Hans Hagen [EMAIL PROTECTED] wrote: Is there any other easy way of controlling the background color on verbatim areas? can you make a small example that shows where it goes wrong? The example I used is shown below. Other observations are: - The code works with mkIV but not mkII - Removing the chapters in the test file also make it work with mkII - I am using the latest win32 standalone ConTeXt Best regards, Tommy Jensen % START EXAMPLE \setupcolors[state=start] % We use Palatino as the main body font \usetypescript[palatino][ec] \setupbodyfont[palatino,10pt] \definetextbackground[verbatim] [background=color, backgroundcolor=yellow, backgroundoffset=0cm, offset=0.5cm, frame=on, framecolor=black, location=paragraph, color=black] % Setup verbatim \setuptyping[typing][margin=1cm,bodyfont=8.0pt, before={\starttextbackground[verbatim]}, after={\stoptextbackground}] \starttext \chapter{One} Chapter one. \chapter{Two} Chapter two. \chapter{Three} Chapter three. \starttyping This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim section. This is a long verbatim
Re: [NTG-context] interactionbuttons
On Thu, Sep 4, 2008 at 10:12 AM, Hans Hagen [EMAIL PROTECTED] wrote: see symb-nav.tex Got that Hans. Thanks. Now I'd like to assign a command to a(nother) new button. However, from what I understand from \button[...,...=...,...]{...}[ref,ref,...] http://texshow.contextgarden.net/command/detail/482 it works with a ref (*), not with a command. Following the links which lead to \setupframed http://texshow.contextgarden.net/cmd/setupframed the only parameters which accept a command are top and bottom. What are these ? Or must I proceed otherwise ? Thanks, Alan (*) what's meant by ref,ref,... ? One button = one ref (or not ?) ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] synctex support for ConTeXt fixed
Jérome Laurens wrote: I'll notice developers of Skim, Sumatra-PDF, TeXWorks, TeXShop, since i'm on windows i checked on sumatra-pdf but it has incomplete hyperlink support and crashes on show-man.pdf (also has clipping problems) ... no time now to look into it but i'll pick up it up later Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] error message query
Thanks, Wolfgang. That is just what I needed: it works in all my environments and looks good in the output. As for line breaking, it can produce an overfull \hbox but that is very easily seen and repaired. Best, Alan On Sep 4, 2008, at 04;39,32 , Wolfgang Schuster wrote: On Wed, Sep 3, 2008 at 9:48 PM, Alan Bowen [EMAIL PROTECTED] wrote: It appears that the problem is my definition \def\ {|~|} Though this definition works in a simple test file, it apparently conflicts with something in my environment file and produces the error message reported previously. So, is there a safer way to define \space as {|~|}? \def\ {\thinspace} Wolfgang ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] symb-uni.tex
Hi, re: http://source.contextgarden.net/symb-uni.tex What does, for example, 0x2000: Requires UnicodeRegular20 mean in \startsymbolset[Unicode Additional Punctuation] % 0x2000: Requires UnicodeRegular20 in the context of \usesymbols[uni] \def\mySymbol{\symbol[Unicode Additional Punctuation][*symbolname*]} Thanks, Alan ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] symb-uni.tex
Alan Stone wrote: Hi, re: http://source.contextgarden.net/symb-uni.tex What does, for example, 0x2000: Requires UnicodeRegular20 mean in \startsymbolset[Unicode Additional Punctuation] % 0x2000: Requires UnicodeRegular20 in the context of \usesymbols[uni] \def\mySymbol{\symbol[Unicode Additional Punctuation][*symbolname*]} this system is based on big ttf files split into pfb ranges where 20 indicates a range (so, the font with symbolicname UnicodeRegular might have many split fonts) a kind of obsolete mechanism now that we have mkiv Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] symb-uni.tex
this system is ... a kind of obsolete mechanism now that we have mkiv Excuse me my ignorance... What mkiv feature/mechanism replaces the obsolete one ? Best, Alan On Thu, Sep 4, 2008 at 5:36 PM, Hans Hagen [EMAIL PROTECTED] wrote: Alan Stone wrote: Hi, re: http://source.contextgarden.net/symb-uni.tex What does, for example, 0x2000: Requires UnicodeRegular20 mean in \startsymbolset[Unicode Additional Punctuation] % 0x2000: Requires UnicodeRegular20 in the context of \usesymbols[uni] \def\mySymbol{\symbol[Unicode Additional Punctuation][*symbolname*]} this system is based on big ttf files split into pfb ranges where 20 indicates a range (so, the font with symbolicname UnicodeRegular might have many split fonts) a kind of obsolete mechanism now that we have mkiv Hans ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] symb-uni.tex
Alan Stone wrote: this system is ... a kind of obsolete mechanism now that we have mkiv Excuse me my ignorance... What mkiv feature/mechanism replaces the obsolete one ? named glyph access but so far i had no time to make dedicated symb files for that Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] symb-uni.tex
Ok Hans. So back to the old days... What additional instruction(s) are required to satisfy the condition of, for example 0x2000: Requires UnicodeRegular20 ? -- Best, Alan * using ConTeXt ver: 2008.08.18 14:00 MKIV fmt: 2008.8.22 int: english/english (on Windows XP) On Thu, Sep 4, 2008 at 6:51 PM, Hans Hagen [EMAIL PROTECTED] wrote: Alan Stone wrote: this system is ... a kind of obsolete mechanism now that we have mkiv Excuse me my ignorance... What mkiv feature/mechanism replaces the obsolete one ? named glyph access but so far i had no time to make dedicated symb files for that Hans ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] MKIV textext problem.
Wolfgang Schuster wrote: On Wed, Sep 3, 2008 at 10:08 AM, Yue Wang [EMAIL PROTECTED] wrote: Hi, Hans, the code works for MKII but not for MKIV. known issue or bug? Yue Wang and here comes the file. in mkii: - when you run out of fonts (due to randomization), then use a snapper: vardef s(expr txt)= h(txt, (ceiling(uniformdeviate(1)*100))/100); enddef; - use \forceMPTEXgraphictrue to make sure that the intermediate tex run takes place in mkiv: - in meta-pps, you can increment the number of reserved boxes ... \appendtoks \MPLIBallocate{1000}\to \everydump - also, remove the transparency spec since it will not work (you can use transparency in the text instead); for text + color to work i either need to make real ugly mp/lua code or wait till mplib supports multiple pre/postscripts - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] frameoffset in textbackground
Hallo, what is 'frameoffset' for? There seems to be no difference with and without this key. -- \setupcolors[state=start] \definetextbackground[strong] [backgroundcolor=lightgray, location=paragraph, frame=on, frameoffset=5mm] \starttext bla \starttextbackground[strong] zack \stoptextbackground blub \stoptext Wolfgang ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___