bugGNU Octave - Bugs: bug #51640, latex mode no longer works


bug #51640: latex mode no longer works

Submitted by:  Michael Godfrey <godfrey>
Submitted on:  Tue 01 Aug 2017 10:51:00 PM UTC  
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Wont Fix Assigned to:  None
Originator Name:  godfrey Open/Closed:  Closed
Release:  4.2.1 Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Sat 12 Aug 2017 11:32:59 PM UTC, comment #6:

I just ran your example and what worries me is that the
axis labels appear as, for example $P(\omega_2...$
(\omega can be recognized within Octave).
I thought that I had a way of handling this, but this was
quite a while ago. And, either my code had other problems or
it never got applied, or...

However, during the postprocessing any TeX related changes can
be made before running TeX to produce the final plot, so the
present state can be made to work for PDFs. And, it will be
good to have the documentation match what happens.

So, good to close this. When I can I will see if any improvements
can be made.

Michael Godfrey <godfrey>
Project Member
Sat 12 Aug 2017 10:57:03 PM UTC, comment #5:

I added a little bit more to the manual about how to form valid LaTeX strings (http://hg.savannah.gnu.org/hgweb/octave/rev/3b81ef7b562c).

Rik <rik5>
Project Administrator
Sat 12 Aug 2017 10:27:21 PM UTC, comment #4:

I found the issue which is that Octave no longer wraps text strings with '$' in latex interpreter mode. This was an architectural decision. Only the programmer knows which parts of a string should be set as regular text and which should be set in Math mode. Accordingly, Octave no makes no modifications and it is up to the programmer to construct a valid LaTeX string.

Here is an example:

I re-coded the example you sent and it works if I wrap the strings with '$'. I also explicitly set the interpreter to 'latex'. If the entire plot is going to use the latex interpreter it might be easier to set it as the default with

Here is the new code for your example:

I've attached both files as well.

I'm going to mark this as "Won't Fix" since we made the change for a good reason to give programmers more flexibility in how they want the output generated.

(file #41496, file #41497)

Rik <rik5>
Project Administrator
Thu 10 Aug 2017 12:27:49 PM UTC, comment #3:

The best I can do for a version that worked is the
dev that was current in March 2014. When I can
find time I will try to work on this since I wrote
some of the code. I am quite sure that the last fix
I submitted did work. The example below was used to
test it.

Michael Godfrey <godfrey>
Project Member
Thu 10 Aug 2017 12:58:15 AM UTC, comment #2:

What was the last version this worked on? I tried back to 3.8.3 and it doesn't appear to work. Also, I had to change "fn(1:7)" to "MyTitle" in order to get the code to run.

Rik <rik5>
Project Administrator
Tue 01 Aug 2017 11:48:46 PM UTC, comment #1:

I noticed that the current Manual inserts the $ ... $
around math symbols and expressions. So, the current
implementation may be as someone intended. But, this
does appear to prevent use of TeX math symbols in labels
and titles.

Michael Godfrey <godfrey>
Project Member
Tue 01 Aug 2017 10:51:00 PM UTC, original submission:
Michael Godfrey <godfrey>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #41496:  tst_latex.m added by rik5 (438B - text/x-matlab)
file #41497:  tst_latex2.m added by rik5 (201B - text/x-matlab)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by godfrey (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Sat 12 Aug 2017 10:27:21 PM UTC rik5 Attached File- => Added tst_latex.m, #41496
        Attached File- => Added tst_latex2.m, #41497
        StatusNone => Wont Fix
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.3