[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Different font in first line of paragraph
From: |
Tadziu Hoffmann |
Subject: |
Re: [Groff] Different font in first line of paragraph |
Date: |
Sat, 18 Apr 2015 15:37:22 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
> is there a robust way to switch to a different font after
> the first line of a paragraph is adjusted? The example below
> comes close, but the first word of the second line of the
> paragraph is already typeset in the previous font.
> [snip]
You might try playing around with this:
.nr LL 6.5c \" desired line length
.nr IN 2.0c \" and indent
.ll \n(LLu
.in \n(INu
.de F1
.ev 1 \" switch to different environment
.ll \n(LLu \" set same line length and
.in \n(INu \" indent as in original environment
.di XX \" divert formatted text
.dt 1u F0 \" and trap anything that's output
.ft B \" set stuff in bold
.gcolor red \" and in red (just for fun)
..
.de F0
.di \" stop diverting
.ev \" back to original environment; any partially filled line
remains in environment 1
.in 0 \" set indent to zero for outputting diversion
.XX \" print diverted line (formatted text already has indent)
.ev 1 \" return to environment 1, which may hold a partially filled line
.di XX \" divert remaining text
.br \" flush partially filled line
.di \" stop diverting
.asciify XX \" and unformat the partial line
.ev \" back to original environment
.XX \" output partial line (reformat with settings of current
environment)
'in \" and restore original indent (but don't break at this point)
..
.F1
This is just an example paragraph.
It should be formatted in a different
font in the first line.
.br
(don't know if it's robust enough, though)
firstlinefont.pdf
Description: Adobe PDF document