discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: "Anthony J. Bentley" <anthony@cathet.us>
Cc: discuss@mdocml.bsd.lv
Subject: Re: \u and \d
Date: Thu, 26 Dec 2013 00:04:58 +0100	[thread overview]
Message-ID: <20131225230458.GE21163@iris.usta.de> (raw)
In-Reply-To: <CAFRrxyk1ku3v_kUqO55=s16FE1tLx8MkRwzNx1feVpkoUsy=Yg@mail.gmail.com>

Hi Anthony,

Anthony J. Bentley wrote on Thu, Dec 05, 2013 at 11:58:55PM -0700:

> \utest\d
> 
> Displays "test" in groff. In mandoc, it displays "utestd". I have no
> idea what special formatting these escapes are meant to trigger (maybe
> superscripts via 'u'p and 'd'own?),

Yes, they are shorthands for \v'0.5v' and \v'-0.5v', respectively,
i.e. moving half a line up or down; not necessarily for super- and
subscripts, though: if you want to change the font size, you have
to do that in addition to \u and \d, as in the example you cite
below:

> \m[blue]\fBthe issue tracker\fR\m[]\&\s-2\u[5]\d\s+2\&

They are documented in the Ossanna/Kernighan/Ritter Heirloom Troff Manual

  http://heirloom.sourceforge.net/doctools/troff.pdf

and also in the Groff Manual,

  http://www.gnu.org/software/groff/manual/html_node/Page-Motions.html

> but they should be at least ignored if they aren't implemented.

Sure, they cannot be implemented for -Tascii, but they can be ignored.

I just committed the following patch to bsd.lv and OpenBSD.

Thanks for reporting,
  Ingo


Date: Wed, 25 Dec 2013 17:45:33 -0500 (EST)
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Parse and ignore the roff(7) escape sequences \d ...

Log Message:
-----------
Parse and ignore the roff(7) escape sequences \d (move half line down)
und \u (move half line up).  Found by bentley@ in some DocBook crap.

Modified Files:
--------------
    mdocml:
        mandoc.c

Revision Data
-------------
Index: mandoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -Lmandoc.c -Lmandoc.c -u -p -r1.71 -r1.72
--- mandoc.c
+++ mandoc.c
@@ -102,6 +102,14 @@ mandoc_escape(const char const **end, co
 		break;
 
 	/*
+	 * Escapes taking no arguments at all.
+	 */
+	case ('d'):
+		/* FALLTHROUGH */
+	case ('u'):
+		return(ESCAPE_IGNORE);
+
+	/*
 	 * The \z escape is supposed to output the following
 	 * character without advancing the cursor position.  
 	 * Since we are mostly dealing with terminal mode,
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2013-12-25 23:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06  6:58 Anthony J. Bentley
2013-12-25 23:04 ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131225230458.GE21163@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=anthony@cathet.us \
    --cc=discuss@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).