* ifdim ... or ... else ... @ 2008-09-10 11:49 Steffen Wolfrum 2008-09-10 12:12 ` Thomas A. Schmitz 2008-09-10 12:15 ` Marcin Borkowski 0 siblings, 2 replies; 11+ messages in thread From: Steffen Wolfrum @ 2008-09-10 11:49 UTC (permalink / raw) To: mailing list for ConTeXt users Hi, I'd like to change the phrase "if lastskip equals \EinsSignal set vskip to 0pt else ..." to "if lastskip equals \EinsSignal set vskip to 0pt else if lastskip equals \\ZweiSignal set vskip to -2pt else ... " in the following code ... \newsignal\ZweiSignal \def\EbeneDreibefore {\ifdim\lastskip=\EinsSignal \vskip-0pt \else \blank[20pt]\fi} \setuphead[EbeneDrei][...,before=\EbeneDreibefore,...] Some native (tex)speaker can help me translating? Steffen ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ifdim ... or ... else ... 2008-09-10 11:49 ifdim ... or ... else Steffen Wolfrum @ 2008-09-10 12:12 ` Thomas A. Schmitz 2008-09-10 12:15 ` Marcin Borkowski 1 sibling, 0 replies; 11+ messages in thread From: Thomas A. Schmitz @ 2008-09-10 12:12 UTC (permalink / raw) To: mailing list for ConTeXt users On Sep 10, 2008, at 1:49 PM, Steffen Wolfrum wrote: > Hi, > > > I'd like to change the phrase > > "if lastskip equals \EinsSignal set vskip to 0pt else ..." > > to > > "if lastskip equals \EinsSignal set vskip to 0pt else if lastskip > equals \\ZweiSignal set vskip to -2pt else ... " > > > in the following code ... > > \newsignal\ZweiSignal > \def\EbeneDreibefore {\ifdim\lastskip=\EinsSignal \vskip-0pt \else > \blank[20pt]\fi} > \setuphead[EbeneDrei][...,before=\EbeneDreibefore,...] > > > Some native (tex)speaker can help me translating? > > Steffen I'm not a native texspeaker, but this should wo what you want: \def\EbeneDreibefore% {\ifdim\lastskip=\EinsSignal \vskip-0pt% \else\ifdim\lastskip=\ZweiSignal \vskip-2pt% \else \blank[20pt]% \fi% \fi} You just nest the two \ifdim tests. 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ifdim ... or ... else ... 2008-09-10 11:49 ifdim ... or ... else Steffen Wolfrum 2008-09-10 12:12 ` Thomas A. Schmitz @ 2008-09-10 12:15 ` Marcin Borkowski 2008-09-10 12:23 ` was: " Steffen Wolfrum 2008-09-10 12:31 ` Hans Hagen 1 sibling, 2 replies; 11+ messages in thread From: Marcin Borkowski @ 2008-09-10 12:15 UTC (permalink / raw) To: mailing list for ConTeXt users Dnia Wed, Sep 10, 2008 at 01:49:52PM +0200, Steffen Wolfrum napisał(a): > Hi, > > > I'd like to change the phrase > > "if lastskip equals \EinsSignal set vskip to 0pt else ..." > > to > > "if lastskip equals \EinsSignal set vskip to 0pt else if lastskip > equals \\ZweiSignal set vskip to -2pt else ... " > > > in the following code ... > > \newsignal\ZweiSignal > \def\EbeneDreibefore {\ifdim\lastskip=\EinsSignal \vskip-0pt \else > \blank[20pt]\fi} > \setuphead[EbeneDrei][...,before=\EbeneDreibefore,...] What about just that you wrote? \ifdim ... \else\ifdim ... \fi\fi > > > Some native (tex)speaker can help me translating? Non-native, but close (OTOH, not so close as Hans;)) -- Marcin Borkowski (http://mbork.faculty.fmcs.amu.edu.pl) <>< ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* was: ifdim ... or ... else ... 2008-09-10 12:15 ` Marcin Borkowski @ 2008-09-10 12:23 ` Steffen Wolfrum 2008-09-10 12:28 ` Wolfgang Schuster 2008-09-10 12:31 ` Hans Hagen 1 sibling, 1 reply; 11+ messages in thread From: Steffen Wolfrum @ 2008-09-10 12:23 UTC (permalink / raw) To: mailing list for ConTeXt users Thanks Marcin, that's it! BTW: what language is that actually? TeX or ConTeXt? I'd like to learn some more then just "Hello World" ;o) Steffen Am 10.09.2008 um 14:15 schrieb Marcin Borkowski: > Dnia Wed, Sep 10, 2008 at 01:49:52PM +0200, Steffen Wolfrum > napisał(a): >> Hi, >> >> >> I'd like to change the phrase >> >> "if lastskip equals \EinsSignal set vskip to 0pt else ..." >> >> to >> >> "if lastskip equals \EinsSignal set vskip to 0pt else if lastskip >> equals \\ZweiSignal set vskip to -2pt else ... " >> >> >> in the following code ... >> >> \newsignal\ZweiSignal >> \def\EbeneDreibefore {\ifdim\lastskip=\EinsSignal \vskip-0pt \else >> \blank[20pt]\fi} >> \setuphead[EbeneDrei][...,before=\EbeneDreibefore,...] > > What about just that you wrote? > > \ifdim ... \else\ifdim ... \fi\fi > >> >> >> Some native (tex)speaker can help me translating? > > Non-native, but close (OTOH, not so close as Hans;)) > > -- > Marcin Borkowski (http://mbork.faculty.fmcs.amu.edu.pl) > > <>< > ___________________________________________________________________________________ > 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: was: ifdim ... or ... else ... 2008-09-10 12:23 ` was: " Steffen Wolfrum @ 2008-09-10 12:28 ` Wolfgang Schuster 0 siblings, 0 replies; 11+ messages in thread From: Wolfgang Schuster @ 2008-09-10 12:28 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Sep 10, 2008 at 2:23 PM, Steffen Wolfrum <context@st.estfiles.de> wrote: > Thanks Marcin, that's it! > > BTW: what language is that actually? TeX or ConTeXt? > I'd like to learn some more then just "Hello World" ;o) \ifdim is a TeX primitive 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ifdim ... or ... else ... 2008-09-10 12:15 ` Marcin Borkowski 2008-09-10 12:23 ` was: " Steffen Wolfrum @ 2008-09-10 12:31 ` Hans Hagen 2008-09-10 14:12 ` Wolfgang Schuster 1 sibling, 1 reply; 11+ messages in thread From: Hans Hagen @ 2008-09-10 12:31 UTC (permalink / raw) To: mailing list for ConTeXt users Marcin Borkowski wrote: > Dnia Wed, Sep 10, 2008 at 01:49:52PM +0200, Steffen Wolfrum napisał(a): >> Hi, >> >> >> I'd like to change the phrase >> >> "if lastskip equals \EinsSignal set vskip to 0pt else ..." >> >> to >> >> "if lastskip equals \EinsSignal set vskip to 0pt else if lastskip >> equals \\ZweiSignal set vskip to -2pt else ... " >> >> >> in the following code ... >> >> \newsignal\ZweiSignal >> \def\EbeneDreibefore {\ifdim\lastskip=\EinsSignal \vskip-0pt \else >> \blank[20pt]\fi} >> \setuphead[EbeneDrei][...,before=\EbeneDreibefore,...] > > What about just that you wrote? > > \ifdim ... \else\ifdim ... \fi\fi > >> >> Some native (tex)speaker can help me translating? > > Non-native, but close (OTOH, not so close as Hans;)) ok then, an obscure solution for the natives ... untested: \setvalue{Ebene:\the\dimexpr 0pt\relax}{1pt} \setvalue{Ebene:\the\dimexpr 1pt\relax}{-2pt} \vskip\executeifdefined{Ebene:\the\lastskip}{0pt}\relax ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ifdim ... or ... else ... 2008-09-10 12:31 ` Hans Hagen @ 2008-09-10 14:12 ` Wolfgang Schuster 2008-09-10 15:15 ` Hans Hagen 0 siblings, 1 reply; 11+ messages in thread From: Wolfgang Schuster @ 2008-09-10 14:12 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Sep 10, 2008 at 2:31 PM, Hans Hagen <pragma@wxs.nl> wrote: > Marcin Borkowski wrote: >> Dnia Wed, Sep 10, 2008 at 01:49:52PM +0200, Steffen Wolfrum napisał(a): >>> Hi, >>> >>> >>> I'd like to change the phrase >>> >>> "if lastskip equals \EinsSignal set vskip to 0pt else ..." >>> >>> to >>> >>> "if lastskip equals \EinsSignal set vskip to 0pt else if lastskip >>> equals \\ZweiSignal set vskip to -2pt else ... " >>> >>> >>> in the following code ... >>> >>> \newsignal\ZweiSignal >>> \def\EbeneDreibefore {\ifdim\lastskip=\EinsSignal \vskip-0pt \else >>> \blank[20pt]\fi} >>> \setuphead[EbeneDrei][...,before=\EbeneDreibefore,...] >> >> What about just that you wrote? >> >> \ifdim ... \else\ifdim ... \fi\fi >> >>> >>> Some native (tex)speaker can help me translating? >> >> Non-native, but close (OTOH, not so close as Hans;)) > > ok then, an obscure solution for the natives ... untested: > > \setvalue{Ebene:\the\dimexpr 0pt\relax}{1pt} > \setvalue{Ebene:\the\dimexpr 1pt\relax}{-2pt} > > \vskip\executeifdefined{Ebene:\the\lastskip}{0pt}\relax But this is newspeak ;-) 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ifdim ... or ... else ... 2008-09-10 14:12 ` Wolfgang Schuster @ 2008-09-10 15:15 ` Hans Hagen 2008-09-13 12:18 ` Wolfgang Schuster 0 siblings, 1 reply; 11+ messages in thread From: Hans Hagen @ 2008-09-10 15:15 UTC (permalink / raw) To: mailing list for ConTeXt users Wolfgang Schuster wrote: > On Wed, Sep 10, 2008 at 2:31 PM, Hans Hagen <pragma@wxs.nl> wrote: >> Marcin Borkowski wrote: >>> Dnia Wed, Sep 10, 2008 at 01:49:52PM +0200, Steffen Wolfrum napisał(a): >>>> Hi, >>>> >>>> >>>> I'd like to change the phrase >>>> >>>> "if lastskip equals \EinsSignal set vskip to 0pt else ..." >>>> >>>> to >>>> >>>> "if lastskip equals \EinsSignal set vskip to 0pt else if lastskip >>>> equals \\ZweiSignal set vskip to -2pt else ... " >>>> >>>> >>>> in the following code ... >>>> >>>> \newsignal\ZweiSignal >>>> \def\EbeneDreibefore {\ifdim\lastskip=\EinsSignal \vskip-0pt \else >>>> \blank[20pt]\fi} >>>> \setuphead[EbeneDrei][...,before=\EbeneDreibefore,...] >>> What about just that you wrote? >>> >>> \ifdim ... \else\ifdim ... \fi\fi >>> >>>> Some native (tex)speaker can help me translating? >>> Non-native, but close (OTOH, not so close as Hans;)) >> ok then, an obscure solution for the natives ... untested: >> >> \setvalue{Ebene:\the\dimexpr 0pt\relax}{1pt} >> \setvalue{Ebene:\the\dimexpr 1pt\relax}{-2pt} >> >> \vskip\executeifdefined{Ebene:\the\lastskip}{0pt}\relax > > But this is newspeak ;-) newspeak would be using an attribute and postprocessing the node list -) 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ifdim ... or ... else ... 2008-09-10 15:15 ` Hans Hagen @ 2008-09-13 12:18 ` Wolfgang Schuster 2008-09-13 19:25 ` Hans Hagen 2008-09-14 14:30 ` luigi scarso 0 siblings, 2 replies; 11+ messages in thread From: Wolfgang Schuster @ 2008-09-13 12:18 UTC (permalink / raw) To: mailing list for ConTeXt users Am 10.09.2008 um 17:15 schrieb Hans Hagen: > newspeak would be using an attribute and postprocessing the node > list -) How could I write this in newspeak: \newsignal\yesnosignal \def\yesno{\scratchdimen\lastskip\ifdim\scratchdimen=\yesnosignal YES \else NO\fi} \starttext text \hskip\yesnosignal \yesno\ text \hskip\yesnosignal text \yesno\ text \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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ifdim ... or ... else ... 2008-09-13 12:18 ` Wolfgang Schuster @ 2008-09-13 19:25 ` Hans Hagen 2008-09-14 14:30 ` luigi scarso 1 sibling, 0 replies; 11+ messages in thread From: Hans Hagen @ 2008-09-13 19:25 UTC (permalink / raw) To: mailing list for ConTeXt users Wolfgang Schuster wrote: > Am 10.09.2008 um 17:15 schrieb Hans Hagen: > >> newspeak would be using an attribute and postprocessing the node >> list -) > > How could I write this in newspeak: > > \newsignal\yesnosignal > > \def\yesno{\scratchdimen\lastskip\ifdim\scratchdimen=\yesnosignal YES > \else NO\fi} > in traditional speak: \def\YesNo{\relax\ifdim\lastskip=\yesnosignal YES\else NO\fi} > \starttext > > text \hskip\yesnosignal \yesno\ text \hskip\yesnosignal text \yesno\ > text > > \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 > ___________________________________________________________________________________ -- ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ifdim ... or ... else ... 2008-09-13 12:18 ` Wolfgang Schuster 2008-09-13 19:25 ` Hans Hagen @ 2008-09-14 14:30 ` luigi scarso 1 sibling, 0 replies; 11+ messages in thread From: luigi scarso @ 2008-09-14 14:30 UTC (permalink / raw) To: mailing list for ConTeXt users On Sat, Sep 13, 2008 at 2:18 PM, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote: > > Am 10.09.2008 um 17:15 schrieb Hans Hagen: > >> newspeak would be using an attribute and postprocessing the node >> list -) > > How could I write this in newspeak: > > \newsignal\yesnosignal > > \def\yesno{\scratchdimen\lastskip\ifdim\scratchdimen=\yesnosignal YES > \else NO\fi} > > \starttext > > text \hskip\yesnosignal \yesno\ text \hskip\yesnosignal text \yesno\ > text > > \stoptext > It's no mkiv way (aka "newspeak") . I worked to something like this at Bohinj (I don't know why '25' in an.number==25 ) . I'm not sure that it works, If i have time I will check it . %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% def\StudyBox#1#2#3{% \startluacode nodes = nodes or {} local traverse_id = node.traverse_id local head = tex.box[#1].list local m = 0 local hlist, vlist, whatsit,glue = node.id('hlist'), node.id('vlist'), node.id('whatsit'),node.id('glue') local attribute = node.id('attribute') local attributeList = node.id('attribute_list') texio.write_nl(' ** SigStartC='..tostring(tex.count['SignalStartC'])..' SigStopC='..tostring(tex.count['SignalStopC'])..'\n') local SigStartC = #2 or 0 local SigStopC = #3 or 0 local function searchrecursive(head) %%-- if node.type(head.id)== 'rule' then attlist = head.attr %%print("==>",tostring(nodes.serialize(nodes.totable(head)))) for an in node.traverse(attlist) do if node.has_field(an, 'number') and node.has_field(an, 'value') and an.number==25 and an.value==101 then texio.write_nl('SigStartC INCRESEAD'..'\n') SigStartC = SigStartC +1 end if node.has_field(an, 'number') and node.has_field(an, 'value') and an.number==25 and an.value==111 then texio.write_nl('SigStop decresead'..'\n') SigStopC = SigStopC +1 end end %%-- end if node.has_field(head,'list') then %%-- print("ok") for n in node.traverse(head.list) do %%-- print(tostring(n)) searchrecursive(n) end end end texio.write_nl('SigStartC='..SigStartC..' SigStopC='..SigStopC..'\n') searchrecursive(tex.box[#1]) texio.write_nl('SigStartC='..SigStartC..' SigStopC='..SigStopC..'\n') tex.setcount('SignalStartC',SigStartC) tex.setcount('SignalStopC',SigStopC) \stopluacode} \global\newcount\SignalStartC \global\newcount\SignalStopC \defineattribute[SigStart] \def\SignalStart{\hbox attr\dogetattributeid{SigStart}=101 to 0sp {\vrule width 0sp height0sp depth0sp}} \def\SignalStop{\hbox attr\dogetattributeid{SigStart}=111 to 0sp {\vrule width 0sp height0sp depth0sp}} \starttext \setbox100=\vbox{ \nobreak\SignalStart\nobreak Some text . \nobreak\SignalStop\nobreak } \StudyBox{100}{\the\SignalStartC}{\the\SignalStopC}% end \stoptext %%%%%%%%%%%%%%%% See log and output for some -- luigi ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-09-14 14:30 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-09-10 11:49 ifdim ... or ... else Steffen Wolfrum 2008-09-10 12:12 ` Thomas A. Schmitz 2008-09-10 12:15 ` Marcin Borkowski 2008-09-10 12:23 ` was: " Steffen Wolfrum 2008-09-10 12:28 ` Wolfgang Schuster 2008-09-10 12:31 ` Hans Hagen 2008-09-10 14:12 ` Wolfgang Schuster 2008-09-10 15:15 ` Hans Hagen 2008-09-13 12:18 ` Wolfgang Schuster 2008-09-13 19:25 ` Hans Hagen 2008-09-14 14:30 ` luigi scarso
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).