ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \xmldoifelseempty
@ 2018-03-18 12:23 Pablo Rodriguez
  2018-03-18 18:37 ` \xmldoifelseempty survoje
  0 siblings, 1 reply; 6+ messages in thread
From: Pablo Rodriguez @ 2018-03-18 12:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have the following sample:

  \startbuffer[demo]
  <doc>
    <pre class="sourceCode tex typeset-fullwidth">
      <code class="sourceCode latex">
        \setupexternalfigures[location=default]
        \starttext
        \startTEXpage[offset=1ex]
        Full–width:

        \externalfigure[cow]
        \stopTEXpage
        \stoptext
      </code>
    </pre>
    <pre class="sourceCode tex typeset">
        <code class="sourceCode latex">
        \setupexternalfigures[location=default]
        \starttext
        \startTEXpage[offset=1ex]
        Half–width:

        \externalfigure[cow]
        \stopTEXpage
        \stoptext
      </code>
    </pre>
  </doc>
  \stopbuffer

  \startxmlsetups xml:initialize
     \xmlsetsetup{#1}{doc}{xml:*}
     \xmlsetsetup{\xmldocument}
        {pre[contains(@class,'typeset')]/code}
        {xml:pre:code}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:doc
     \xmlflush{#1}
  \stopxmlsetups

  \startxmlsetups xml:pre:code
    \xmlinfo{#1}
    \xmltobuffertextonly{#1}{.}{whereever}
    \xmldoifelseempty{#1}{../pre[contains(@class,'fullwidth')]}

{\startalign[center]\dontleavehmode\typesetbuffer[whereever][width=.5\textwidth]\stopalign}

{\startalign[center]\dontleavehmode\typesetbuffer[whereever][width=\textwidth]\stopalign}
  \stopxmlsetups

  \starttext
     \xmlprocessbuffer{main}{demo}{}
  \stoptext

How can I get in xml:pre:code that the presence or absence of
{../pre[contains(@class,'fullwidth')]} may trigger a conditional?

From what I understand from xml-mkiv.pdf, \xmldoifelseempty would be the
right command, but I cannot make it work.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: \xmldoifelseempty
  2018-03-18 12:23 \xmldoifelseempty Pablo Rodriguez
@ 2018-03-18 18:37 ` survoje
  2018-03-18 19:22   ` \xmldoifelseempty Pablo Rodriguez
  2018-03-18 19:32   ` \xmldoifelseempty Wolfgang Schuster
  0 siblings, 2 replies; 6+ messages in thread
From: survoje @ 2018-03-18 18:37 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 305 bytes --]

Bonjour,

\completeindex (or \placeindex) works in this case :

\setuppapersize[A5]%[A4,landscape]

%\setuparranging[2UP]


with %


but does not work in this case :


\setuppapersize[A5][A4,landscape]

\setuparranging[2UP]

I do not understand where is my mistake !

Thank you for your help !

Gérard



[-- Attachment #1.2: Type: text/html, Size: 1709 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: \xmldoifelseempty
  2018-03-18 18:37 ` \xmldoifelseempty survoje
@ 2018-03-18 19:22   ` Pablo Rodriguez
  2018-03-18 19:32   ` \xmldoifelseempty Wolfgang Schuster
  1 sibling, 0 replies; 6+ messages in thread
From: Pablo Rodriguez @ 2018-03-18 19:22 UTC (permalink / raw)
  To: ntg-context

On 03/18/2018 07:37 PM, survoje wrote:
> Bonjour,
> 
> \completeindex (or \placeindex) works in this case :
> 
> \setuppapersize[A5]%[A4,landscape]
> %\setuparranging[2UP]
> 
> with %
> 
> but does not work in this case :
> 
> \setuppapersize[A5][A4,landscape]
> \setuparranging[2UP]
> 
> I do not understand where is my mistake !

Hi Gérard,

please, start an new thread if you have a new question to the list.
Don’t “hijack” other people’s threads.

It seems that registers don’t work with imposition. I don’t know whether
this might be a bug.

A workaround for your issue would be:

    \setuppapersize[A5][A4, landscape]
    \setuparranging[2UP]
    \setuplayout
      [backspace=0pt,
        topspace=0pt,
           width=middle,
          height=middle,
        location=middle,
          header=0pt,
          footer=0pt]
    \setupinteraction[state=start]
    \setupinteractionscreen[option={landscape}]
    \starttext
        \startbuffer[real-document]
        \setuppapersize[A5]%% this might be removed
        \starttext
        a\index{b}
        b\index{c}
        c\index{d}
        \placeindex
        \stoptext
        \stopbuffer
    \typesetbuffer[real-document]
    \stoptext

I hope it helps,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: \xmldoifelseempty
  2018-03-18 18:37 ` \xmldoifelseempty survoje
  2018-03-18 19:22   ` \xmldoifelseempty Pablo Rodriguez
@ 2018-03-18 19:32   ` Wolfgang Schuster
  2018-03-18 22:21     ` \completindex in \setuparranging Gerard
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2018-03-18 19:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 476 bytes --]


> survoje <mailto:survoje@free.fr>
> 18. März 2018 um 19:37
>
> Bonjour,
>
> \completeindex (or \placeindex) works in this case :
>
> \setuppapersize[A5]%[A4,landscape]
>
> %\setuparranging[2UP]
>
>
> with %
>
>
> but does not work in this case :
>
>
> \setuppapersize[A5][A4,landscape]
>
> \setuparranging[2UP]
>
> I do not understand where is my mistake !

You have to use the arrange option for the context command, e.g.

     context --arrange my_document.tex

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2705 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* \completindex in \setuparranging
  2018-03-18 19:32   ` \xmldoifelseempty Wolfgang Schuster
@ 2018-03-18 22:21     ` Gerard
  2018-03-18 22:50       ` Pablo Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Gerard @ 2018-03-18 22:21 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1305 bytes --]

