Repository navigation
Replies: 3 comments
|
A follow-up: the sequences are not GROOPS-specific — they are GMT escape sequences, and text that ends up in a plot is passed through to GMT unchanged. That also means the list is longer than the three above:
Suggested text for the documentation, as a subsection at the end of "Parsers and variables": \subsection{Text formatting in plots}\label{general.parser:plotFormat}
Text passed to the plot programs (titles, axis labels, legends) is forwarded to GMT unchanged — the parsers described above do not modify it. GMT escape sequences can therefore be used, the most common ones being:
\begin{itemize}
\item \verb|@~text@~|: switches to the Greek (Symbol) font, e.g. \verb|@~Dz@~| gives $\Delta\zeta$
\item \verb|@+text@+|: superscript, e.g. \verb|m/s@+2@+|
\item \verb|@-text@-|: subscript, e.g. \verb|W@-0@-|
\item \verb|@;color;text@;;|: font colour, by name or as \verb|r/g/b|
\item \verb|@:size:text@::|: font size
\item \verb|@.|: degree symbol, \verb|@@|: a literal \verb|@|
\end{itemize}
Note that \verb|@~| toggles the font rather than escaping a single character, so one pair covers several letters. The mapping follows the layout of the Symbol font and is not strictly alphabetical (\verb|c| gives $\chi$, \verb|q| gives $\theta$). For the complete list, including fonts, small caps, underline, accented and composite characters, see the GMT documentation of \verb|text|.One correction to my own description above: Source: GMT documentation of |
|
Hi Thomas, Thank you for the suggestion. As you’ve already said, these sequences are specific to GMT. I therefore think the ‘Parsers and variables’ documentation page is the wrong place for them. I’ve added a link to the relevant section of the GMT documentation in the plotting programmes. I hope you’re also happy with that. Best regards |
|
Hi Torsten, Best regards |
Uh oh!
There was an error while loading. Please reload this page.
(see German below)
Hi,
a second, unrelated suggestion — this one is about the "Parsers and variables" documentation page.
There are three formatting sequences that are useful in plot titles and axis labels, but that are not mentioned anywhere in the documentation:
@+text@+m/s@+2@+@-text@-W@-0@-@~c@~cbeing the corresponding Latin character@~a@~(α),@~d@~(δ),@~D@~(Δ)They are not handled by the parsers — I could not find them in
stringParser.cpp,expressionParser.cppordataVariables.cpp— so they are passed through unchanged and interpreted further down the chain. That is precisely why a short note would help: without it one does not know whether they are a GROOPS feature, where they are allowed, and where they will simply end up as literal text.The "Parsers and variables" page is where users look for this kind of thing, so it would be the natural place — as a separate subsection at the end, clearly set apart from the parser syntax itself:
Thanks and best regards
Thomas
Hallo,
ein zweiter Vorschlag, unabhängig vom ersten — hier geht es um die Dokumentationsseite „Parsers and variables".
Es gibt drei Formatierungssequenzen, die in Plottiteln und Achsenbeschriftungen nützlich sind, in der Dokumentation aber nirgends erwähnt werden:
@+text@+m/s@+2@+@-text@-W@-0@-@~c@~cist der entsprechende lateinische@~a@~(α),@~d@~(δ),@~D@~(Δ)Von den Parsern werden sie nicht behandelt — in
stringParser.cpp,expressionParser.cppunddataVariables.cpphabe ich sie nicht gefunden —, sie werden also unverändert durchgereicht und erst später interpretiert. Genau deshalb wäre ein kurzer Hinweis hilfreich: ohne ihn weiß man nicht, ob es sich um eine GROOPS-Funktion handelt, wo sie erlaubt ist und wo sie schlicht als Rohtext stehen bleibt.Die Seite „Parsers and variables" ist die Stelle, an der man so etwas sucht, und wäre damit der naheliegende Ort — als eigener Unterabschnitt am Ende, deutlich von der Parser-Syntax abgesetzt. Den Text-Vorschlag dazu ist im englischen Teil.
Danke und LG
Thomas
All reactions