tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* ".TS H" macro
@ 2021-03-28 11:23 Kristaps Dzonsons
  2021-03-28 11:30 ` Kristaps Dzonsons
  0 siblings, 1 reply; 3+ messages in thread
From: Kristaps Dzonsons @ 2021-03-28 11:23 UTC (permalink / raw)
  To: tech

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

Hi!

A recent issue for lowdown[1] noted the existence of ".TS H", which 
allows for multi-page PDF TS/TE tables.  These don't affect mandoc, 
where the PDF tables aren't great anyway (that's my fault from way long 
ago), so using ".TS H" instead of ".TS" is ignored and fine.

The problem is that this introduces a new macro to signal the end of the 
table header, which groff will re-issue at the start of a new page.  And 
of course, the macro is ".TH".

.TH "Untitled article" "7" ""
.TS H
tab(|) expand allbox;
lb lb
l l.
T{
app
T}|T{
quality
T}
.TH
T{
foo
T}|T{
bar
T}
.TE

In mandoc, the subsequent ".TH" overrides the main document's ".TH", so 
the title and stuff shows up as empty.

I've included a patch that has the TH parser bail if it already 
encounters a title.  This passes "make regress", but it may be more 
appropriate to check if it's in a TS/TE context.

Best,

Kristaps

[1]
https://github.com/kristapsdz/lowdown/issues/65

[-- Attachment #2: mandoc.TS.patch --]
[-- Type: text/x-patch, Size: 496 bytes --]

Index: man_validate.c
===================================================================
RCS file: /home/cvs/mdocml/mandoc/man_validate.c,v
retrieving revision 1.155
diff -u -p -u -r1.155 man_validate.c
--- man_validate.c	30 Oct 2020 13:24:33 -0000	1.155
+++ man_validate.c	28 Mar 2021 11:21:33 -0000
@@ -475,6 +475,9 @@ post_TH(CHKARGS)
 	struct roff_node *nb;
 	const char	*p;
 
+	if (man->meta.title != NULL)
+		return;
+
 	free(man->meta.title);
 	free(man->meta.vol);
 	free(man->meta.os);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-28 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-28 11:23 ".TS H" macro Kristaps Dzonsons
2021-03-28 11:30 ` Kristaps Dzonsons
2021-03-28 18:46   ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).