groff
[Top][All Lists]
Advanced

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

Re: [Groff] Bulleted number - How to do???


From: andlabs
Subject: Re: [Groff] Bulleted number - How to do???
Date: Thu, 20 Sep 2007 07:22:18 -0700 (PDT)

I figured out how to do it using the drawing commands:

\kx\D'c 1.5'\h'|\nx'  \v'.25m'1\v'-.25m'

Here is what each part does:

\kx - Mark horizontal position
\D'c 1.5' - Draw a circle 1.5 units in radius
\h'|\nx' - Go back to the marked position (| makes it absolute)
The two spaces move to the center of the circle
\v'.25m' - Go down 1/4 em; this centers the 1
\v'-.25m' - Go back up 1/4 em; this restores the vertical position

For two digits, just use one space.

For example, try this:

$ troff | grops > x.ps
\kx\D'c 1.5'\h'|\nx'  \v'.25m'1\v'-.25m'
.bp
\kx\D'c 1.5'\h'|\nx' \v'.25m'10\v'-.25m'
(ctl-d)
$


Ruediger Haertel wrote:
> 
> Hello Werner,
> 
> thank you for your assistence. I added this to the groff wiki.
> 
> http://www.groff-wiki.info/groff/BulletedNumbers
> 
> Am Freitag 03 August 2007 11:00:56 schrieben Sie:
>> > I am in the need of bulleted numbers, ie. a filled circle with a
>> > number in it.  Imortant to me is, that I can use such a bulleted
>> > numer every where in floating text. But it is not necessary to have
>> > it in a table for now.
>> >
>> > Three possible solutions came to mind:
>> > a) a font with special glyphs of this kind
>>
>> Some Chinese fonts have this up to 100.  Normally very ugly.
>>
>> > b) pic
>>
>> This can't produce inline images.
>>
>> > c) postscript
>>
>> This works.  See below.
>>
>>
>>     Werner
>>
>>
>> ======================================================================
>>
>>
>> .\" The radius of the circle used in `ci' macro.
>> .\"
>> .ds ci-radius 0.8m
>> .
>> .
>> .\" .ci <text>
>> .\"
>> .\" Emit <text>, written in white and centered within a red circle.
>> .\"
>> .de ci-end
>> ..
>> .
>> .de ci
>> .  ds ci-text \\$1\"
>> .  nr ci-width \w'\\$1'
>> .  nr ci-height \\n[rst]
>> .  nr ci-depth \\n[rsb]
>> .  nr ci-rad \\*[ci-radius]
>> .
>> .  de ci-ps ci-end
>>      ps: exec
>>        % move to circle center
>>        \\n[ci-rad] u
>>          \\n[ci-height] u \\n[ci-depth] u add 2 div neg
>>            rmoveto
>>        gsave
>>          % shift origin to current point temporarily
>>          currentpoint translate
>>          1 0 0 setrgbcolor
>>          0 0 \\n[ci-rad] u 0 360 arc
>>          fill
>>          1 1 1 setrgbcolor
>>          % move to start of text string
>>          \\n[ci-width] u 2 div neg
>>            \\n[ci-height] u \\n[ci-depth] u add 2 div
>>              moveto
>>          (\\*[ci-text]) show
>>        grestore
>> .  ci-end
>> .
>> \Y[ci-ps]\h'2u*\\n[ci-rad]u'
>> ..
>>
>>
>>
>> blah blah blah
>> .ci 2
>> blubb blubb blubb
>>
>> .ps 30
>> .vs 36
>> blah blah blah
>> .ci 12
>> blubb blubb blubb
> 
> 
> 
> -- 
> with best regards / salutations distinguées / Cordiali Saluti /
> med vänliga hälsningar / mit freundlichen Gruessen
> 
> Ruediger Haertel
> 
> +===========================================================
> | port GmbH               phone +49 345 77755-0
> | D-06132 Halle/Saale     mailto:address@hidden
> | Germany                 http://www.port.de
> | CAN Wiki                http://www.CAN-Wiki.info/
> | Ethernet Powerlink      http://www.epl-tools.com
> | Newsletter:             http://www.port.de/register.html
> +===========================================================
> port Gesellschaft für computergestützte Automation mbH;
> Geschäftsführer: Heinz-Jürgen Oertel;
> Sitz der Gesellschaft: Halle/Saale;
> Registergericht Sachsen-Anhalt Stendal HRB 212667 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Bulleted-number---How-to-do----tf4199494.html#a12798260
Sent from the Groff - General mailing list archive at Nabble.com.





reply via email to

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