octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Treat TeX in plot text in a Matlab compatible matter with gnuplot en


From: Daniel J Sebald
Subject: Re: Treat TeX in plot text in a Matlab compatible matter with gnuplot enhanced mode
Date: Wed, 22 Feb 2012 01:34:18 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 11/26/2007 02:45 PM, John W. Eaton wrote:
On 26-Nov-2007, David Bateman wrote:

| John W. Eaton wrote:
|>  On 26-Nov-2007, David Bateman wrote:
|>
|>  | John W. Eaton wrote:
|>  |>  On 26-Nov-2007, David Bateman wrote:
|>  |>
|>  |>  | That is fairly easy to address in drawnow:enhanced_term.. We just have
|>  |>  | to check if the terminal is (e)pslatex, and don't flag this as an
|>  |>  | enhanced terminal. I can't easily regenerate a new patch, for this 
patch
|>  |>  | at this point, but will make this change if you accept this patch..
|>  |>
|>  |>  OK, then please apply the patch.
|>  |>
|>  |>  Thanks,
|>  |>
|>  |>  jwe
|>  |>
|>  |>
|>  | Should "pstex" also be dropped? I believe it should be..
|>
|>  What do you mean by dropped?
|>
|>  jwe
|>
|
| Removed like epslatex and pslatex from the list of terminals that are
| treated with the gnuplot enhanced mode.

Yes, I think we should also not convert the TeX commands to /Symbols
for the pstex terminal.

jwe


Hi David, Shai, John,

After quite a while, I'm continuing this thread on the 'enhanced' text features in Octave.

I've recently tried this in Octave, and although it partially works, there are inconsistencies across terminals that aren't so nice. Let's see if I can summarize the desired behavior, then maybe start a discussion on the gnuplot developers list or figure out how we can make things more consistent in Octave. I don't think it would be too much extra effort to make this nice.

It appears Dave has attempted to implement interpreting Greek escape symbols, e.g., \alpha, \beta, \gamma, \lfloor, etc. where gnuplot 'enhanced' is limited to subscript, superscript, and a few others. Did you have success with this at the time Dave?

Let's use gnuplot X11 terminal as example. The subscript and superscript look fine. But what I see when using '\mu', '\alpha' are characters still in the Arabic character set. It seems that the right ascii number is coming through, but there isn't the proper font. Is this a problem with my system not having the Symbol font? Or is there something more general at issue? Recap:

1) Would it be nice to have gnuplot's "enhanced" mode more extensive so that is might interpret '\mu', '\lfloor' and so on? Or do you think Octave can handle that? X11 terminal is one of many terminals. Would Octave gnuplot backend know how to handle, say, png or jpeg terminals?


A second issue: As John pointed out, it seems logical to just let LaTeX (via gnuplot's output) interpret Octave TeX mode. Unfortunately, this doesn't work out as well as one would think. gnuplot doesn't have an "enhanced" option for its pslatex terminal (but maybe it should). The problem is that output created by Octave using the pslatex print styles doesn't compile. The reason is that escape commands like '\mu' and 'x^8' only work in LaTeX's math mode and currently neither Octave nor gnuplot put anything in math mode; that's something the user has always had to do manually. Example, say in Octave I run

plot([1:50], [1:50].^2);
xlabel('x');
ylabel('x^2');

All looks well on the X11 terminal.  However, if I now do

print('testing.tex', '-depslatexstandalone');

or any variant of the pslatex formats, LaTeX will issue an error about math mode concerning x^2 when compiling. Here are the Octave commands that will lead to code that compiles correctly:

plot([1:50], [1:50].^2);
xlabel('$x$');
ylabel('$x^2$');
print('testing.tex', '-depslatexstandalone');

Then the variable will be italic and the 2 as superscript. This inconsistency isn't nice to work with in Octave. I don't think we want the user to have to supply different text strings for different print options. SOOOO...what to do? Recap:

2) Should Octave handle placing $.$ math mode characters behind the scenes for pslatex family of output? Or would you like to see an 'enhanced' mode for gnuplot pslatex terminals? (I think I'd like the latter for consistency in gnuplot as well...could always use the 'noenhanced' option for finer control of LaTeX, but I think that would be a rare thing.) How should the LaTeX enhanced mode work? Should it interpret everything as in math mode? E.g., 'x^2' means $x^2$ for which the x comes out italic. Or something similar to X11? E.g., 'x^2' means $\mathrm{x}^2$ for which the x comes out non-italic?

As strange as it sounds, the latter might be more consistent with other 'enhanced' modes; or to rephrase, Octave TeX mode isn't exactly like LaTeX interpretation, but close. That's sort of a bummer to the nuanced LaTeX person, because one would have to use the 'none' mode and relabel using the $$ characters. But the idea is to make some form of compilable code in the default

print('testing.tex', '-depslatexstandalone');

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]