octave-patch-tracker
[Top][All Lists]
Advanced

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

[Octave-patch-tracker] [patch #9129] wish: rewrite __tex2enhanced__() of


From: Dan Sebald
Subject: [Octave-patch-tracker] [patch #9129] wish: rewrite __tex2enhanced__() of __gnuplot_draw_axes__.m to add color processing
Date: Sun, 2 Oct 2016 20:50:07 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

URL:
  <http://savannah.gnu.org/patch/?9129>

                 Summary: wish: rewrite __tex2enhanced__() of
__gnuplot_draw_axes__.m to add color processing
                 Project: GNU Octave
            Submitted by: sebald
            Submitted on: Sun 02 Oct 2016 08:50:01 PM GMT
                Category: Core : other
                Priority: 1 - Later
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Currently gnuplot toolkit doesn't handle the "\color" TeX keyword to change
color of individual items within a string.  However, it is possible to mimic
such a thing in a roundabout way.  gnuplot enhanced text has a space command
for which a string will not be displayed, but the point position advanced. 
For example &{string so wide} will leave a blank space that "string so wide"
would occupy.  With such a feature, it is possible to break a string into a
series of strings.  Say that we want "Bold and Italic markup" to have "Bold"
in red and "Italic" in green.  We could do it as follows:


set label 30 tc rgb "#BB0000" at -.9, 0.0 "{/:Bold Bold}"
set label 31 at -.9, 0.0 "&{/:Bold Bold} and"
set label 32 tc rgb "#00BB00" at -.9, 0.0 "&{{/:Bold Bold} and} {/:Italic
Italic}"
set label 33 at -.9, 0.0 "&{{/:Bold Bold} and {/:Italic Italic}} markup"


So, in theory, the __tex2enhanced__() routine could return a cell of strings
along with color RGBs that can be used to create the associated gnuplot label
code.

Trying to do such a thing, I looked at the __tex2enhanced__() code and began
to wonder if it couldn't be done easier with a recursive routine.  For
example, currently there is a first pass to process the TeX codes, then a
second pass to inject "@" for alignment.  Perhaps it might be easier if
__tex2enhanced__() called itself when it finds another opening bracket.  Seems
it should be, in my experience.

So the patch would be to redo __tex2enhanced__ for more simplicity and general
handling of embedded \code{\code{\code{}}} sorts of syntax.  At the same time,
create a series of strings for each color change.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?9129>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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