Hi Oliver,

At 2024-11-10T09:18:53+0100, Oliver Corff wrote:
> You mention the superscripts for charges, this is something I tried to
> include in my first attempt yesterday but somehow the minus sign was
> taken as part of the vertical offset calculation instead of being taken
> as a character. Most problably I'm making a silly mistake here.

Quoting the document you shared earlier:[1]

.ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
.ds par@sup-end \v'-.7m\s0+.9m'
.ds par@sub-start \v'+.3m\s'\En[.s]*7u/10u'-.1m'
.ds par@sub-end \v'+.1m\s0-.3m'

These definitions don't look quite right to me.  The \v escape sequence
accepts only a single measurement within delimiters, not a series of
motions.

I spotted two problems:

1.  missing closing delimiters for the first vertical motion escape
    sequence
2.  lack of vertical motion escape sequence syntax at the right ends of
    these string definitions

I haven't tried the following, but you might want to.

.ds par@sup-start \v'-.9m'\s'\En[.s]*7u/10u'\v'+.7m'
.ds par@sup-end \v'-.7m'\s0\v'+.9m'
.ds par@sub-start \v'+.3m'\s'\En[.s]*7u/10u'\v'-.1m'
.ds par@sub-end \v'+.1m'\s0\v'-.3m'

It might be easier during the construction phase of such eye-watering
chains of escape sequences to write them out with spaces separating them
initially, and then take the spaces out when you're done composing them.

Alternatively, write a macro to do this sort of "chaining" for you.

.de CHAIN
.  ds \\$1 \\$2\\$3\\$4\\$5\\$6
..
.CHAIN par@sup-start \v'-.9m' \s'\En[.s]*7u/10u' \v'+.7m'

Just a spitball idea.  (A more flexible version taking an arbitrary
number of arguments could be written with `while`, `shift`, and `as`.)

Regards,
Branden

[1] https://lists.gnu.org/archive/html/groff/2024-11/msg00084.html

Attachment: signature.asc
Description: PGP signature

Reply via email to