ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* textext within ConTeXt
@ 2019-03-03 17:52 Mohammad Hossein Bateni
  2019-03-03 18:12 ` Alan Braslau
  0 siblings, 1 reply; 3+ messages in thread
From: Mohammad Hossein Bateni @ 2019-03-03 17:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,

I can't understand why the following code does not work.  Could someone
help me out here?

\starttext
\startMPpage
draw textext("\convertnumber{r}{12}");
draw textext("\convertnumber{r}{" & "12" & "}");
\stopMPpage
\stoptext

The first draw statement works perfectly.  But the second one throws out
errors and complains as follows:

.....test.tex: ! Missing number, treated as zero


<to be read again>



<argument> \number "

          & "12" & "

\romannumerals #1->\clf_romannumerals \numexpr #1

                                                 \relax

<argument> ... draw textext("\convertnumber {r}{" & "12" & "}

                                                  ");

\meta_process_graphic ...currentMPformat }data {#1

                                                  ;}initializations
{\meta_f...

\page_fitting_stop_command ...eter \c!command {#1}

                                                  \page_fitting_stop_normal

Is there a workaround here?  Ultimately I want to replace "12" with a loop
variable in MetaPost.

Thanks,
~MHB

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

[-- Attachment #2: Type: text/plain, Size: 493 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] 3+ messages in thread

* Re: textext within ConTeXt
  2019-03-03 17:52 textext within ConTeXt Mohammad Hossein Bateni
@ 2019-03-03 18:12 ` Alan Braslau
  2019-03-03 18:26   ` Mohammad Hossein Bateni
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Braslau @ 2019-03-03 18:12 UTC (permalink / raw)
  To: Mohammad Hossein Bateni; +Cc: mailing list for ConTeXt users

On Sun, 3 Mar 2019 12:52:53 -0500
Mohammad Hossein Bateni <bateni@gmail.com> wrote:

> Hi,
> 
> I can't understand why the following code does not work.  Could someone
> help me out here?
> 
> \starttext
> \startMPpage
> draw textext("\convertnumber{r}{12}");
> draw textext("\convertnumber{r}{" & "12" & "}");
> \stopMPpage
> \stoptext
> 
> The first draw statement works perfectly.  But the second one throws out
> errors and complains as follows:

Because luatex intercepts and processes \convertnumber{r}{
and tries to pass this result to MP as a string, not the other way around.

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://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: textext within ConTeXt
  2019-03-03 18:12 ` Alan Braslau
@ 2019-03-03 18:26   ` Mohammad Hossein Bateni
  0 siblings, 0 replies; 3+ messages in thread
From: Mohammad Hossein Bateni @ 2019-03-03 18:26 UTC (permalink / raw)
  To: Alan Braslau; +Cc: mailing list for ConTeXt users


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

This is quite counterintuitive... It also happens if I define a string
variable, use concatenate operator to set its value, and then finally pass
the string to textext macro.

Is there a way to get around this issue?

On Sun, Mar 3, 2019, 1:13 PM Alan Braslau <braslau.list@comcast.net> wrote:

> On Sun, 3 Mar 2019 12:52:53 -0500
> Mohammad Hossein Bateni <bateni@gmail.com> wrote:
>
> > Hi,
> >
> > I can't understand why the following code does not work.  Could someone
> > help me out here?
> >
> > \starttext
> > \startMPpage
> > draw textext("\convertnumber{r}{12}");
> > draw textext("\convertnumber{r}{" & "12" & "}");
> > \stopMPpage
> > \stoptext
> >
> > The first draw statement works perfectly.  But the second one throws out
> > errors and complains as follows:
>
> Because luatex intercepts and processes \convertnumber{r}{
> and tries to pass this result to MP as a string, not the other way around.
>
> Alan
>

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

[-- Attachment #2: Type: text/plain, Size: 493 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] 3+ messages in thread

end of thread, other threads:[~2019-03-03 18:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-03 17:52 textext within ConTeXt Mohammad Hossein Bateni
2019-03-03 18:12 ` Alan Braslau
2019-03-03 18:26   ` Mohammad Hossein Bateni

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