Thank you Wolfgang for the solution :

context --arrange my_document.tex

Hi Pablo,

I sent my email too fast (using message without changing the subject 
!!!), I will be more vigilant next time with a new message !

Gérard


Le 18/03/2018 à 20:32, Wolfgang Schuster a écrit :
>
>> survoje <mailto:survoje@free.fr>
>> 18. März 2018 um 19:37
>>
>> Bonjour,
>>
>> \completeindex (or \placeindex) works in this case :
>>
>> \setuppapersize[A5]%[A4,landscape]
>>
>> %\setuparranging[2UP]
>>
>>
>> with %
>>
>>
>> but does not work in this case :
>>
>>
>> \setuppapersize[A5][A4,landscape]
>>
>> \setuparranging[2UP]
>>
>> I do not understand where is my mistake !
>
> You have to use the arrange option for the context command, e.g.
>
>     context --arrange my_document.tex
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 5574 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: \completindex in \setuparranging
  2018-03-18 22:21     ` \completindex in \setuparranging Gerard
@ 2018-03-18 22:50       ` Pablo Rodriguez
  0 siblings, 0 replies; 6+ messages in thread
From: Pablo Rodriguez @ 2018-03-18 22:50 UTC (permalink / raw)
  To: ntg-context

On 03/18/2018 11:21 PM, Gerard wrote:
> Thank you Wolfgang for the solution :
> 
> context --arrange my_document.tex
> 
> Hi Pablo,
> 
> I sent my email too fast (using message without changing the subject
> !!!), I will be more vigilant next time with a new message !

Hi Gérard,

it was good to know that there is an --arrange option for context. (I
must confess I didn’t know that).

BTW, you need to compose a blank new message to the mailing list to
start a new thread.

If you only reply to another message replacing its subject with another
one, the thread the message belongs to is the old one.

Just in case it helps,

Pablo


> Le 18/03/2018 à 20:32, Wolfgang Schuster a écrit :
>>
>>> survoje <mailto:survoje@free.fr>
>>> 18. März 2018 um 19:37
>>>
>>> Bonjour,
>>>
>>> \completeindex (or \placeindex) works in this case :
>>>
>>> \setuppapersize[A5]%[A4,landscape]
>>>
>>> %\setuparranging[2UP]
>>>
>>>
>>> with %
>>>
>>>
>>> but does not work in this case :
>>>
>>>
>>> \setuppapersize[A5][A4,landscape]
>>>
>>> \setuparranging[2UP]
>>>
>>> I do not understand where is my mistake !
>>
>> You have to use the arrange option for the context command, e.g.
>>
>>     context --arrange my_document.tex
>>
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 


-- 
http://www.ousia.tk
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-18 22:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-18 12:23 \xmldoifelseempty Pablo Rodriguez
2018-03-18 18:37 ` \xmldoifelseempty survoje
2018-03-18 19:22   ` \xmldoifelseempty Pablo Rodriguez
2018-03-18 19:32   ` \xmldoifelseempty Wolfgang Schuster
2018-03-18 22:21     ` \completindex in \setuparranging Gerard
2018-03-18 22:50       ` Pablo Rodriguez

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