[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #46037] bad Tex interpretation for gnuplot
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #46037] bad Tex interpretation for gnuplot |
Date: |
Sat, 26 Sep 2015 01:36:02 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0 |
Update of bug #46037 (project octave):
Category: Plotting => Plotting with gnuplot
Status: None => Confirmed
Summary: bad Latex interpretation => bad Tex interpretation
for gnuplot
_______________________________________________________
Follow-up Comment #1:
I think there are several problems going on here. This is one of the reasons
why Octave is slowly moving away from gnuplot.
First, a simpler example for me to use is
close all
graphics_toolkit gnuplot
ht = text (0.5, 0.5, '\bf Hello')
which produces the text
/-bold Hello
on the screen.
This is the correct syntax for versions of gnuplot < 5.0, but it seems that
gnuplot also wants the whole string enclosed by curly braces.
ht = text (0.5, 0.5, '{/-bold Hello}')
print tst.pdf
open tst.pdf
If I use the above code then the resulting printed output has bold text.
Whether the onscreen viewer will have bold text depends on the capabilities of
the terminal you are using.
So, it seems that things could be improved here if you are interested. The
code is contained in the m-file __gnuplot_draw_axes__.m. The function to
modify is __tex2enhanced__.
I think get_fontname_and_size needs to be changed to start with the
following.
function [f, s, fnt, it, bld] = get_fontname_and_size (t)
if (isempty (t.fontname) || strcmp (t.fontname, "*"))
fnt = "";
else
fnt = t.fontname;
endif
That way the fnt variable will expand to the null string in __tex2enhanced__
in
elseif (strncmp (f, "bf", 2))
bld = true;
if (it)
str = [str(1:s(i) - 1) '/' fnt '-bolditalic ' str(s(i) + 3:end)];
else
str = [str(1:s(i) - 1) '/' fnt '-bold ' str(s(i) + 3:end)];
endif
But there is still the problem of wrapping everything in curly braces.
For versions of gnuplot greater than 5.0 a different syntax may be necessary
according to this bug report (http://sourceforge.net/p/gnuplot/bugs/1240/).
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?46037>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/