[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [groff] Problems redefining macro $c for -me macros
From: |
Steffen Nurpmeso |
Subject: |
Re: [groff] Problems redefining macro $c for -me macros |
Date: |
Sat, 02 Dec 2017 23:47:38 +0100 |
User-agent: |
s-nail v14.9.5-35-g0ff8866f |
Hey.
Stephanie Björk <address@hidden> wrote:
|For quite a bit, I've been trying to redefine the .$c macro for the -me
|macros. According to the reference manual, the macro package allows the
|user to redefine how chapters look when they get printed, by redefining
|that macro.
|
|Here's my redefinition. In the original file, I added no comments, but I
|will add them now just to make things clearer as to what I'm doing.
|
|.de $c
|. bp
|. nr ch +1 \" Increment chapter number count
|. nr eq 0 1 \" Set equation number to 0, with auto-inc of 1.
|. ft \\n[sf] \" Same font as section font
|. ps \\n[sp] \" Same size as section font
|. ce 1000
|. if \\n(_M=1 Chapter \\n(ch \" If it's a chaptered content, print
|chapter number
|
|\\$1 \" Print the chapter name
|. ce 0
|. sp 2v
|..
|
|The problem is that my macro redefinition gets ignored and an error is
|thrown:
|
|main.me:23: name expected (got `\&')
Please, first: i must admit i am standing in no man's land and
found it out only by trial and error.
It seems that the eqn preprocessor does not like that you use .EQ
.. .EN before that ".de $c". If you move that .EQ .. .EN
downwards then anything is fine. Except for placement of page
numbers, the fonts i do not know about, and the ".fam" requests
without argument provoke a division by zero error. Despite all
that it seems to solve the problem.
Oh, surprisingly (eqn is for mathematicians!): using the eqn
"delim" request with dollars seems to start an inline equation for
".de $c"! You can use the -N eqn command line option to prevent
crossing newline boundaries, but i am, you recognize this?, acting
beyond my current capabilities. It seems to me eqn(1) should not
interpret data on command lines as inline equations? No, this
cannot be a solution either, think of equations as part of
chapter names... No, as inelegant as it is, it seems you must
ensure that the dollar $ delimiter becomes activated after you
have adjusted the me macros.
Staying alive on a saturday night maybe,
Ciao!
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)