ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: What is changed?
Date: Mon, 4 Feb 2013 13:13:42 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.02.1302041312420.31410@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <854E6F7F-CD3D-44F7-A5EF-FE16250FBD6C@uva.nl>

On Mon, 4 Feb 2013, H. van der Meer wrote:

> The following worked without a hitch:
>
> \def\IsNilReturn#1{\edef\tmp{#1}\doifelse{\tmp}{nil}{\color[red]{ERROR}}{\tmp}}
> \def\formatDuration#1{\ctxlua{
> 	local s = string.gsub("#1","\%D","")
> 	local d = tostring(hvdm.time:match(s))
> 	tex.print(string.sub(d,1,2) ~= "0:" and d or string.sub(d,3))
> 	}}
> \def\FormatDuration#1{\IsNilReturn{\formatDuration{#1}}}
> Called by something like \FormatDuration{11929} (meaning: 1 hour 19 minutes 29 seconds)
>
> Now I get an error in
> ConTeXt  ver: 2013.01.27 21:24 MKIV  fmt: 2013.1.28  int: english/english
> ! LuaTeX error [string "\directlua "]:1: invalid escape sequence near '\%'.
> \formatDuration ...0:" and d or string.sub(d,3)) }
> \IsNilReturn #1->\edef \tmp {#1
>                               }\doifelse {\tmp }{nil}{\color [red]{ERROR}}{...
>
> Whereas in a previous Context all went well:
> ConTeXt  ver: 2012.05.30 11:26 MKIV  fmt: 2013.2.4  int: english/english
>
> What did change? Why? And how to repair?

I noticed something similar a few days ago. IIRC, using \letterpercent 
still works (untested).

Aditya
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2013-02-04 18:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04 18:11 H. van der Meer
2013-02-04 18:13 ` Aditya Mahajan [this message]
2013-02-04 18:26   ` Meer H. van der
2013-02-04 19:12     ` Wolfgang Schuster
2013-02-04 19:13       ` Wolfgang Schuster

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=alpine.LNX.2.02.1302041312420.31410@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --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).