ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez <oinos@gmx.es>
To: ntg-context@ntg.nl
Subject: Re: integer displayed as .0 float in Lua-5.3
Date: Sat, 11 Aug 2018 12:05:39 +0200	[thread overview]
Message-ID: <880cd24a-68b1-d217-63a5-059af5d39b9f@gmx.es> (raw)
In-Reply-To: <977bddcd-2322-4eed-9ef8-0a2a31b6e3a0@xs4all.nl>

On 08/09/2018 10:25 PM, Hans Hagen wrote:
> In addition to what others already explained, you should not depend on 
> features that are implementation dependent or might disappear.

Many thanks for your detailed explanation, Hans.

I had no idea that the automatic conversion from string to number where
so dependent on the Lua version.

> That said 
> ...
> 
> \startTEXpage[offset=1em]
> \ctxlua{context([[\lastpage]])}.
> \stopTEXpage
> 
> Why do you convert \lastpage to a string using [[\lastpage]] which will 
> use the string to number conversion?

Well, I must confess that this is a new knowledge to me.

I thought that "[[ ]]" was the form to escape what I think it is the
escape character in Lua.

How I came to that assumption? Probably because I tried to add a raw
command to \ctxlua or inside a \startlua...\stoplua.

> You can just do:
> 
> \startTEXpage[offset=1em]
> \ctxlua{context(\lastpage + 1)}.
> \stopTEXpage

From this sample, I understand that "\" doesn’t need to be escaped
inside context(), does it?

> or if you really want to [[ ]]
> 
> \startTEXpage[offset=1em]
> \the\numexpr\ctxlua{context([[lastpage]] + 1)}\relax .
> \stopTEXpage
> 
> endless possibities here.

I don’t need "[[ ]]", I only thought I needed them.

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
___________________________________________________________________________________

  reply	other threads:[~2018-08-11 10:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09 18:02 Pablo Rodriguez
2018-08-09 18:12 ` Wolfgang Schuster
2018-08-09 19:20   ` Pablo Rodriguez
2018-08-09 19:34     ` Alan Braslau
2018-08-09 20:00       ` Pablo Rodriguez
2018-08-09 20:16         ` Alan Braslau
2018-08-11  9:29           ` Pablo Rodriguez
2018-08-11 17:55             ` Alan Braslau
2018-08-12 14:44             ` Arthur Reutenauer
2018-08-09 20:25         ` Hans Hagen
2018-08-11 10:05           ` Pablo Rodriguez [this message]
2018-08-09 20:20     ` Hans Åberg
2018-08-11  9:33       ` Pablo Rodriguez
2018-08-11 12:21         ` Hans Åberg
2018-08-12  7:49         ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=880cd24a-68b1-d217-63a5-059af5d39b9f@gmx.es \
    --to=oinos@gmx.es \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).