From help-octave-request at bevo dot che dot wisc dot edu Fri Nov 14 05:46:28 2003 Subject: Re: fig output, ylabel and special flag From: Quentin Spencer To: Octave Mailing List Date: Fri, 14 Nov 2003 05:44:42 -0700 This is a multi-part message in MIME format. --------------010409020203010704000407 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 --------------010409020203010704000407 Content-Type: text/plain; name="gnuplot-3.7.3-fig.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gnuplot-3.7.3-fig.patch" *** 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", --------------010409020203010704000407-- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------