bugGNU Octave - Bugs: bug #47907, TeX interpreter rgb color syntax...


bug #47907: TeX interpreter rgb color syntax not documented

Submitter:  None
Submitted:  Thu 12 May 2016 01:53:46 PM UTC
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Denis Sipchenko Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.2
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Tue 24 May 2016 06:51:01 PM UTC, comment #6: 

I documented the RGB color syntax on the stable branch in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/7496bd7265d9).  I've also pulled it across to the development branch.

Fixed, closing report.

Rik <rik5>
Group administrator
Fri 13 May 2016 03:41:42 PM UTC, comment #5: 

For completeness, the transparent legend issue mentioned here is bug #44765, which is fixed on the default branch (meaning it will be fixed in Octave 4.2.0). The TeX markup not printing is bug #42320, also fixed on the default branch. The ghostscript error in one of the OP's examples is probably due to the lack of handling of TeX markup and it interfering with postscript markup, when I drop the TeX syntax there is no error. In short, all fixed on the default branch for Octave 4.2.0.

Mike Miller <mtmiller>
Group Member
Fri 13 May 2016 03:04:43 PM UTC, comment #4: 

Octave follows Matlab syntax.  See http://www.mathworks.com/help/matlab/creating_plots/greek-letters-and-special-characters-in-graph-text.html.

I'm changing this bug report once again.  The new category is Documentation.  The section in the manual at 15.2.8 which describes the "interpreter" property needs updating.  It describes everything but the color and color[rgb] syntaxes.

There is another inaccuracy, at least on the dev branch, because the docs say that the special Tex symbols are only available onscreen, and not in printed results.  This has been fixed as well.

This is an easy modification suitable for anyone wanting to contribute to Octave.  The file to modify is doc/interpreter/plot.txi.  If someone can upload a changeset or diff Mike or I can review.

Rik <rik5>
Group administrator
Thu 12 May 2016 11:05:48 PM UTC, comment #3: 

Ok, I deduced from a combination of looking at the Octave TeX parser and the TeX xcolor package documentation


that the syntax that Octave supports for arbitrary RBG colors is this:

text (5, 5, '\color[rgb]{1 0 0}{Hello world}');

and this does work for me. The syntax used in the sample written by the OP seems wrong. So marking as works for me, leaving open for a few days for a response.

Mike Miller <mtmiller>
Group Member
Thu 12 May 2016 09:04:13 PM UTC, comment #2: 

\color{[1 0 0]}{Hello world}
TeX says:

! Undefined color `[1 0 0]'.
\@latex@error #1#2->\errhelp {#2}\errmessage {#1}

\@declaredcolor ...olor @#1\endcsname \set@color }
l.8 \color{[1 0 0]}
                   {Hello world}')

There is not much chance that Matlab compatibility is
involved here, so...

Michael Godfrey <godfrey>
Group Member
Thu 12 May 2016 06:45:41 PM UTC, comment #1: 

Thanks for your bug report. For the future, bug reports that contain multiple issues are hard to deal with, it is much better and easier for us if separate issues are reported individually. I'll do my best to address these.

1. I think this is a known problem, looks exactly like bug #44338. Thanks for confirming.

2. Your submitted files show that bold works, but your color syntax doesn't work, that may be a bug.

The following syntax does work

plot (1:10); legend ('\color{red}{\bf a line}');

if that is a viable workaround for you.

3. I don't see any transparency, it looks like a solid legend box to me with no visible grid lines. Am I reading this wrong or looking at the attached image wrong?

So I'm retitling this to the single remaining issue, that appears to be a TeX color syntax that doesn't work.

I'm not TeX expert, so bowing out now, but here are a couple of simple examples.

This works in Octave

axes ()
axis ([0, 10, 0, 10]);
text (5, 5, '\color{red}{Hello world}');

But the following does not work, using the syntax provided by the OP in this bug report.

axes ()
axis ([0, 10, 0, 10]);
text (5, 5, '\color{[1 0 0]}{Hello world}');

Is this valid TeX syntax? Is this syntax supported by Octave?

Mike Miller <mtmiller>
Group Member
Thu 12 May 2016 01:53:46 PM UTC, original submission:  

1) Don't save invisible figures ('visible', 'off'), like in MATLAB
2) legend - tex interpreter stylished text not saved
3) legend - saved with transparent color (visible gridlines under text)

Simple CODE example  and OUTPUT in attachment

close all, clear all
fh=figure(1, 'position',[111,111,777,333],'visible', 'on');

plot(1:n, magic(n),'.-'), grid on
print(fh,'RefrenceOk', '-dpng','-S777,333')

% PROBLEMS =====================================================================

%% 1) Don't save invisible figures, like in MATLAB (bug1log.txt)----------------
%% Affected functions: print, saveas
%% Log files: bug1log.txt
set(fh, 'visible', 'off');
print(fh,'visibleOff', '-dpng','-S777,333')

%% 2) Don't save figures with following legend ---------------------------------
%% Affected functions: print, saveas
%% Log files: bug2log.txt, bug2estimated.png
%%    2.1 c
%%    2.2 Sometimes, if picture saved succesfully:
%%        2.2.1 legend saved with transparent color (visible gridlines under text)
%%        2.2.2 tex interpreter stylished text not saved
  {'1)(\bf print, saveas}: can''t save legend with OPAQUE background  color (grid is visible) ' ...
  ,'2){\bf print, saveas}: don''t save stylish text (by tex interpreter) ' ...
  ,'3)\color{[1 0 0]}{\bf tex interpreter don''t work with colors:} this text estimated in red ' ...
  ,'4)\bf4th' ...
set(lh,'color',[.8 .8 .8])
print(fh,'RefrenceOk', '-dpng','-S777,333')



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

Attach Files:

Attached Files
file #37141:  BugPackReport.zip added by None (22KiB - application/x-zip-compressed)


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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 18 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-26 mtmiller Carbon-CopyRemoved 80942 -
    2016-05-24 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2016-05-13 mtmiller Dependencies- Depends on bugs #45301
    2016-05-13 mtmiller Dependencies- Depends on bugs #42320
    2016-05-13 mtmiller Dependencies- Depends on bugs #44338
    2016-05-13 mtmiller Dependencies- Depends on bugs #44765
    2016-05-13 rik5 SummaryTeX rgb color syntax not handled TeX interpreter rgb color syntax not documented
    2016-05-13 rik5 Item GroupIncorrect Result Documentation
        StatusWorks For Me Confirmed
    2016-05-13 rik5 CategoryPlotting with OpenGL Documentation
    2016-05-12 mtmiller StatusNeed Info Works For Me
    2016-05-12 mtmiller CategoryPlotting Plotting with OpenGL
        Item GroupSegfault, Bus Error, etc. Incorrect Result
        StatusNone Need Info
        Operating SystemMicrosoft Windows Any
        SummaryPlot with tex legend TeX rgb color syntax not handled
    2016-05-12 None Attached File- Added BugPackReport.zip, #37141

    Back to the top

    Powered by Savane 3.13-3cd0.
    Corresponding source code