groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/01: mom 2.5: update example files to include BOX and PAGE_COL


From: Peter Schaffter
Subject: [groff] 01/01: mom 2.5: update example files to include BOX and PAGE_COLOR
Date: Mon, 4 Oct 2021 15:19:47 -0400 (EDT)

PTPi pushed a commit to branch master
in repository groff.

commit af394eb17b525fa465b8f2ca49d246ee46335e67
Author: Peter Schaffter <peter@schaffter.ca>
AuthorDate: Mon Oct 4 15:18:59 2021 -0400

    mom 2.5: update example files to include BOX and PAGE_COLOR
---
 contrib/mom/examples/mom-pdf.mom    | 100 ++++++++++++++++--------------------
 contrib/mom/examples/slide-demo.mom |  66 ++++++++++++++++++------
 2 files changed, 92 insertions(+), 74 deletions(-)

diff --git a/contrib/mom/examples/mom-pdf.mom b/contrib/mom/examples/mom-pdf.mom
index 53cd729..581174d 100644
--- a/contrib/mom/examples/mom-pdf.mom
+++ b/contrib/mom/examples/mom-pdf.mom
@@ -40,12 +40,12 @@
 .PT_SIZE  10.5
 .AUTOLEAD 3
 .PARA_INDENT 0  \" No indent because we're spacing paragraphs.
-.\" Copyright notice
 .COVERTEXT
 .SP .5v
 .QUAD CENTER
 .HY off
 .IB 8P
+.\" Copyright notice
 This file is part of groff.
 .SP .5v
 Groff is free software.  You can redistribute it
@@ -99,24 +99,24 @@ If not, see:
 .\"
 .FOOTNOTE_SIZE -1
 .\" Character definitions for program names, opts, etc.
-.char \[ghostscript]      \*[BD]ghostscript\*[PREV]
-.char \[groff]            \*[BD]groff\*[PREV]
-.char \[gropdf]           \*[BD]gropdf\*[PREV]
-.char \[grops]            \*[BD]grops\*[PREV]
-.char \[man]              \*[BD]man\*[PREV]
-.char \[-mom]             \*[BD]\-mom\*[PREV]
-.char \[mom]              \*[BD]mom\*[PREV]
-.char \[-mpdfmark]        \*[BD]\-mpdfmark\*[PREV]
-.char \[ms]               \*[BD]ms\*[PREV]
-.char \[pdfmom]           \*[BD]pdfmom\*[PREV]
-.char \[pdfroff]          \*[BD]pdfroff\*[PREV]
-.char \[-P-e]             \*[BD]\-P\-e\*[PREV]
-.char \[-P-p<papersize>]  \*[BD]\-P\-p<papersize>\*[PREV]
-.char \[ps2pdf]           \*[BD]ps2pdf\*[PREV]
-.char \[psselect]         \*[BD]psselect\*[PREV]
-.char \[-T]               \*[BD]\-T\*[PREV]
-.char \[-Tpdf]            \*[BD]\-Tpdf\*[PREV]
-.char \[-Tps]             \*[BD]\-Tps\*[PREV]
+.char \[ghostscript]     \*[BD]ghostscript\*[PREV]
+.char \[groff]           \*[BD]groff\*[PREV]
+.char \[gropdf]          \*[BD]gropdf\*[PREV]
+.char \[grops]           \*[BD]grops\*[PREV]
+.char \[man]             \*[BD]man\*[PREV]
+.char \[-mom]            \*[BD]\-mom\*[PREV]
+.char \[mom]             \*[BD]mom\*[PREV]
+.char \[-mpdfmark]       \*[BD]\-mpdfmark\*[PREV]
+.char \[ms]              \*[BD]ms\*[PREV]
+.char \[pdfmom]          \*[BD]pdfmom\*[PREV]
+.char \[pdfroff]         \*[BD]pdfroff\*[PREV]
+.char \[-P-e]            \*[BD]\-P\-e\*[PREV]
+.char \[-P-p<papersize>] \*[BD]\-P\-p<papersize>\*[PREV]
+.char \[ps2pdf]          \*[BD]ps2pdf\*[PREV]
+.char \[psselect]        \*[BD]psselect\*[PREV]
+.char \[-T]              \*[BD]\-T\*[PREV]
+.char \[-Tpdf]           \*[BD]\-Tpdf\*[PREV]
+.char \[-Tps]            \*[BD]\-Tps\*[PREV]
 .\" Strings for inline code
 .ds cod  \E*[CODE]\&\E*[COND]
 .ds codx \E*[CONDX]\E*[CODE off]\&
