groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] Problems redefining macro $c for -me macros


From: Stephanie Björk
Subject: [groff] Problems redefining macro $c for -me macros
Date: Sat, 2 Dec 2017 22:41:04 +0700

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 `\&')

Still a bit confused.  I have looked at Groff's tmac folder to see how .$c
was originally defined, and I can just see that it's just about the same as
I am doing it.

The goal to be achieved here is to get the chapter font and point size the
same as sections' font:
https://i.imgur.com/rmbpAku.png

Here is the complete source file in case one would like to see my use case:
https://github.com/katt64/khan-academy-memo/blob/master/main.me

Thanks a lot,
Stephanie B.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]