changeset 26935:d17eecaf4a14

Don't issue warning about unsupported latex when printing with -dpdflatexstandalone (bug #55946). * warning_ids.m: Document new warning ID "Octave:text_interpreter". * print.m: Disable warning "Octave:text_interpreter" temporarily using "local" argument when printing to a latex format. * __gnuplot_draw_axes__.m (do_tics_1, __maybe_munge_text__): Check warning state of "Octave:text_interpreter" before issuing a warning about either axes ticklabels or text objects using the latex interpreter.
author Rik <rik@octave.org>
date Mon, 18 Mar 2019 10:33:38 -0700
parents 1771bed38482
children 72fab319b47d
files scripts/help/warning_ids.m scripts/plot/util/print.m scripts/plot/util/private/__gnuplot_draw_axes__.m
diffstat 3 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/help/warning_ids.m	Fri Mar 15 22:34:55 2019 +0100
+++ b/scripts/help/warning_ids.m	Mon Mar 18 10:33:38 2019 -0700
@@ -195,6 +195,13 @@
 ## @item Octave:glyph-render
 ## By default, the @code{Octave:glyph-render} warning is enabled.
 ##
+## @item Octave:text_interpreter
+## If the @code{Octave:text_interpreter} warning is enabled, a warning is
+## printed when the @qcode{"interpreter"} property of a text graphics object
+## is set to the unsupported value of @qcode{"latex"}.  Even when enabled,
+## the warning message is printed just once per Octave session.
+## By default, the @code{Octave:glyph-render} warning is enabled.
+##
 ## @item Octave:imag-to-real
 ## If the @code{Octave:imag-to-real} warning is enabled, a warning is
 ## printed for implicit conversions of complex numbers to real numbers.
--- a/scripts/plot/util/print.m	Fri Mar 15 22:34:55 2019 +0100
+++ b/scripts/plot/util/print.m	Mon Mar 18 10:33:38 2019 -0700
@@ -659,6 +659,9 @@
     ## When exporting latex files use "latex" for the ticklabelinterpreter.
     ## It will format tick labels in log axes correctly
     if (strfind (opts.devopt, "latex"))
+      ## Disable warnings about Latex being unsupported since Octave will be
+      ## passing Latex code directly to interpreter with no rendering.
+      warning ("off", "Octave:text_interpreter", "local");
       h = findall (opts.figure, "type", "axes");
       for n = 1:numel (h)
         if (ishghandle (h(n)))
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m	Fri Mar 15 22:34:55 2019 +0100
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m	Mon Mar 18 10:33:38 2019 -0700
@@ -2254,8 +2254,12 @@
     endfor
   elseif (strcmp (interpreter, "latex"))
     if (! warned_latex)
-      warning ("latex markup not supported for tick marks");
-      warned_latex = true;
+      do_warn = (warning ("query", "Octave:text_interpreter")).state;
+      if (strcmp (do_warn, "on"))
+        warning ("Octave:text_interpreter",
+                 "latex markup not supported for tick marks");
+        warned_latex = true;
+      endif
     endif
   endif
   if (strcmp (scale, "log"))
@@ -2421,8 +2425,12 @@
       endif
     elseif (strcmp (ntrp, "latex"))
       if (! warned_latex)
-        warning ("latex markup not supported for text objects");
-        warned_latex = true;
+        do_warn = (warning ("query", "Octave:text_interpreter")).state;
+        if (strcmp (do_warn, "on"))
+          warning ("Octave:text_interpreter",
+                   "latex markup not supported for text objects");
+          warned_latex = true;
+        endif
       endif
     endif
   endif