help-octave
[Top][All Lists]
Advanced

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

Re: fig output, ylabel and special flag


From: Quentin Spencer
Subject: Re: fig output, ylabel and special flag
Date: Fri, 14 Nov 2003 05:44:42 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030918

cctsim wrote:

On Thursday 13 November 2003 06:28, Quentin Spencer wrote:
cctsim wrote:
Hi all,

If I use the script below to create a .fig file
I noticed that the special flag for further
tex processing is not set for the string used
in ylabel. However, it is set for the string in xlabel.
The same happens for legend from octave-forge.
Do I miss something?
I noticed this also. It appears that the gnuplot maintainers changed
this in one of their recent releases. The comment in the code says that
the intention was to flag the string as special only if it had "\"
characters in it, rather than to flag all strings as it did before. The
problem with this approach is that it ignores other LaTeX things like
"$" to put it in math mode. This bothered me enough to download the
source and comment out the one line of code that does this to put it
back to its previous functionality. If you're interested I have a patch
and a updated RPM for RedHat 9.

-Quentin

The patch would be fantastic, thanks.
You were wright about the extra "\":

ylabel('$\\x(t)$')

It sets the special flag but then again you have to go the extra
mile and remove manually the "\" inside xfig.

Many thanks in advance.
I have attached a patch to the gnuplot 3.7.3 sources that forces all strings to be flagged as special. As you can see, it is accomplished by commenting out one line. An alternative solution would be to also test for the presence of '$' characters, but I like it better this way. With this patch, you can remove the '\\' from your ylabel command and you won't have to go into xfig to change it. I haven't reported the problem to the gnuplot maintainers yet. Judging from the gnuplot web page, they aren't nearly as accessible as the octave maintiners.

I hope this helps.

-Quentin
*** gnuplot-3.7.3/term/fig.trm.bak      2003-09-03 17:34:35.000000000 -0600
--- gnuplot-3.7.3/term/fig.trm  2003-09-03 17:35:16.000000000 -0600
***************
*** 641,647 ****
       * is only really needed if str contains LaTeX commands. we assume that
       * a string contains LaTeX commands if it contains a backslash.
       */
!     if (strchr(str,'\\'))
        has_latex_command = SPECIAL_TEXT;
  
      fprintf(gpoutfile, "%d %d %d %d %d %d %6.3f %6.3f %d %6.3f %6.3f %d %d 
%s\\001\n",
--- 641,647 ----
       * is only really needed if str contains LaTeX commands. we assume that
       * a string contains LaTeX commands if it contains a backslash.
       */
! //    if (strchr(str,'\\'))
        has_latex_command = SPECIAL_TEXT;
  
      fprintf(gpoutfile, "%d %d %d %d %d %d %6.3f %6.3f %d %6.3f %6.3f %d %d 
%s\\001\n",

reply via email to

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