Skip to content

Commit

Permalink
doc: Fix typos in text docs (#8671)
Browse files Browse the repository at this point in the history
* doc: Fix typos in text docs

* More updates

---------

Co-authored-by: Remko Scharroo <[email protected]>
  • Loading branch information
seisman and remkos authored Jan 6, 2025
1 parent d9a447e commit 5d1f571
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
28 changes: 16 additions & 12 deletions doc/rst/source/text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ Optional Arguments
[0/0]. If *dy* is not specified then it is set equal to *dx*. Prepend
an optional directive:

- **-j** - Offset the text away from the point instead (i.e., the
- **j** - Offset the text away from the point instead (i.e., the
text justification will determine the direction of the shift).
- **-J** - Shorten diagonal offsets at corners by :math:`\sqrt{2}`.
- **J** - Shorten diagonal offsets at corners by :math:`\sqrt{2}`.

Optionally, append the modifier:

Expand All @@ -196,25 +196,29 @@ Optional Arguments
at the Upper Left corner of the map.
- **+f** - Set the font ([*size*][,\ *fontname*][,\ *color*]); if no font info
is given then the input file must have this information in one of its columns.
- **+h** - Use the most recent segment header as the text to be plotted.
comes from the data record. Instead, use **+h** or **+l** to select the
- **+j** - Set the text justification; if no justification is given then the input
file must have this item as a column.

Normally, the text is read from the data records. Alternative ways to provide text:

- **+h** - Use the most recent segment header as the text to be plotted.
- **+l** - Use the most recent segment label as the text to be plotted.
- **+r** - Use the record number (counting up from *first* [0]) as the text to be plotted.
- **+t** - Use the appended *text* to set a fixed text string (if *text* contains plus
characters then the **+t** modifier must be the last modifier in |-F|).
- **+z** - Format incoming *z* values to a string using the supplied *format*
[if not appended we use :term:`FORMAT_FLOAT_MAP`].

**Notes**: (1) If |-Z| is in effect then the *z* value used for formatting is in the
4th, not 3rd column. If you only want a specific word from the trailing text and
not the whole line, use **-it**\ *word* to indicate which word (0 is the first word)
you want. (2) Items read from the data file should be in the same order as
the modifiers are specified with the |-F| option. Example:
**-F**\ **+f**\ 12p,Helvetica-Bold,red\ **+j+a** selects a 12p red
Helvetica-Bold font and expects to read the justification and angle
from the file, in that order, after *x* *y* and before *text*.
**Notes**: |-F|\ **+h**\|\ **l**\|\ **r**\|\ **t**\| **z** can't be used with |-M|.

**Notes**: (1) If |-Z| is in effect then the *z* value used for formatting is in the
4th, not 3rd column. If you only want a specific word from the trailing text and
not the whole line, use **-it**\ *word* to indicate which word (0 is the first word)
you want. (2) Items read from the data file should be in the same order as
the modifiers are specified with the |-F| option. Example:
**-F**\ **+f**\ 12p,Helvetica-Bold,red\ **+j+a** selects a 12p red
Helvetica-Bold font and expects to read the justification and angle
from the file, in that order, after *x* *y* and before *text*.

.. _-G:

Expand Down
2 changes: 1 addition & 1 deletion src/pstext.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ static int parse (struct GMT_CTRL *GMT, struct PSTEXT_CTRL *Ctrl, struct GMT_OPT
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->M.active, "Option -Gc: Cannot be used with -M.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->W.active, "Option -Gc: Cannot be used with -W.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->D.line, "Option -Gc: Cannot be used with -D...v<pen>.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->M.active && Ctrl->F.get_text, "Option -M: Cannot be used with -F...+l|h.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->M.active && Ctrl->F.get_text, "Option -M: Cannot be used with -F...+l|h|r|t|z.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->S.active && !(Ctrl->G.active && Ctrl->G.mode == 0), "Option -S: Requires -G as well.\n");
n_errors += gmt_M_check_condition (GMT, strchr ("cC", Ctrl->C.mode) && !Ctrl->M.active, "Option -C: Box shape mode +tc|C is only available when -M is selected.\n");

Expand Down

0 comments on commit 5d1f571

Please sign in to comment.