ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Troubles with the \cldcontext command
@ 2019-04-02 19:17 Willi Egger
  2019-04-02 20:29 ` Wolfgang Schuster
  2019-04-02 20:45 ` Willi Egger
  0 siblings, 2 replies; 3+ messages in thread
From: Willi Egger @ 2019-04-02 19:17 UTC (permalink / raw)
  To: ntg-Context ConTeXt users

Hello!

I have the following code, which should manipulate the page number. However I get an error:


MWE:

\setuppapersize [A6] [A6]

\setuppagenumbering[location=none]

\startsetups [Pagenumber]
  \doifrightpageelse
    {\cldcontext{"\letterpercent d",(\pagenumber+1)/2}}
    {}
\stopsetups

\setupfootertexts [\directsetup{Pagenumber}]

\setupbodyfont [pagella,9pt]


\starttext

\startstandardmakeup
  Hello world!
\stopstandardmakeup

\dorecurse{3}{TEST\page}

\stoptext


Error:


\cldcontext #1->\directlua {context(#1)}
                                        
<argument> \ignorecrlf \directsetup {Pagenumber}
                                     {}{}{}
\secondoftwoarguments #1#2->#2
                              
\page_layouts_process_element_single_indeed ...#4}
                                                  \fi \endgroup 
\page_layouts_process_element_single ...#1#2#3{#4}
                                                  \fi 
<argument> ...th {\hss \layoutelementparameter \c!middletext 
                                                  \hss }\kern -\makeupwidth ...


What do i miss here? I am stumid…

Willi
___________________________________________________________________________________
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] 3+ messages in thread

* Re: Troubles with the \cldcontext command
  2019-04-02 19:17 Troubles with the \cldcontext command Willi Egger
@ 2019-04-02 20:29 ` Wolfgang Schuster
  2019-04-02 20:45 ` Willi Egger
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2019-04-02 20:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Willi Egger

Willi Egger schrieb am 02.04.19 um 21:17:
> Hello!
> 
> I have the following code, which should manipulate the page number. However I get an error:
> 
> 
> MWE:
> 
> \setuppapersize [A6] [A6]
> 
> \setuppagenumbering[location=none]
> 
> \startsetups [Pagenumber]
>    \doifrightpageelse
>      {\cldcontext{"\letterpercent d",(\pagenumber+1)/2}}
>      {}
> \stopsetups
> 
> [...]
> 
> What do i miss here? I am stumid…

I guess %d wasn’t the right way to round the number, you can use

\startsetups [Pagenumber]
   \doifoddpageelse
     {\cldcontext{"\letterpercent.0f",(\pagenumber+1)/2}}
     {}
\stopsetups

or

\startsetups [Pagenumber]
   \doifoddpageelse
     {\cldcontext{"\letterpercent r",(\pagenumber+1)/2}}
     {}
\stopsetups

Search in cld-mkiv.pdf for formatters to find more options.

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
___________________________________________________________________________________

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

* Re: Troubles with the \cldcontext command
  2019-04-02 19:17 Troubles with the \cldcontext command Willi Egger
  2019-04-02 20:29 ` Wolfgang Schuster
@ 2019-04-02 20:45 ` Willi Egger
  1 sibling, 0 replies; 3+ messages in thread
From: Willi Egger @ 2019-04-02 20:45 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

Dear Wolfgang!


thank you so much for your reply. I tried the test file and it works. tomorrow I will look further in a bigger environment.

Thanks and good night!

Willi

> On 2 Apr 2019, at 21:17, Willi Egger <context@boede.nl> wrote:
> 
> Hello!
> 
> I have the following code, which should manipulate the page number. However I get an error:
> 
> 
> MWE:
> 
> \setuppapersize [A6] [A6]
> 
> \setuppagenumbering[location=none]
> 
> \startsetups [Pagenumber]
>  \doifrightpageelse
>    {\cldcontext{"\letterpercent d",(\pagenumber+1)/2}}
>    {}
> \stopsetups
> 
> \setupfootertexts [\directsetup{Pagenumber}]
> 
> \setupbodyfont [pagella,9pt]
> 
> 
> \starttext
> 
> \startstandardmakeup
>  Hello world!
> \stopstandardmakeup
> 
> \dorecurse{3}{TEST\page}
> 
> \stoptext
> 
> 
> Error:
> 
> 
> \cldcontext #1->\directlua {context(#1)}
> 
> <argument> \ignorecrlf \directsetup {Pagenumber}
>                                     {}{}{}
> \secondoftwoarguments #1#2->#2
> 
> \page_layouts_process_element_single_indeed ...#4}
>                                                  \fi \endgroup 
> \page_layouts_process_element_single ...#1#2#3{#4}
>                                                  \fi 
> <argument> ...th {\hss \layoutelementparameter \c!middletext 
>                                                  \hss }\kern -\makeupwidth ...
> 
> 
> What do i miss here? I am stumid…
> 
> Willi
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________

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

end of thread, other threads:[~2019-04-02 20:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02 19:17 Troubles with the \cldcontext command Willi Egger
2019-04-02 20:29 ` Wolfgang Schuster
2019-04-02 20:45 ` Willi Egger

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