@@ -128,13 +128,6 @@ If not, see:
 . nop \*[COND]\\$*\*[CONDX]
 . QUOTE OFF
 ..
-.\" Note box
-.de BOX-NOTE
-. ie \\n[#NUM_ARGS]=1 .DBX .5 0 \\n[.l]u \\$1
-. el .DBX .5 0 \\$1 \\$2
-. ALD 15p
-. IB 6p
-..
 .\" Table of contents
 .TOC_PADDING 2
 .SPACE_TOC_ITEMS
@@ -145,7 +138,7 @@ If not, see:
 .\"
 .DOCHEADER_ADVANCE 5c \" Begin docheader this distance down from top of page
 .\"
-.NO_SHIM
+.NO_SHIM \" Use flex spacing
 .START
 .\"
 .SP .5c
@@ -191,7 +184,7 @@ of PDF features available in \[mom].
 .COD "pdfmom doc.mom > doc.pdf
 One reason to prefer using the native PDF driver (via \[pdfmom] or
 \[-Tpdf]) is that papersizes set within mom source files (see
-.PDF_WWW_LINK 
http://www.schaffter.ca/mom/momdoc/typesetting.html#page-setup-intro SUFFIX ) \
+.PDF_WWW_LINK 
https://www.schaffter.ca/mom/momdoc/typesetting.html#page-setup-intro SUFFIX ) \
   "paper and page setup macros"
 do not require a corresponding \[-P-p<papersize>] flag on the
 command line.
@@ -299,12 +292,12 @@ used as the text.  If hotlink text is given and ends in
 URL.  If it ends in \*[cod]\[dq]+\[dq]\*[codx]\*[BU9], the URL is
 surrounded by quotes.  As an example,
 .RW 0
-.COD "\&.PDF_WWW_LINK http://www.schaffter.ca/mom/momdoc/toc.html
+.COD "\&.PDF_WWW_LINK https://www.schaffter.ca/mom/momdoc/toc.html
 would open mom's online documentation at
-.PDF_WWW_LINK http://www.schaffter.ca/mom/momdoc/toc.html SUFFIX "." 
+.PDF_WWW_LINK https://www.schaffter.ca/mom/momdoc/toc.html SUFFIX "." 
 The same, with \*[cod]\[dq]here\[dq]\*[codx] supplied as
 hotlink text, lets you click
-.PDF_WWW_LINK http://www.schaffter.ca/mom/momdoc/toc.html "here"
+.PDF_WWW_LINK https://www.schaffter.ca/mom/momdoc/toc.html "here"
 instead.
 .HEADING 2 NAMED colour  "Assigning a colour to links"
 .PP
@@ -312,9 +305,9 @@ The colour of links is set with
 .COD "\&.PDF_LINK_COLOR <xcolor> | <newcolor> | <r g b> | <#rrggbb>
 where \*[cod]<xcolor>\*[codx] or \*[cod]<newcolor>\*[codx] are the names
 of colours already initialized with
-.PDF_WWW_LINK http://www.schaffter.ca/mom/momdoc/color.html#xcolor "XCOLOR"
+.PDF_WWW_LINK https://www.schaffter.ca/mom/momdoc/color.html#xcolor "XCOLOR"
 or
-.PDF_WWW_LINK http://www.schaffter.ca/mom/momdoc/color.html#newcolor SUFFIX . 
"NEWCOLOR"
+.PDF_WWW_LINK https://www.schaffter.ca/mom/momdoc/color.html#newcolor SUFFIX . 
"NEWCOLOR"
 If you prefer to define a new colour (using the RGB colour scheme),
 enter it either as 3 numbers between
 0.0 \*[UP 1p]\[->]\*[DOWN 1p] 1\*[BU4].0
@@ -412,7 +405,7 @@ can remove the window title by issuing
 .COD ".PDF_TITLE \[dq]\[dq] \e\[dq] ie. with a blank argument
 .IBQ
 .FLOAT off
-.SP .5v
+\#.SP .5v
 .HEADING 1 NAMED toc "Tables of Contents"
 .RLD .5v
 .HEADING 2 NAMED toc:gen "Generating a Table of Contents 
@@ -423,7 +416,7 @@ insert the macro, \*[cod]TOC\*[codx], as the last line of 
the source
 file. (Formatting of the printable Table of Contents is discussed in
 detail in the
 .PDF_WWW_LINK \
-http://www.schaffter.ca/mom/momdoc/tables-of-contents.html#top \
+https://www.schaffter.ca/mom/momdoc/tables-of-contents.html#top \
 SUFFIX ). "mom documentation"
 When the file is processed and loaded in a viewer, entries in the
 Table of Contents will be clickable links.
@@ -532,18 +525,20 @@ The resulting PDF is produced from PostScript output fed 
into
 For either invocation, it is not necessary to add \[-mom] or
 \[-mpdfmark], as these are implied.
 .PP
+.RW .04
 If Encapsulated PostScript or plain PostScript images have been
 embedded in a document with
-.PDF_WWW_LINK http://www.schaffter.ca/mom/momdoc/images.html#pspic SUFFIX , \
+.PDF_WWW_LINK https://www.schaffter.ca/mom/momdoc/images.html#pspic SUFFIX , \
   "PSPIC"
 the \[-Tps] option must be used.  In most other cases, \[pdfmom]
 with no \[-T] flag is preferable.
+.RW 0
 .HEADING 2 NAMED papersize "Setting papersize within a source file"
 .PP
 A significant convenience afforded by using \[pdfmom] (or \[groff]
 with the \[-Tpdf] flag) is that papersizes or page dimensions set
 within mom source files (see
-.PDF_WWW_LINK 
http://www.schaffter.ca/mom/momdoc/typesetting.html#page-setup-intro \
+.PDF_WWW_LINK 
https://www.schaffter.ca/mom/momdoc/typesetting.html#page-setup-intro \
   SUFFIX ) "paper and page setup macros"
 do not require a corresponding \[-P-p<papersize>] option on the
 command line.  It is even possible to create documents with
@@ -552,8 +547,8 @@ unequal-sized pages.
 "Differences between pdfmom and pdfroff"
 .PP
 Several features described in this manual are not available when
-using \[pdfmom] with the \[-Tps] option, or when using \[pdfroff], or
-\[groff]\~\[-Tps]\~\[-mpdfmark]:
+the \[-Tps] option is given to \[pdfmom], nor when using \[pdfroff]
+or \[groff]\~\[-Tps]\~\[-mpdfmark]:
 .SP .25v
 .QUAD LEFT
 .HYPHENATION off
@@ -587,8 +582,6 @@ only accepts colour definitions in decimal notation.
 does not support all the features described here
 .ITEM
 accepts images and graphics embedded with PSPIC
-.ITEM
-is mature and well-tested code
 .LIST OFF
 .IQ
 .ALD .4v
@@ -605,27 +598,20 @@ for the papersize flag (\[-P-p<papersize>]) on the 
command line
 .ITEM
 is not compatible with
 .PDF_WWW_LINK \
-  http://www.schaffter.ca/mom/momdoc/docprocessing.html#printstyle \
+  https://www.schaffter.ca/mom/momdoc/docprocessing.html#printstyle \
   "PRINTSTYLE TYPEWRITE"
 underlining (e.g., of italics)
 .ITEM
 generally produces larger files; these can be reduced by piping
 the output through \[ps2pdf]\*[B]
-.FLOAT
-.QUAD LEFT
-.BR_AT_LINE_KERN
-.IL -2P
-.BOX-NOTE (\n[.l]u-6P) 3P
-.EW .3
-\*[BD]Note:\*[PREV] Owing to a known bug, PDF files piped
-through \[ps2pdf] lose some of
-.EW 0
-their metadata, notably the window title set with
-\*[cod]PDF_TITLE\*[codx].
-.SP .75
-.FLOAT off
-.ITEM
-is newer code with less testing
+.sp -1.25v
+.BOX OUTLINED black SHADED grey90 WEIGHT 1p INSET 6p
+.JUSTIFY
+\*[BD]Note:\*[PREV] Owing to a known bug, PDF files piped through
+\[ps2pdf] lose some of their metadata, notably the window title set
+with \*[cod]PDF_TITLE\*[codx].
+.BOX STOP
+.SP -.25v
 .LIST OFF
 .TOC
 .\" Local Variables:
diff --git a/contrib/mom/examples/slide-demo.mom 
b/contrib/mom/examples/slide-demo.mom
index b145ecc..d9edf65 100644
--- a/contrib/mom/examples/slide-demo.mom
+++ b/contrib/mom/examples/slide-demo.mom
@@ -1,19 +1,12 @@
 .\" -*- mode: text; coding: utf-8; -*-
 \#
 \# Copyright (C) 2004-2020 Free Software Foundation, Inc.
+\# Revised for version 2.5 2021-08.
 \#
 \# Copying and distribution of this file, with or without modification,
 \# are permitted in any medium without royalty provided the copyright
 \# notice and this notice are preserved.
 \#
-.\"----------------------------------------------------------------
-.\" Make first slide black.  Remove if printing to save ink.
-.po 0
-.ll 11i
-.DBX SOLID 0 \n[.l]u \n[.p]u
-.\"----------------------------------------------------------------
-.
-.\"----------------------------------------------------------------
 .\" Macro for code blocks
 .de CODE_BLOCK
 . ie \\n[.$] \{\
@@ -80,6 +73,11 @@
 .
 .STRING hand \*[darkred]\[rh]\*[black]
 .
+.\" Make first slide black.
+.\" If printing, remove to save ink.
+.SLIDE_COLOR black
+.SLIDE_COLOR off
+.
 .START
 .
 .ADD_SPACE 9p
@@ -256,12 +254,44 @@ parameters.\*[BU6]\*[UP 2p]\s[-2]*\s[0]
 .PT_SIZE +2
 .
 .NEWSLIDE "Blinds .5"
+.SLIDE_COLOR antiquewhite
 .
 .ADD_SPACE 9p
 .
-.HEADING 1 "Macros and preprocessors"
+.HEADING 1 "Highlighting items
 .SP .5v
+.PP
+The BOX macro lets you highlight items as they are revealed with
+frames and shaded backgrounds\*[HANG .]
+.PAUSE "Fade .5"
+.BOX SHADED pink INSET 3p
+.PP
+This item is highlighted with a shaded background\*[HANG .]
+.PAUSE
+.PP
+The highlight moves to each new item as it's revealed\*[HANG .]
+.PAUSE
+.PP
+Highlighting can continue for as many slides as you want\*[HANG .]
+.PAUSE
+.PP
+If there are no pauses on a slide, BOX can be used
+.BR
+to provide a background for all the items\*[HANG .]
+.PAUSE
+.PP
+The SLIDE_COLOR macro lets you colour
+.BR
+the whole slide (q.v.)\*[HANG .]
+.BOX off
+.
+.SLIDE_COLOR off
+.NEWSLIDE "Box 1 . O"
 .
+.ADD_SPACE 9p
+.
+.HEADING 1 "Macros and preprocessors"
+.SP .5v
 .PP
 Slides can make full use of all mom's document processing and
 typesetting macros, including preprocessors and image insertion\*[HANG .]
@@ -271,20 +301,22 @@ typesetting macros, including preprocessors and image 
insertion\*[HANG .]
 .
 .PAD "\
 \*[FWD 4P+6p]\*[ST1]#\*[ST1X]\
-\*[FWD 1P]\*[ST2]#\*[ST2X]\
-\*[FWD 3P+6p]\*[ST3]#\*[ST3X]\
+\*[FWD 2P+6p]\*[ST2]\*[FWD 12P]\\*[ST2X]\
+\*[FWD 3P+9p]\*[ST3]#\*[ST3X]\
 \*[FWD 3P]\*[ST4]#\*[ST4X]\*[FWD 2P]"
 .
 .ST 1 L
-.ST 2 L
-.ST 3 L
-.ST 4 L
+.ST 2 C
+.ST 3 C
+.ST 4 C
 .
 .PAUSE "Fade .5"
 .
 .TAB 1
 .PT_SIZE -1.5
+.CENTER
 \*[BD]\*[blue2]\*[DOWN 6p]tbl
+.LEFT
 .mk
 .PT_SIZE -1
 .COLOR blue2
@@ -313,7 +345,7 @@ _
 \*[FWD 10p]\*[DOWN 6p]pic
 .COLOR green4
 .SP 3p
-.PS 2
+.PS 2 LEFT
 A: ellipse wid 0.5 ht 0.5
   arrow color "green4" up 0.2 from A.n
   arrow color "green4" up 0.2 right 0.2 from A.ne
@@ -351,11 +383,11 @@ f sub X (x) ^=^ left {
 .COLOR blue2
 \*[DOWN 6p]pdf image\*[black]\*[PREV]
 .SP 2P+6p
-.PDF_IMAGE -L penguin.pdf 81p 96p FRAME
+.PDF_IMAGE -C penguin.pdf 81p 96p FRAME
 .TQ
 .
 .NEWSLIDE "Box 1 . O"
-.ADD_SPACE 9p
+.ADD_SPACE 5p
 .IB 10P
 .PT_SIZE +1.5
 .



reply via email to

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