[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [mom] CAPTION_AFTER _LABEL ignores alignment rules
From: |
Peter Schaffter |
Subject: |
Re: [mom] CAPTION_AFTER _LABEL ignores alignment rules |
Date: |
Tue, 20 Feb 2024 14:35:15 -0500 |
On Tue, Feb 20, 2024, MB2759 via wrote:
> New user here, finding my way around groff and mom. Captions are
> working fine for me unless I use the CAPTION_AFTER_LABEL option in
> which case alignment and other formatting options are ignored.
Congrats, you found a genuine bug. I am preparing to push and
upload mom 2-6_c, which will include a fix for the caption alignment
bug, probably before the end of the week. If you're in a terrific
hurry, contact me privately and I will provide a patch. Otherwise,
I'll announce the release on the list.
> Here is a minimum working example:
Since you're new to mom, I have some advice concerning your example.
Avoid using blank lines to separate text in mom source files. Put a
period (dot) by itself at the beginning of the blank line instead.
> .DOCTYPE BOOK
There is no DOCTYPE BOOK. Use either DEFAULT for non-chaptered
documents or CHAPTER for chapters of a book. (DEFAULT is the default
and can be omitted if this is what you want.)
> .PDF_IMAGE myimage.pdf 5c 5c \
> CAPTION "This is the long figure caption." \
> SHORT_CAPTION "Short caption."
While the caption bug is real and will be fixed, your usage here
is a little odd. In the absence of an image LABEL, supplying only
a CAPTION (above or below the image) means that the image is not
included in the List of Figures, which uses LABEL to establish
entries. Furthermore, SHORT_CAPTION is only used in conjunction
with LABEL (in the List of Figures); if there's no label, there's no
short caption either.
If you don't need a List of Figures, your usage does what
you want (or will), but a better way to accomplish it is by using
the LABEL argument instead of CAPTION, styling the label to match
captions.
.LABELS IMG FONT R
.PDF_IMAGE myimage.pdf 5c 5c \
LABEL "Label that looks like a caption."
The output will have the LABEL text underneath the image, as
expected (even though here it serves as a caption) and the image
will appear in the List of Figures as "Label that looks like a
caption."
--
Peter Schaffter
https://www.schaffter.ca