Skip to content

Until solved, disallow subplot tags with Latex #8018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/gmt_plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "....<math>LaTeX...</math> ..." 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 */
Expand Down Expand Up @@ -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 */
Expand Down