From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: UTF-8 characters and gnuplot module
Date: Wed, 26 Mar 2008 10:28:50 +0100 [thread overview]
Message-ID: <6faad9f00803260228y3cae59d6xd45aee641d0e36e4@mail.gmail.com> (raw)
In-Reply-To: <47EA03AE.5040600@elvenkind.com>
On Wed, Mar 26, 2008 at 9:05 AM, Taco Hoekwater wrote:
> Hi,
>
> This thread is a bit confusing to me, so if there is an actual
> question to me, someone has to rephrase it (and keep in mind
> that I have not used gnuplot in 'ages').
Yes, I have two questions (that have been discussed at the begining of
development already).
1.) here's a minimal example:
\enableregime[utf]
\usemodule[gnuplot]
\setupGNUPLOT[terminal=mp] % so that you don't need to use the special binary
\startGNUPLOTscript[sin]
set xlabel 'héllo'
plot sin(x), sin(2*x) t '$sin(2x)$'
\stopGNUPLOTscript
\startGNUPLOTscript[cos]
# this comment doesn't work
set xlabel 'héllo'
plot cos(x)
\stopGNUPLOTscript
\starttext
\useGNUPLOTgraphic[sin]
\useGNUPLOTgraphic[cos]
\stoptext
Now, run texexec filename and take a look at filename-gnuplot-1.plt
The second example needs to be commented out anyway as it fails
completely. The problem is that the content of between GNUPLOTscript
should be copied *verbatim* to .plt file. Now it goes through some
semi-modified TeX parser that usually screws up some non-trivial cases
(or, better said, only trivial cases work OK). If there existed some
\startbuffer[name][continue], then it could be misused to put the
content between GNUPLOTscript literally to that plt file. However, I
have already been asking about how to do that (already in the time
when line endings were screwed up) and there has been no real
conclusion made so far. I guess it is possible, otherwise buffers and
verbatim would not work, but I have no idea how to do that.
Question 1a would probably be how to do that in mkiv, but that's not
such a high priority as fixing the "bug" in the old code.
>
> Mojca Miklavec wrote:
> >
> > set ylabel "h\dochar {233}llo"
>
> Should this not be
>
> set ylabel "h\\dochar {233}llo"
It should. But it's not me the one who has put that junk to the .plt
file :) :) :)
ConTeXt does some weird thing with characters and puts "\dochar {233}"
instead of "é" into the .plt file.
(Almost) "the same thing" (printed \dochar) has happened to me a few
times when using verbatim in ConTeXt (but got fixed).
> because of GNUplot's own double-quoted string parsing?
> Independent of expansion in \startGNUPLOTscript, I mean?
True, but how are you going to convince TeX (ConTeXt) to put double
backslash there?
> Speaking as the maintainer of Metapost, assuming 'plain.mp':
> you should be able to use UTF-8 in btex ... etex under the
> following (narrow) conditions:
>
> * you have set up the verbatimtex .. etex properly so that your
> macro package nows how to handle the UTF-8 input;
> * your tex engine generates DVI files
> * the resulting fonts that are used in that DVI are TFM-based.
>
> For context, that would mean mkii pdftex with \enableregime[utf],
> but in that case, you are much better off using \textext.
2.) So - how should the (plain) metapost file look like and how should
mptopdf be called, so that utf-8 would work OK in some portable-enough
way?
(\'e works OK there, it was only one backslash missing.)
> You cannot have UTF-8 in literal metapost label strings, because
> Metapost only knows about traditional TFM fonts (single byte).
That's fine. I do not need metapost label strings.
Thanks a lot,
Mojca
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2008-03-26 9:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-24 14:38 Morgan Brassel
2008-03-24 15:53 ` Mojca Miklavec
2008-03-24 16:03 ` Mojca Miklavec
2008-03-24 16:35 ` Morgan Brassel
2008-03-24 17:21 ` Mojca Miklavec
2008-03-24 18:52 ` Ethan Merritt
2008-03-24 20:14 ` Mojca Miklavec
2008-03-24 22:02 ` Hans Hagen
2008-03-24 22:21 ` Mojca Miklavec
2008-03-24 22:43 ` Hans Hagen
2008-03-25 14:28 ` Morgan Brassel
2008-03-25 14:55 ` Mojca Miklavec
2008-03-25 15:57 ` Morgan Brassel
2008-03-25 17:11 ` Mojca Miklavec
2008-03-25 20:24 ` Henning Hraban Ramm
2008-03-26 8:05 ` Taco Hoekwater
2008-03-26 9:28 ` Mojca Miklavec [this message]
2008-03-24 19:24 ` Mojca Miklavec
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=6faad9f00803260228y3cae59d6xd45aee641d0e36e4@mail.gmail.com \
--to=mojca.miklavec.lists@gmail.com \
--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).