diff --git a/src/gmt_plot.c b/src/gmt_plot.c index 34cc79d5a2e..c5bc18c2e11 100644 --- a/src/gmt_plot.c +++ b/src/gmt_plot.c @@ -9250,6 +9250,13 @@ struct PSL_CTRL *gmt_plotinit (struct GMT_CTRL *GMT, struct GMT_OPTION *options) /* Place the panel tag, once per panel (if requested), then update the gmt.panel file to say we have been there */ if (strcmp (P->tag, "-")) { /* Place the panel tag */ int form, refpoint, justify; + + if (gmt_text_is_latex (GMT, P->tag)) { /* LaTeX commands, i.e., "....@[LaTeX...@[ ..." or "....LaTeX... ..." not supported in tags */ + /* See branch latex-in-subplot-tags. We get gs error when I tried to implement the standard solution inside the PSL_completion function. + * More work is needed to learn what goes wrong, probably by asking on the ghostscript help/support line. */ + GMT_Report (GMT->parent, GMT_MSG_WARNING, "Latex expressions are not (yet) supported as subplot panel tags - use text instead\n"); + goto no_latex_tags; + } refpoint = gmt_just_decode (GMT, P->refpoint, PSL_NO_DEF); /* Convert XX refpoint code to PSL number */ gmtlib_refpoint_to_panel_xy (GMT, refpoint, P, &plot_x, &plot_y); /* Convert just code to panel location */ /* Undo any offsets above that was required to center the plot on the subplot panel */ @@ -9296,6 +9303,7 @@ struct PSL_CTRL *gmt_plotinit (struct GMT_CTRL *GMT, struct GMT_OPTION *options) PSL_comment (PSL, "End of panel tag for panel (%d,%d)\n", P->row, P->col); PSL_command (PSL, "U\n}!\n"); } +no_latex_tags: /* Store first = 0 since we are done with -B and the optional tag */ if (gmt_set_current_panel (GMT->parent, GMT->current.ps.figure, P->row, P->col, P->gap, P->tag, 0)) return NULL; /* Should never happen */