# [NTG-context] UTF-8 characters and gnuplot module

Mojca Miklavec mojca.miklavec.lists at gmail.com
Mon Mar 24 20:24:49 CET 2008

On Mon, Mar 24, 2008 at 3:38 PM, Morgan Brassel <morgan.brassel at free.fr> wrote:
> Hi everyone,
>
>  I'm currently learning how to use the gnuplot module (thank you Mojca, and
>  all the others, for this great tool!). I stick for now with the metapost
>  terminal, as I'm not sure I'd be able to recompile gnuplot in order to add
>  the context terminal.
>
>  It seems that accents are not supported in gnuplot scripts. In the example
>  below, both the methods to typeset accents fail. Is there a solution to
>  this? Maybe there is something wrong with my settings...
>
>  Best regards,
>  Morgan
>
>
>  \usemodule[gnuplot]
>  \setupGNUPLOT[terminal=mp]
>  \startGNUPLOTscript[sin]
>  set xlabel "héllo h\'ello"

Try:
set xlabel \detokenize{"h\\'ello"}
Actually, one needs to escape backslash in gnuplot (that's a general
rule). I'm sorry for not noticing that fact before.

Just keep in mind that \detokenize is an ugly workaround (you could
consider it a bug in t-gnuplot.tex, but I have no idea how to fix it).

It would be easiest if
\startbuffer[name][continue/append]
some werbatim text
\stopbuffer
would work - then I would misuse that mechanism instead of doing dirty
catcode changes. (I also need to ask either magician for help to port
that part to mkiv; in XeTeX it seems to work OK.)

>  plot sin(x)
>  \stopGNUPLOTscript
>  \starttext
>  \useGNUPLOTgraphic[sin]
>  \stoptext

Mojca