groff
[Top][All Lists]
Advanced

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

Re: [Groff] Adding printer's marks to documents


From: Tadziu Hoffmann
Subject: Re: [Groff] Adding printer's marks to documents
Date: Tue, 30 Dec 2008 14:55:30 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

> Trying to add printer's marks to my roff documents. I stumbled
> across groff's graphics commands, but all of them start from
> current location and I did not find a command to move the
> current location to an arbitrary position.
> 
> Is there any way to add those marks to a groff source or do I
> have to add postscript code via \X'ps: <I'm lost here>'?

Doing this in Postscript gives you more control over
the appearance, but it (obviously) limits you to using
the postscript device.  However, you can set it up using a
begin-page procedure as described in the grops manual page,
without otherwise having to work this into your macros to
get triggered for every page.

For using groff's line-drawing commands, here is a crude example.

Note that you can move to an absolute vertical position on
the page using "\v'|xxx'", but the horizontal analogue moves
you to an absolute position on the *input line*, not on the
page (this is a concept you have to get used to). That's why
in the example below the left edge of the text is used as
reference position.


.\"
.\" ----------------------------------------------------------------
.nr TC 1.2c \" from top edge of paper
.nr LC 1.5c \" from left edge of text
.nr RC 19c  \" desired width
.nr BC 27c  \" desired height
.nr MC .5c  \" length of cut mark
.nr DC .2c  \" registration tolerance
.\" ----------------------------------------------------------------
.de CM
.ev cutmarks \" so we don't screw up the rest of the text
.vs 0
.in 0
\h'|-\\n(LCu-\\n(DCu'\v'|\\n(TCu'\D'l -\\n(MCu 0'
.br
\h'|-\\n(LCu'\v'|\\n(TCu-\\n(DCu'\D'l 0 -\\n(MCu'
.br
\h'|-\\n(LCu+\\n(RCu+\\n(DCu'\v'|\\n(TCu'\D'l \\n(MCu 0'
.br
\h'|-\\n(LCu+\\n(RCu'\v'|\\n(TCu-\\n(DCu'\D'l 0 -\\n(MCu'
.br
\h'|-\\n(LCu-\\n(DCu'\v'|\\n(TCu+\\n(BCu'\D'l -\\n(MCu 0'
.br
\h'|-\\n(LCu'\v'|\\n(TCu+\\n(DCu+\\n(BCu'\D'l 0 \\n(MCu'
.br
\h'|-\\n(LCu+\\n(RCu+\\n(DCu'\v'|\\n(TCu+\\n(BCu'\D'l \\n(MCu 0'
.br
\h'|-\\n(LCu+\\n(RCu'\v'|\\n(TCu+\\n(DCu+\\n(BCu'\D'l 0 \\n(MCu'
.br
.ev
..
.\" ----------------------------------------------------------------
.po 2.5c
.ll 16c
.\" ----------------------------------------------------------------
.sp 3c
Hello
.CM
world.






reply via email to

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