From 631b966e503b4101783c2807909c172139d1d3db Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 22 Nov 2016 22:47:35 +0100 Subject: initial import of all the files from gpresent-2.3.tar.gz --- CHANGES | 42 ++++ COPYING | 339 ++++++++++++++++++++++++++++ README | 80 +++++++ demo.pdf | Bin 0 -> 285647 bytes demo.rof | 683 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ groff_piclink.7 | 39 ++++ groff_present.7 | 321 ++++++++++++++++++++++++++ piclink.pdf | Bin 0 -> 20012 bytes piclink.rof | 102 +++++++++ piclink.tmac | 73 ++++++ present.tmac | 615 ++++++++++++++++++++++++++++++++++++++++++++++++++ presentps | 444 ++++++++++++++++++++++++++++++++++++ presentps.1 | 42 ++++ sidebar.pdf | Bin 0 -> 12533 bytes sidebar.rof | 69 ++++++ smile.epsf | 353 +++++++++++++++++++++++++++++ 16 files changed, 3202 insertions(+) create mode 100644 CHANGES create mode 100644 COPYING create mode 100644 README create mode 100644 demo.pdf create mode 100644 demo.rof create mode 100644 groff_piclink.7 create mode 100644 groff_present.7 create mode 100644 piclink.pdf create mode 100644 piclink.rof create mode 100644 piclink.tmac create mode 100644 present.tmac create mode 100755 presentps create mode 100644 presentps.1 create mode 100644 sidebar.pdf create mode 100644 sidebar.rof create mode 100644 smile.epsf diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..bdec165 --- /dev/null +++ b/CHANGES @@ -0,0 +1,42 @@ +Changes since varsion 2.2 +------------------------- + +o Changed '.INITCOLOR yellow' into '.DEFAULTCOLOR yellow' in demo.rof. +o Repaired bug in presentps which messed things up. +o Adjusted smile.epsf to prevent problem with acroread version 5.x. +o Adjusted presentps for viewing problems with wide-screens. + +Changes since version 2.1 +------------------------- + +o Bug in presentps, which resulted in problems with ps2pdf. +o Mentioning of INITCOLOR instead of DEFAULTCOLOR in demo.rof. +o acroread version 5.0 stumbled on smile.epsf. + +Changes since version 2.0 +------------------------- + +o Adjusted the story on loading of the piclink macros. + They can't be loaded with the -m option, because then they + are not preprocessed by gpic. +o Adjusted presentps so that additional PageSize settings added + by grops since version 1.18.2 of groff, are filtered out. + +Changes since version 1.0 +------------------------- + +o Footers are put on an exact location. +o TITLE and SUBTITLE set the strings title and subtitle. +o Added the picture linking macros for making links inside a picture. + A demonstration is also added. +o Presentps has an option (-lc) for indicating the corner to put the links. +o The END macro sets the margins. +o A demonstration of a sidebar as header. +o All variables used in the macros start with gp- in order to prevent + clashes. +o Colors are now implemented with .defcolor and \m[...]. Color changes can + still be made with \*[colXXX] but this is deprecated. +o More control over titles and subtitles by means of the macros TITLEFORMAT, + SUBTITLECOLOR, and SUBTITLEFORMAT, in addition to TITLECOLOR which now + only sets the color for titles. +o Added the macros DEFAULTCOLOR and INITCOLOR. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..e8a612e --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/README b/README new file mode 100644 index 0000000..f7b721b --- /dev/null +++ b/README @@ -0,0 +1,80 @@ + + GPRESENT version 2.3 + -------------------- + +DESCRIPTION + gpresent is a package for making presentations with groff and + acroread. It consist of a set of macros to be used with groff + and a post-processor for manipulating the PostScript output of + groff. Without the use of the PAUSE macro, it can also be used + for making slides. + +FILES + README - this file + present.tmac - presentation macros + groff_present.7 - manual page of the presentation macros + presentps - post-processor for the output of groff + presentps.1 - manual page of presentps + demo.rof - groff input file of the demonstration + demo.pdf - demonstration of the macros + sidebar.rof - groff input file of the sidebar demonstration + sidebar.pdf - demonstration of a sidebar as header + smile.epsf - used in demos. + piclink.tmac - picture linking macros + groff_piclink.7 - manual page of the picture linking macros + piclink.rof - groff input file of the piclink demonstration + piclink.pdf - demonstration of links inside a picture. + COPYING - the GNU General Public License (GPL) + CHANGES - list of changes compared to previous versions + +USAGE + Presentations: + % groff -mm -mpresent file.rof > file.pps + % presentps -l < file.pps > file.ps + % ps2pdf file.ps + % acroread file.pdf + Slides: + % groff -P-l -mm -mpresent file.rof > file.ps + + Note: + - Do not forget to put in options for the preprocessors that + are to be used. + - On systems were Troff is installed you have to use -mgm + instead of -mm. + +NEEDED + o groff (version 1.18.1 dated Oct 3, 2002 or higher/later) with + the mm macros (included with groff) + groff.ffii.org + o perl (version 5.x) + www.perl.com + o ps2pdf included with Ghostscript (version 5.10 or higher) + www.ghostscript.com + o acroread (version 4.0) + www.adobe.com/products/acrobat/adobepdf.html + +INSTALL + o put present.tmac and piclink.tmac in the tmac directory of your + groff installation (and delete old version named tmac.present) + o change the path in the first line of presentps to the path of + your perl version 5.x and put presentps in the bin directory of + your groff installation + o put groff_present.7 and groff_piclink.7 in man/man7 of your + groff installation + o put presentps.1 in man/man1 of your groff installation + +NOTES + o acroread: in your preferences for FullScreen set + Default Transition to Replace + Mouse Cursor to Always Visible or Hidden After Delay + +AUTHOR + Bob Diertens, + +COPYRIGHT + gpresent is free software. See the file COPYING for copying + permission. + +WEBSITE + www.science.uva.nl/~bobd/useful/gpresent/ + diff --git a/demo.pdf b/demo.pdf new file mode 100644 index 0000000..4a04096 Binary files /dev/null and b/demo.pdf differ diff --git a/demo.rof b/demo.rof new file mode 100644 index 0000000..27edd5d --- /dev/null +++ b/demo.rof @@ -0,0 +1,683 @@ +.fam H +.ft H +.de HEADER +.ft H +.sp -0.1i \" PSPIC takes to much space here +.PSPIC -L smile.epsf 0.5i +.sp -0.1i +\l'\\n[.l]u'\h'-\\n[.l]u' +.br +.mk R1 +.sp -0.4i +\h'0.6i'\s+8Demonstration of Presentations with Groff\ + and Acroread\s-8 +.sp |\\n(R1u +.br +.. +.de FOOTER +.ft H +\l'\\n[.l]u'\h'-\\n[.l]u' +.br +.tl '''%' +.. +.TITLE "The making of this demo" +.DS CB +.PS +linethick=1.5i +arrowwid=0.08 +boxwid=1.2i +IN: box "demo.rof" invis +MA: box "\m[blue]present.tmac\m[]" invis at IN + (1.5i,0) + arrow down from IN.s +GR: box "groff" + arrow from MA.sw to GR.ne + arrow down from GR.s +PP: box "\*[colblue]presentps\*[colP]" + arrow down +PS: box "ps2pdf" + arrow down +AR: box "acroread" + move to (GR.x + 2.0i, GR.y) + "groff -p -e -t -mm -m\*[colblue]present\*[colP] demo.rof > demo.pps" ljust + move to (PP.x + 2.0i, PP.y) + "\*[colblue]presentps\*[colP] -l < demo.pps > demo.ps" ljust + move to (PS.x + 2.0i, PS.y) + "ps2pdf demo.ps" ljust + move to (AR.x + 2.0i, AR.y) + "acroread demo.pdf" ljust +.PE +.DE +.SK +.TITLE "Headers" +You can make headers by defining a macro HEADER +.VERBON 22 16 +\&.de HEADER +\&.sp 0.2i +\&.PSPIC -L smile.eps 0.5i +\&.sp -0.1i +\\l'\\\\n[.l]u'\\h'-\\\\n[.l]u' +\&.br +\&.mk R1 +\&.sp -0.4i +\\h'0.6i'\\s+8Demonstration of Presentations with Groff\\ + and Acroread\\s-8 +\&.sp |\\\\n(R1u +\&.br +\&.. +.VERBOFF +.SK +.TITLE "Footers" +You can make footers by defining a macro FOOTER +.VERBON 22 16 +\&.de FOOTER +\\l'\\\\n[.l]u'\\h'-\\\\n[.l]u' +\&.br +\&.tl '''%' +\&.. +.VERBOFF +.SK +.TITLE "Titles" +The TITLE macro makes a centered, dark blue title in a big font. +.VERBON 22 16 +\&.TITLE "Titles" +.VERBOFF +.SUBTITLE "Subtitles" +The SUBTITLE macro makes a indented, dark blue subtitle in a big font but smaller than a title. +.VERBON 22 16 +\&.SUBTITLE "Subtitles" +.VERBOFF +.SUBTITLE "Titlecolor" +You can change the color of the titles and subtitles with the macro +TITLECOLOR. +.VERBON 22 16 +\&.TITLECOLOR red +.VERBOFF +.SK +.TITLE "Pausing" +You can show a list and pause after each item with the use of +the PAUSE macro. +.BL +.LI +list item 1 +.PAUSE +.LI +list item 2 +.PAUSE +.LI +list item 3 +.LE 1 +.P +The list is created with +.VERBON 22 16 +\&.BL +\&.LI +list item 1 +\&.PAUSE +\&.LI +list item 2 +\&.PAUSE +\&.LI +list item 3 +\&.LE 1 +.VERBOFF +.SK +.TITLE "Pausing (cont.)" +You can also use the PAUSE macro in a picture. +.PAUSE +.DS CB +.PS +linethick=1.5 +arrowwid=0.08 +boxwid=1.3i +boxht=0.7i +ellipsewid=1.3i +ellipseht=0.7i +ellipse "document" +.PAUSE +arrow +box "PIC" +.PAUSE +arrow +box "TBL/EQN" "(optional)" \ + dashed +.PAUSE +arrow +box "GROFF" +.PAUSE +arrow +ellipse "typesetter" +.PE +.DE +.P +The picture is created with +.2C +.VERBON 22 16 +\&.DS CB +\&.PS +linethick=1.5 +arrowwid=0.08 +boxwid=1.3i +boxht=0.7i +ellipsewid=1.3i +ellipseht=0.7i +ellipse "document" +\&.PAUSE +arrow +box "PIC" +\&.PAUSE +arrow +box "TBL/EQN" "(optional)" \\ + dashed +\&.PAUSE +arrow +box "GROFF" +\&.PAUSE +arrow +ellipse "typesetter" +\&.PE +\&.DE +.VERBOFF +.1C +.SK +.TITLE "Pausing (cont.) +You can also use the PAUSE macro in a equation. +.PAUSE +.DS I +.EQ +gfont BI +G(z) ~mark =~ e sup{ln ~ G(z)} +~=~ exp left ( +sum from k>=1 {S sub k z sup k} over k right ) +~=~ prod from k>=1 e sup {S sub k z sup k /k} +.EN +.DE +.DS I +.PAUSE +.EQ +lineup = left ( 1 + S sub 1 z + +{S sub 1 sup 2 z sup 2} over 2! + ... right ) ~ +left ( 1 + {S sub 2 z sup 2} over 2 ++ {S sub 2 sup 2 z sup 4} over {2 sup 2 cdot 2! } ++ ... right ) ~ ... +.EN +.DE +.DS I +.PAUSE +.EQ +lineup = sum from m>=0 left ( +sum from +pile {k sub 1 ,k sub 2 ,..., k sub m >=0 +above +k sub 1 +2k sub 2 + ... +mk sub m =m} +{S sub 1 sup {k sub 1}} over {1 sup k sub 1 k sub 1 !} ~ +{S sub 2 sup {k sub 2}} over {2 sup k sub 2 k sub 2 !} ~ +... +{S sub m sup {k sub m}} over {m sup k sub m k sub m !} +right ) ~ z sup m +.EN +.DE +The equation is created with +.VERBON 22 16 +\&.DS I +\&.EQ +gfont BI +G(z) ~mark =~ e sup{ln ~ G(z)} +~=~ exp left ( +sum from k>=1 {S sub k z sup k} over k right ) +~=~ prod from k>=1 e sup {S sub k z sup k /k} +\&.EN +\&.DE +\&.DS I +\&.PAUSE +\&.EQ +lineup = left ( 1 + S sub 1 z + +{S sub 1 sup 2 z sup 2} over 2! + ... right ) ~ +left ( 1 + {S sub 2 z sup 2} over 2 ++ {S sub 2 sup 2 z sup 4} over {2 sup 2 cdot 2! } ++ ... right ) ~ ... +\&.EN +\&.DE +\&.DS I +\&.PAUSE +\&.EQ +lineup = sum from m>=0 left ( +sum from +pile {k sub 1 ,k sub 2 ,..., k sub m >=0 +above +k sub 1 +2k sub 2 + ... +mk sub m =m} +{S sub 1 sup {k sub 1}} over {1 sup k sub 1 k sub 1 !} ~ +{S sub 2 sup {k sub 2}} over {2 sup k sub 2 k sub 2 !} ~ +\&... +{S sub m sup {k sub m}} over {m sup k sub m k sub m !} +right ) ~ z sup m +\&.EN +\&.DE +.VERBOFF +.SK +.TITLE "Pausing (cont.)" +You can also use the PAUSE macro in a table. +.DS CB +.TS +tab(#); +cfHB s s +c c c +n n n. +AT&T Common Stock +Year#Price#Dividend +_ +.PAUSE +1984#15-20#$1.20 +.PAUSE +5#19-25#1.20 +.PAUSE +6#21-28#1.20 +.PAUSE +7#20-36#1.20 +.TE +.DE +Box, allbox and vertical lines are not drawn at the right moment, so +it is better not to use them. +.P +The table is created with +.2C +.VERBON 22 16 +\&.DS CB +\&.TS +tab(#); +cfHB s s +c c c +n n n. +AT&T Common Stock +Year#Price#Dividen +_ +\&.PAUSE +1984#15-20#$1.20 +\&.PAUSE +5#19-25#1.20 +\&.PAUSE +6#21-28#1.20 +\&.PAUSE +7#20-36#1.20 +\&.TE +\&.DE +.VERBOFF +.1C +.SK +.TITLE "Colors" +You can change the foreground color with the macro COLOR. +.VERBON 22 16 +\&.COLOR red +.VERBOFF +.COLOR red +changes the foreground color to red and +.VERBON 22 16 +\&.COLOR P +.VERBOFF +.COLOR P +changes it to the previous color. +.P +If followed by arguments, then only the +.VERBON 22 16 +\&.COLOR red "first argument is in red" , +.VERBOFF +.COLOR red "first argument is in red" , +and the optional second argument is in the current color. +.P +To set the foreground color at the start of the presentation, you +can use the macro INITCOLOR +.VERBON 22 16 +\&.INITCOLOR yellow +.VERBOFF +To set the default foreground color for text, headers, and footers, +you can use the macro DEFAULTCOLOR +.VERBON 22 16 +\&.DEFAULTCOLOR yellow +.VERBOFF +.BR Note : +DEFAULTCOLOR and INITCOLOR should only be used after the definition +of the HEADER macro (if you use one). +.SK +.TITLE "Colors (cont.) +You can define a color with the macro DEFCOLOR. +.VERBON 22 16 +\&.DEFCOLOR brown 0.64 0.16 0.16 +.VERBOFF +defines the color +.DEFCOLOR brown 0.64 0.16 0.16 +.COLOR brown BROWN +\&. +.br +The arguments 2, 3, 4 represent the values for the colors red, green, and +blue. The values must be between 0 and 1. +.P +You can also change the foreground color by embedding a +\\\v'0.2m'*\v'-0.2m'[colX] at the desired point to set the color to X. +If X is P, the color is changed to the previous color. +.VERBON 22 16 +current \\*[colblue]blue \\*[colred]red \\*[colP]previous +.VERBOFF +.ds savedfgcolor \*[gp-col@cur] +becomes +.br +current \*[colblue]blue \*[colred]red \*[colP]previous +.br +.COLOR \*[savedfgcolor] +Another \\\v'0.2m'*\v'-0.2m'[colP] for setting the foreground color +to the current one does not work, as it did in a previous version of gpresent. +.P +.BR Note : +the usage of \\\v'0.2m'*\v'-0.2m'[colX] is deprecated, use \\m[..] instead. +.DEFCOLOR mybg 0.5 0.5 0.8 +.BACKGROUND Solid mybg +.SK +.TITLE "Predefined Colors" +The following colors are defined by their name in lowercase: +.br +.in +1i +.COLOR red RED +.COLOR green GREEN +.COLOR blue BLUE +.COLOR cyan CYAN +.COLOR magenta MAGENTA +.COLOR yellow YELLOW +.COLOR white WHITE +.COLOR black BLACK +.br +.in -1i +.P +The following colors are defined by their name in lowercase followed +by the number in the left column: +.in +1i +9 +.COLOR red9 RED +.COLOR green9 GREEN +.COLOR blue9 BLUE +.COLOR cyan9 CYAN +.COLOR magenta9 MAGENTA +.COLOR yellow9 YELLOW +.COLOR gray9 GRAY +.br +8 +.COLOR red8 RED +.COLOR green8 GREEN +.COLOR blue8 BLUE +.COLOR cyan8 CYAN +.COLOR magenta8 MAGENTA +.COLOR yellow8 YELLOW +.COLOR gray8 GRAY +.br +7 +.COLOR red7 RED +.COLOR green7 GREEN +.COLOR blue7 BLUE +.COLOR cyan7 CYAN +.COLOR magenta7 MAGENTA +.COLOR yellow7 YELLOW +.COLOR gray7 GRAY +.br +6 +.COLOR red6 RED +.COLOR green6 GREEN +.COLOR blue6 BLUE +.COLOR cyan6 CYAN +.COLOR magenta6 MAGENTA +.COLOR yellow6 YELLOW +.COLOR gray6 GRAY +.br +5 +.COLOR red5 RED +.COLOR green5 GREEN +.COLOR blue5 BLUE +.COLOR cyan5 CYAN +.COLOR magenta5 MAGENTA +.COLOR yellow5 YELLOW +.COLOR gray5 GRAY +.br +4 +.COLOR red4 RED +.COLOR green4 GREEN +.COLOR blue4 BLUE +.COLOR cyan4 CYAN +.COLOR magenta4 MAGENTA +.COLOR yellow4 YELLOW +.COLOR gray4 GRAY +.br +3 +.COLOR red3 RED +.COLOR green3 GREEN +.COLOR blue3 BLUE +.COLOR cyan3 CYAN +.COLOR magenta3 MAGENTA +.COLOR yellow3 YELLOW +.COLOR gray3 GRAY +.br +2 +.COLOR red2 RED +.COLOR green2 GREEN +.COLOR blue2 BLUE +.COLOR cyan2 CYAN +.COLOR magenta2 MAGENTA +.COLOR yellow2 YELLOW +.COLOR gray2 GRAY +.br +1 +.COLOR red1 RED +.COLOR green1 GREEN +.COLOR blue1 BLUE +.COLOR cyan1 CYAN +.COLOR magenta1 MAGENTA +.COLOR yellow1 YELLOW +.COLOR gray1 GRAY +.br +.in -1i +.TITLECOLOR white +.ds savedfgcolor \*[gp-col@cur] +.COLOR yellow +.BACKGROUND Solid blue +.SK +.TITLE "Backgrounds" +.SUBTITLE "Solid" +This background is created with +.VERBON 22 16 +\&.BACKGROUND Solid blue +.VERBOFF +.BACKGROUND GradX blue blue5 +.SK +.TITLE "Backgrounds (cont.)" +.SUBTITLE "Gradient X" +This background is created with +.VERBON 22 16 +\&.BACKGROUND GradX blue blue5 +.VERBOFF +.BACKGROUND GradY blue blue5 +.SK +.TITLE "Backgrounds (cont.)" +.SUBTITLE "Gradient Y" +This background is created with +.VERBON 22 16 +\&.BACKGROUND GradY blue blue5 +.VERBOFF +.BACKGROUND GradAngle blue blue5 100 45 +.SK +.TITLE "Backgrounds (cont.)" +.SUBTITLE "Gradient with Angle" +This background is created with +.VERBON 22 16 +\&.BACKGROUND GradAngle blue blue5 100 45 +.VERBOFF +.COLOR \*[savedfgcolor] +.TITLECOLOR blue4 +.BACKGROUND None +.SK +.TITLE "Backgrounds (cont.)" +.SUBTITLE "None" +You can get rid of backgrounds with +.VERBON 22 16 +\&.BACKGROUND None +.VERBOFF +.SK +.TITLE "Filled Rectangles" +Since we have the routines for filling the background, we might as well +use them for filled rectangles. +.P +The rectangles below are created with: +.FILL 4i 4i 5i 5i Solid red +.FILL 4.5i 4.5i 5.5i 5.5i GradX green green6 +.FILL 5i 5i 6i 6i GradY blue blue6 +.FILL 5.5i 5.5i 6.5i 6.5i GradAngle yellow yellow6 30 45 +.VERBON 22 16 +\&.FILL 4i 4i 5i 5i Solid red +\&.FILL 4.5i 4.5i 5.5i 5.5i GradX green green6 +\&.FILL 5i 5i 6i 6i GradY blue blue6 +\&.FILL 5.5i 5.5i 6.5i 6.5i GradAngle yellow yellow6 30 45 +.VERBOFF +.SK +.TITLE "Blocks" +You can create blocks anywhere with the macros BLOCKS an BLOCKE. +.br +.BLOCKS 1i 4i +\&.BLOCKS 1i 4i +.br +This is block 1, with x-position 1i and y-position 4i. +.br +\&.BLOCKE +.BLOCKE +.PAUSE +.BLOCKS 4i 3i +\&.BLOCKS 4i 3i +.br +This is block 2, with x-position 4i and y-position 3i. +.br +\&.BLOCKE +.BLOCKE +.PAUSE +.BLOCKS 4i 5i 2i +\&.BLOCKS 4i 5i 2i +.br +This is block 3, with x-position 4i, y-position 5i, and line length 2i. +.br +\&.BLOCKE +.BLOCKE +.PAUSE +After a block, you return to the position before the block. +.SK +.TITLE "Blocks (cont.)" +If the first argument of BLOCKS is \fConce\fP, the block only appears once. +You can use this in combination with the PAUSE macro. +.BL +.LI +list item 1 +.BLOCKS once +.DL +.LI +subitem 1.1 +.LI +subitem 1.2 +.LE 1 +.BLOCKE +.PAUSE +.LI +list item 2 +.BLOCKS once +.DL +.LI +subitem 2.1 +.LI +subitem 2.2 +.LE 1 +.BLOCKE +.PAUSE +.LI +list item 3 +.LE 1 +The above is created with +.2C +.VERBON 22 16 +\&.BL +\&.LI +list item 1 +\&.BLOCKS once +\&.DL +\&.LI +subitem 1.1 +\&.LI +subitem 1.2 +\&.LE 1 +\&.BLOCKE +\&.PAUSE +\&.LI +list item 2 +\&.BLOCKS once +\&.DL +\&.LI +subitem 2.1 +\&.LI +subitem 2.2 +\&.LE 1 +\&.BLOCKE +\&.PAUSE +\&.LI +list item 3 +\&.LE 1 +.VERBOFF +.1C +.SK +.TITLE "Links" +You can make a link with the macro LINK. +.LINKCOLOR blue7 1 blue +.br +The link +.LINK L1 "next page" +is made with +.VERBON 22 16 +\&.LINK L1 "next page" +.VERBOFF +.SK +.TITLE "Links (cont.)" +.DESTINATION L1 +On this page a destination for the link on the previous page was created +with the macro DESTINATION. +.VERBON 22 16 +\&.DESTINATION L1 +.VERBOFF +You can change the color for the links with the macro LINKCOLOR. +.VERBON 22 16 +\&.LINKCOLOR blue7 +.VERBOFF +A second argument specifies the borderwidth of the link. +.VERBON 22 16 +\&.LINKCOLOR blue7 1 +.VERBOFF +A third argument specifies the bordercolor. +.VERBON 22 16 +\&.LINKCOLOR blue7 1 blue +.VERBOFF +.SK +.TITLE "Contents" +You can make a contents page with the macro END. +The contents consist of all the titles. +They are turned into links that go back to the top of the page at +which the titles appear. +.P +You can add something to the contents with the macro ADDCONTENT. +.ADDCONTENT "This is added to the contents" +.VERBON 22 16 +\&.ADDCONTENT "This is added to the contents" +.VERBOFF +.SK +.TITLE "Browse" +You can browse through a presentation with the possibilities provided +by acroread. +.br +If \*[colblue]presentps\*[colP] is given the option -l, there are buttons +added in the right lower corner. +These button are: +.VL 8 4 +.LI < +top of previous page +.LI > +top of next page +.LI c +contents page +.LE 1 +.END diff --git a/groff_piclink.7 b/groff_piclink.7 new file mode 100644 index 0000000..8a01f01 --- /dev/null +++ b/groff_piclink.7 @@ -0,0 +1,39 @@ +.TH GROFF_PICLINK 7 "September 4, 2002" +.SH NAME +groff_piclink \- groff picture linking macros +.SH SYNOPSIS +groff \fB\-p\fP \-mm \-mpresent \fBpiclink.tmac\fP [\|\fIoptions\fP ...\|] [\|\fIfiles\fP ...\|] +.SH DESCRIPTION +The picture linking macros are to be used with the presentation macros. +They make it possible to make a link in a picture (made with pic) to +another slide in the presentation. +.PP +The piclink macros cannot be loaded with a \-m option, since it +needs to be processed by +.BR gpic (1) +in order to define the PIC macro. +.SH USAGE +.SS "PIC macros +.TP +.BI LINK( name , object ) +Makes a link from +.I object +to the destination +.IR name . +.I object +must be an indication of a box, circle, or ellipse. +For technical reasons, the link itself is always a rectangle. +.SH FILES +.TP +.B .../groff/.../tmac/m.tmac +.TP +.B .../groff/.../tmac/present.tmac +.TP +.B piclink.tmac +.SH "SEE ALSO" +.BR groff (1), +.BR groff_mm (7), +.BR groff_present (7), +.BR pic (1) +.SH AUTHOR +Bob Diertens, diff --git a/groff_present.7 b/groff_present.7 new file mode 100644 index 0000000..ec08624 --- /dev/null +++ b/groff_present.7 @@ -0,0 +1,321 @@ +.TH GROFF_PRESENT 7 "September 4, 2002" +.SH NAME +groff_present \- groff presentation macros +.SH SYNOPSIS +groff \-mm \-m\fBpresent\fP [\|\fIoptions\fP ...\|] [\|\fIfiles\fP ...\|] +.SH DESCRIPTION +The presentation macros are based upon the groff mm macros. +They are useful for making presentations with the use of a beamer, +but without use of the +.B PAUSE +macro, they can also be used for making slides. +.P +The post-processor +.BR presentps (1) +is needed for manipulation of the PostScript output of +.BR groff (1) +in order to make it a presentation. +.SH USAGE +A presentation can be made with the following commands. +.RS +% groff -mm -mpresent file.rof > file.pps +.br +% presentps -l < file.pps > file.ps +.br +% ps2pdf file.ps +.br +% acroread file.pdf +.br +.RE +.P +Slides can be made with the following command. +.RS +% groff -P-l -mm -mpresent file.rof > file.ps +.RE +.SS Macros +.TP +.BI ADDCONTENT " string" +Adds +.I string +to the contents which can be made with the macro +.BR END . +.TP +.BI BACKGROUND " args" +Defines the background to be used. +This macro should be invoked before the page is started. +A description of +.I args +is given below. +.br +Default: None +.RS +.TP +.BI Solid " color" +Makes a solid background. +.TP +.BI GradX " color1 color2" +Makes a gradient background in the x-direction from +.I color1 +to +.IR color2 . +.TP +.BI GradY " color1 color2" +Makes a gradient background in the y-direction from +.I color1 +to +.IR color2 . +.TP +.BI GradAngle " color1 color2 steps angle" +Makes a gradient background in a direction with an angle from +.I color1 +to +.IR color2 . +.TP +.B None +No background is made. +.RE +.TP +.BI BLOCKS " \fR[once] [\fPx \fR[\fPy \fR[\fPlength\fR]\fP" +A block is started with the upper right corner at +.IR x , y . +By omission of y and/or x the current coordinates are used. +If +.I length +is given, the line length is set to this. +If the first option is +.B once +this block only appears once, so after a +.B PAUSE +this block does not show up anymore. +.TP +.B BLOCKE +Ends a block. +The position is reset to the position before the block was started. +.TP +.BI COLOR " color \fR[\fParg1 \fR[\fParg2\fR]]\fP" +Sets the foreground color. +.I color +must be the name of a predefined color or a color defined +with the macro +.BR DEFCOLOR . +If +.I color +is P, the foreground color is set to the previous color. +If +.I arg1 +is given then only this is printed in the specified color. +If +.I arg2 +is given, this is put directly after +.I arg1 +in the current color. +.br +Default: black +(DEFCOLOR is mapped onto the groff request .defcolor.) +.TP +.BI DEFAULTCOLOR " color +Sets the default color for headers, footers, and text. +Use this macro after defining +.BR HEADER . +.br +Default: black +.TP +.BI DEFCOLOR " name red green blue" +Defines a color +.I name +with the values for red, green, and blue represented by the other +arguments. +These values must be between 0 and 1. +.br +See also subsection +.BR "Predefined colors" . +.TP +.BI DESTINATION " name" +Defines a destination +.I name +to which a link can be made. +.TP +.B END +Generates a contents page build up from the titles specified +with the macro +.B TITLE +and additional text specified by the macro +.BR ADDCONTENT . +.TP +.BI FILL " x1 y1 x2 y2 args" +Since the routines are there anyway for making the backgrounds, +we might as well use them for filling rectangles. +For a description of +.I args +see macro +.BR BACKGROUND . +.TP +.B FOOTER +If this macro is defined it is called at the bottom of the page. +.TP +.BI FOOTERSIZE " n" +Sets the size of the footer to +.IR n v. +For technical reasons the minimum is 2. +.br +Default: 3 +.TP +.B HEADER +If this macro is defined it is called at the top of the page. +.TP +.BI INITCOLOR " color +Sets the color for text. Should be used at the start of the presentation +instead of +.BI COLOR . +.br +Default: black +.TP +.BI LINK " name string" +Makes a link from +.I string +to the destination +.IR name . +.TP +.BI LINKCOLOR " color \fR[\fPborder-width \fR[\fPborder-color\fR]]\fP" +Sets the foreground color for the text of a link. +Optionally the width and the color of the border for the link can +also be set. +.br +Default: blue7 0 black +.TP +.BI MARGIN " left \fR[\fPright\fR]\fP" +Sets the left and right margins. +If +.I right +is not given, it is set equal to the left margin. +.br +Default: 0.75i +.TP +.B PAUSE +Pauses the presentation at this point. +.TP +.BI SUBTITLE " string" +Makes a subtitle in a way that can be specified with +.B SUBTITLEFORMAT +in a big font (smaller than with +.BR TITLE ) +in a color that can be specified with the macro +.BR SUBTITLECOLOR . +.TP +.BI SUBTITLECOLOR " name" +Sets the color of subtitles to +.IR name . +.br +Default: blue4 +.TP +.B SUBTITLEFORMAT L \fR|\fP C \fR|\fP R \fR|\fP I \fR[\fP\fIn\fP\fR]\fP +Sets the format for subtitles. +.br +Default: I +.RS +.TP +.B L +left adjusted +.TP +.B C +centered +.TP +.B R +right adjusted +.TP +.BI I " \fR[\fPn\fR]\fP +indented with indentation +.I n +if given (default 0.5i) +.RE +.TP +.BI TITLE " string" +Makes a title in a way that can be specified with the macro +.B TITLEFORMAT +in a big font in a color that can be specified with the macro +.BR TITLECOLOR . +.TP +.BI TITLECOLOR " name" +Sets the color of titles to +.IR name . +.br +Default: blue4 +.TP +.B TITLEFORMAT L \fR|\fP C \fR|\fP R \fR|\fP I \fR[\fP\fIn\fP\fR]\fP +Sets the format for titles. +.br +Default: C +.RS +.TP +.B L +left adjusted +.TP +.B C +centered +.TP +.B R +right adjusted +.TP +.BI I " \fR[\fPn\fR]\fP +indented with indentation +.I n +if given (default 0.5i) +.RE +.SS Strings +.TP +.BI \e*[col name ] +Changes the foreground color to +.IR name . +If +.I name +is P the foreground color is set to the previous color. +.br +.BR Deprecated : +use +.BI \em[ name ] +and +.B \em[] +instead. +.TP +.B \e*[subtitle] +Holds the last subtitle. +It is reset by the macro +.BR TITLE . +.TP +.B \e*[title] +Holds the last title. +.SS "Predefined colors" +The following colors are predefined: +.RS +red green blue cyan magenta yellow white black +.RE +The following colors are also predefined: +.RS +.RI red n +.RI green n +.RI blue n +.RI cyan n +.RI magenta n +.RI yellow n +.RI gray n +.RE +Where +.I n +is a number between 1 and 9 representing the intensity of the color. +.LP +.BR groff (1) +has some predefined colors of its own, which can also be used. +.SH FILES +.TP +.B .../groff/.../tmac/m.tmac +.TP +.B .../groff/.../tmac/present.tmac +.SH "SEE ALSO" +.BR groff (1), +.BR groff_mm (7), +.BR presentps (1), +.BR ps2pdf (1), +.BR acroread (1), +.BR groff_piclink (7) +.SH AUTHOR +Bob Diertens, diff --git a/piclink.pdf b/piclink.pdf new file mode 100644 index 0000000..af8551d Binary files /dev/null and b/piclink.pdf differ diff --git a/piclink.rof b/piclink.rof new file mode 100644 index 0000000..8aa2d63 --- /dev/null +++ b/piclink.rof @@ -0,0 +1,102 @@ +.fam H +.ft H +.de HEADER +.ft H +.sp -0.1i \" PSPIC takes to much space here +.PSPIC -L smile.epsf 0.5i +.sp -0.1i +\l'\\n[.l]u'\h'-\\n[.l]u' +.br +.mk R1 +.sp -0.4i +\h'0.6i'\s+8Demonstration of Presentations with Groff\ + and Acroread\s-8 +.sp |\\n(R1u +.br +.. +.de FOOTER +.ft H +\l'\\n[.l]u'\h'-\\n[.l]u' +.br +.tl '''%' +.. +.LINKCOLOR red 1 blue +.TITLE "The making of this demo" +.DS CB +.PS +linethick=1.5i +arrowwid=0.08 +boxwid=1.2i +ellipsewid=1.2i +down +PL: box "\m[blue]piclink.tmac\m[]" invis width 1.5i + move down 0.25i +X: [ +IN: box "piclink.rof" invis +PIC:box "\m[blue]picture\m[]" invis with .n at IN.s width 0.8i height 0.3i + move down 0.1i + ] + line dotted from X.nw to X.ne to X.se to X.sw to X.nw +MA: box "present.tmac" invis width 1.5i at X.IN + (2i,0) + arrow down from X.s +GR: box "groff" + arrow down + move down 0.1i + box "." "." "." invis + arrow from MA.sw to GR.ne + (-0.3i,0) + line from PL.s to X.n +LINK(L1,X.PIC) +LINK(L2,PL) + move to (GR.x + 1.3i, GR.y) + "groff -p -mm -mpresent \m[blue]piclink.tmac\m[] piclink.rof > piclink.pps" ljust +.PE +.DE +Clicking on a blue rectangle will take you to the linked page. +.P +.B Note : +The piclink macros are not loaded with a -m option. +That is because they need to processed by gpic to define the PIC macro. +.SK +.TITLE "PIC source" +.DESTINATION L1 +.VERBON 0 14 +\&.PS +linethick=1.5i +arrowwid=0.08 +boxwid=1.2i +ellipsewid=1.2i +down +PL: box "\\m[blue]piclink.tmac\\m[]" invis width 1.5i + move down 0.25i +X: [ +IN: box "piclink.rof" invis +PIC:box "\\m[blue]picture\\m[]" invis with .n at IN.s width 0.8i height 0.3i + move down 0.1i + ] + line dotted from X.nw to X.ne to X.se to X.sw to X.nw +MA: box "present.tmac" invis width 1.5i at X.IN + (2i,0) + arrow down from X.s +GR: box "groff" + arrow down + move down 0.1i + box "." "." "." invis + arrow from MA.sw to GR.ne + (-0.3i,0) + line from PL.s to X.n +\m[blue]LINK(L1,X.PIC)\m[] +\m[blue]LINK(L2,PL)\m[] + move to (GR.x + 1.3i, GR.y) + "groff -p -mm -mpresent \\m[blue]piclink.tmac\\m[] piclink.rof > piclink.pps" ljust +\&.PE +.VERBOFF +.SK +.TITLE PIC LINK macros +.DESTINATION L2 +The PIC macro +.VERBON 22 16 +LINK(name,object) +.VERBOFF +makes a link from \f[CR]object\f[] to the destination \f[CR]name\f[] +defined somewhere with the macro DESTINATION. +.P +\f[CR]object\f[] must be an indication of a box, circle, or ellipse, +but the link itself will always be a rectangle. diff --git a/piclink.tmac b/piclink.tmac new file mode 100644 index 0000000..e67afdb --- /dev/null +++ b/piclink.tmac @@ -0,0 +1,73 @@ +.\" Groff Presentation Macros +.\" date: October 5, 2002 +.\" version: 2.0 +.\" author: Bob Diertens, +.ig + Copyright (C) 2001, 2002 Bob Diertens + + This macro package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This macro package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this macro package; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +.. +.\"*** Initialisation +.\" depending on present.tmac +.if !r .mpresent \{\ +' tm ERROR: no present macros loaded +. ab "aborted" +.\} +.nr .mpiclink 1 +.\" Defaults +.\" *** PIC Links +.\" usage: LINKPIC x y width height label +.\" x,y is the position of the center of the rectangle +.\" used by piclink +.de LINKPIC +.gp-link@set +.nr gp-linkpic*w (\\$3) +.nr gp-linkpic*h (\\$4) +.nr gp-linkpic*x (\\$1)+\\n[.i]+\\n[.o]-\\n[gp-pic*x1]-(\\n[gp-linkpic*w]/2) +.nr gp-linkpic*y 0-(\\$2)+\\n[nl]-\\n[gp-pic*y2]+1v-(\\n[gp-linkpic*h]/2) +\X'ps: exec %%%%LINK \\n[gp-linkpic*x] \\n[gp-linkpic*y] \\n[gp-linkpic*w] \\n[gp-linkpic*h] \\$5'\c +.. +.\" define a macro for PIC +.\" usage: LINK name (box|circle|ellipse) +.PS +define LINK { +command "\!.LINKPIC " $2.c.x "i " $2.c.y "i " $2.wid "i " $2.ht "i $1 $3" +} +.PE +.\" Redefine PS so we can define a new PS that first read a comment-line +.\" left by gpic. +.\" The trick to read a comment-line is to define a macro \" and turning +.\" the escape mechanism off. +.\" The macro \" is created and removed every time a PS is encountered, so +.\" this trick does not process other comments and can be used elsewhere. +.rn PS NEWPS +.de PS +.ds gp-ps*w \\$1 +.ds gp-ps*h \\$2 +.de \\\\" +.ec +.nr gp-pic*x1 (i;\\\\$1) +.nr gp-pic*y1 (i;\\\\$2) +.nr gp-pic*x2 (i;\\\\$3) +.nr gp-pic*y2 (i;\\\\$4) +.NEWPS \\*[gp-ps*w] \\*[gp-ps*h] +.rm \\\\" +.\"ie d\\\\\\\\" .tm removed +.\"el .tm still there +\\.. +.\"ie d\\\\" .tm defined +.\"el .tm not defined +.eo +.. diff --git a/present.tmac b/present.tmac new file mode 100644 index 0000000..798c050 --- /dev/null +++ b/present.tmac @@ -0,0 +1,615 @@ +.\" Groff Presentation Macros +.\" date: October 5, 2002 +.\" version: 2.0 +.\" author: Bob Diertens, +.ig + Copyright (C) 2001, 2002 Bob Diertens + + This macro package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This macro package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this macro package; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +.. +.\"*** Initialisation +.\" depending on tmac.gm +.if !r .mgm \{\ +' tm ERROR: no mm macros loaded +. ab "aborted" +.\} +.nr .mpresent 1 +.\" Defaults +.VM 0 0 +.nr Hu 1 +.\"nr Ds 0 +.S +8 +.\"*** Page +.\"width: 10i height: 7.5i page-offset: 0.75i +.\"extra margin: 0.75i +.\"PGFORM 8.5i 7.50i 1.5i 1 +.\" we compensate for the extra footer-line with 0.24i. +.PGFORM 8.5i 7.74i 1.5i 1 +.\"usage: MARGIN left [right] +.de MARGIN +.po \\$1+0.75i +.nr @po \\n[.o] +.ie \\n[.$]>1 \{\ +. ll 10i-\\$2-\\$1 +.\} +.el \{\ +. ll (10i-(\\$1*2u)) +.\} +.nr @ll \\n[.l] +.lt \\n[@ll]u +.. +.\" *** Colors +.ds gp-col@default "black +.ds gp-col@prev "black +.ds gp-col@cur "black +.\" set the current color in the environments used by MM +.am misc@ev-keep +.mk gp-markvertical +\\m[\\*[gp-col@cur]] +.sp |\\n[gp-markvertical]u +.. +.\"usage: DEFAULTCOLOR color +.de DEFAULTCOLOR +.ds gp-col@default \\$1 +.ds gp-col@prev \\$1 +.ds gp-col@cur \\$1 +\\m[\\$1] +.. +.\"usage: INITCOLOR color +.\"for setting the color at the start (.COLOR color does not work) +.de INITCOLOR +.ds gp-col@prev \\$1 +.ds gp-col@cur \\$1 +\\m[\\$1] +.. +.\"usage: COLOR color arg1 [arg2] +.de COLOR +.ds gp-color \\$1 +.shift +.ie \\n[.$] \{\ +\\m[\\*[gp-color]]\ +\\&\\$1\ +\\m[\\*[gp-col@cur]]\c +. ie \\n[.$]=2 \{\ +\\&\\$2 +. \} +. el \\& +.\} +.el \{\ +. if '\\*[gp-color]'P' .ds gp-color \\*[gp-col@prev] +. ds gp-col@prev \\*[gp-col@cur] +. ds gp-col@cur \\*[gp-color] +\\m[\\*[gp-color]]\c +.\} +.. +.\"usage: DEFCOLOR name red green blue +.de DEFCOLOR +.ds gp-col!\\$1 "\\$2 \\$3 \\$4 +.defcolor \\$1 rgb \\$2 \\$3 \\$4 +.ds col\\$1 "\\m[\\$1] +.. +.ds colP "\\m[] +.DEFCOLOR red 1.0 0.0 0.0 +.DEFCOLOR green 0.0 1.0 0.0 +.DEFCOLOR blue 0.0 0.0 1.0 +.DEFCOLOR red9 0.9 0.0 0.0 +.DEFCOLOR green9 0.0 0.9 0.0 +.DEFCOLOR blue9 0.0 0.0 0.9 +.DEFCOLOR red8 0.8 0.0 0.0 +.DEFCOLOR green8 0.0 0.8 0.0 +.DEFCOLOR blue8 0.0 0.0 0.8 +.DEFCOLOR red7 0.7 0.0 0.0 +.DEFCOLOR green7 0.0 0.7 0.0 +.DEFCOLOR blue7 0.0 0.0 0.7 +.DEFCOLOR red6 0.6 0.0 0.0 +.DEFCOLOR green6 0.0 0.6 0.0 +.DEFCOLOR blue6 0.0 0.0 0.6 +.DEFCOLOR red5 0.5 0.0 0.0 +.DEFCOLOR green5 0.0 0.5 0.0 +.DEFCOLOR blue5 0.0 0.0 0.5 +.DEFCOLOR red4 0.4 0.0 0.0 +.DEFCOLOR green4 0.0 0.4 0.0 +.DEFCOLOR blue4 0.0 0.0 0.4 +.DEFCOLOR red3 0.3 0.0 0.0 +.DEFCOLOR green3 0.0 0.3 0.0 +.DEFCOLOR blue3 0.0 0.0 0.3 +.DEFCOLOR red2 0.2 0.0 0.0 +.DEFCOLOR green2 0.0 0.2 0.0 +.DEFCOLOR blue2 0.0 0.0 0.2 +.DEFCOLOR red1 0.1 0.0 0.0 +.DEFCOLOR green1 0.0 0.1 0.0 +.DEFCOLOR blue1 0.0 0.0 0.1 +.DEFCOLOR yellow 1.0 1.0 0.0 +.DEFCOLOR magenta 1.0 0.0 1.0 +.DEFCOLOR cyan 0.0 1.0 1.0 +.DEFCOLOR yellow9 0.9 0.9 0.0 +.DEFCOLOR magenta9 0.9 0.0 0.9 +.DEFCOLOR cyan9 0.0 0.9 0.9 +.DEFCOLOR yellow8 0.8 0.8 0.0 +.DEFCOLOR magenta8 0.8 0.0 0.8 +.DEFCOLOR cyan8 0.0 0.8 0.8 +.DEFCOLOR yellow7 0.7 0.7 0.0 +.DEFCOLOR magenta7 0.7 0.0 0.7 +.DEFCOLOR cyan7 0.0 0.7 0.7 +.DEFCOLOR yellow6 0.6 0.6 0.0 +.DEFCOLOR magenta6 0.6 0.0 0.6 +.DEFCOLOR cyan6 0.0 0.6 0.6 +.DEFCOLOR yellow5 0.5 0.5 0.0 +.DEFCOLOR magenta5 0.5 0.0 0.5 +.DEFCOLOR cyan5 0.0 0.5 0.5 +.DEFCOLOR yellow4 0.4 0.4 0.0 +.DEFCOLOR magenta4 0.4 0.0 0.4 +.DEFCOLOR cyan4 0.0 0.4 0.4 +.DEFCOLOR yellow3 0.3 0.3 0.0 +.DEFCOLOR magenta3 0.3 0.0 0.3 +.DEFCOLOR cyan3 0.0 0.3 0.3 +.DEFCOLOR yellow2 0.2 0.2 0.0 +.DEFCOLOR magenta2 0.2 0.0 0.2 +.DEFCOLOR cyan2 0.0 0.2 0.2 +.DEFCOLOR yellow1 0.1 0.1 0.0 +.DEFCOLOR magenta1 0.1 0.0 0.1 +.DEFCOLOR cyan1 0.0 0.1 0.1 +.DEFCOLOR black 0.0 0.0 0.0 +.DEFCOLOR gray1 0.1 0.1 0.1 +.DEFCOLOR gray2 0.2 0.2 0.2 +.DEFCOLOR gray3 0.3 0.3 0.3 +.DEFCOLOR gray4 0.4 0.4 0.4 +.DEFCOLOR gray5 0.5 0.5 0.5 +.DEFCOLOR gray6 0.6 0.6 0.6 +.DEFCOLOR gray7 0.7 0.7 0.7 +.DEFCOLOR gray8 0.8 0.8 0.8 +.DEFCOLOR gray9 0.9 0.9 0.9 +.DEFCOLOR white 1.0 1.0 1.0 +.\"*** Backgrounds +.nr gp-bg*x1 54 +.nr gp-bg*y1 12 +.nr gp-bg*x2 774 +.\"nr gp-bg*x2 828 +.nr gp-bg*y2 552 +.\"nr gp-bg*y2 560 +.de FillSolid +ps: def +/FillSolid { + /y2 exch def + /x2 exch def + /y1 exch def + /x1 exch def + gsave + x1 y1 moveto + x2 y1 lineto + x2 y2 lineto + x1 y2 lineto + closepath + setrgbcolor + fill + grestore +} bind def +.. +.de FillGradX +ps: def +/FillGradX { + /y2 exch def + /x2 exch def + /y1 exch def + /x1 exch def + /blue2 exch def + /green2 exch def + /red2 exch def + /blue1 exch def + /green1 exch def + /red1 exch def + /step 2 def + /nrsteps x2 x1 sub step div def + /incrred red2 red1 sub nrsteps div def + /incrgreen green2 green1 sub nrsteps div def + /incrblue blue2 blue1 sub nrsteps div def + gsave + x1 step x2 { + /x exch def + x y1 moveto + x y2 lineto + x step sub y2 lineto + x step sub y1 lineto + closepath + red1 green1 blue1 setrgbcolor fill + /red1 red1 incrred add def + /green1 green1 incrgreen add def + /blue1 blue1 incrblue add def + } for + grestore +} bind def +.. +.de FillGradY +ps: def +/FillGradY { + /y2 exch def + /x2 exch def + /y1 exch def + /x1 exch def + /blue2 exch def + /green2 exch def + /red2 exch def + /blue1 exch def + /green1 exch def + /red1 exch def + /step 2 def + /nrsteps y2 y1 sub step div def + /incrred red2 red1 sub nrsteps div def + /incrgreen green2 green1 sub nrsteps div def + /incrblue blue2 blue1 sub nrsteps div def + gsave + y1 step y2 { + /y exch def + x1 y moveto + x2 y lineto + x2 y step sub lineto + x1 y step sub lineto + closepath + red1 green1 blue1 setrgbcolor fill + /red1 red1 incrred add def + /green1 green1 incrgreen add def + /blue1 blue1 incrblue add def + } for + grestore +} bind def +.. +.de FillGradAngle +ps: def +/setupgradfill { % sr sg sb er eg eb steps angle + rotate + /numsteps exch def + % String to hold synthetic data + /gradstr numsteps 3 mul string def + 3 index sub numsteps div /ib exch def + 3 index sub numsteps div /ig exch def + 3 index sub numsteps div /ir exch def + /sb exch def + /sg exch def + /sr exch def + + %(SR SG SB: ) print sr == sb == sg == + %(IR IG IB: ) print ir == ib == ig == + + % Create a synthetic data string + 0 1 numsteps 1 sub { % loop + 3 mul % index + gradstr 1 index sr 255 mul round cvi put + gradstr 1 index 1 add sg 255 mul round cvi put + gradstr 1 index 2 add sb 255 mul round cvi put + pop + /sr sr ir add def + /sg sg ig add def + /sb sb ib add def + } for +} bind def + +/convbboxtoxywh { % llx lly urx ury + 2 index sub exch 3 index sub exch +} bind def + +/gradmatrix matrix def + +/gradfill { +% startred startgreen startblue endred endgreen endblue steps angle + save /mysave exch def + setupgradfill + pathbbox clip convbboxtoxywh % x y w h + 0 0 3 -1 roll 6 -2 roll % w 0 0 h x y + gradmatrix astore concat + numsteps 1 8 [numsteps 0 0 1 0 0] + { + gradstr + } + false 3 colorimage + mysave restore +} bind def + +% Fill the whole page +/FillGradAngle { + /y2 exch def + /x2 exch def + /y1 exch def + /x1 exch def + gsave + x1 y1 moveto + x1 y2 lineto + x2 y2 lineto + x2 y1 lineto + closepath + gradfill + grestore +} bind def +.. +.nr gp-bg*set 0 +.nr gp-bg*defSolid 0 +.nr gp-bg*defGradX 0 +.nr gp-bg*defGradXS 0 +.nr gp-bg*defGradY 0 +.nr gp-bg*defGradAngle 0 +.\"usage: BACKGROUND method args +.de BACKGROUND +.ie '\\$1'None' .nr gp-bg*set 0 +.el \{\ +. ds gp-bg*method \\$1 +. nr gp-bg*set 1 +. ie '\\$1'Solid' .ds gp-bg*args "\\*[gp-col!\\$2] +. el \{\ +. shift +. ds gp-bg*args "\\*[gp-col!\\$1] \\*[gp-col!\\$2] +. shift +. shift +. as gp-bg*args " \\$* +. \} +. as gp-bg*args " \\n[gp-bg*x1] \\n[gp-bg*y1] \\n[gp-bg*x2] \\n[gp-bg*y2] +.\} +.. +.de gp-fill*define +.if !\\n[gp-bg*def\\$1] \{\ +\Y[Fill\\$1] +. nr gp-bg*def\\$1 1 +.\} +.. +.de gp-fill*background +.if \\n[gp-bg*set] \{\ +. gp-fill*define \\*[gp-bg*method] +\\X'ps: exec \\*[gp-bg*args] Fill\\*[gp-bg*method]' +.\} +.. +.\"usage: FILL x1 y1 x2 y2 method args +.de FILL +.nr gp-fill*x1 (\\$1)/1p+\\n[gp-bg*x1] +.nr gp-fill*y1 (\\$2)/1p+\\n[gp-bg*y1] +.nr gp-fill*x2 (\\$3)/1p+\\n[gp-bg*x1] +.nr gp-fill*y2 (\\$4)/1p+\\n[gp-bg*y1] +.shift 4 +.ds gp-fill*method \\$1 +.ie '\\$1'Solid' .ds gp-fill*args "\\*[gp-col!\\$2] +.el \{\ +. shift +. ds gp-fill*args "\\*[gp-col!\\$1] \\*[gp-col!\\$2] +. shift 2 +. as gp-fill*args " \\$* +.\} +.as gp-fill*args " \\n[gp-fill*x1] \\n[gp-fill*y1] \\n[gp-fill*x2] \\n[gp-fill*y2] +.gp-fill*define \\*[gp-fill*method] +\X'ps: exec \\*[gp-fill*args] Fill\\*[gp-fill*method]'\c +.. +.\" *** Header +.de TP +.ev gp-top +.ll \\n[@ll]u +.lt \\n[@ll]u +.gp-fill*background +.COLOR \\*[gp-col@default] +.ie d HEADER .HEADER +.el .sp 0.1i +.COLOR P +\X'ps: exec %%%%ENDTOP' +.sp -0.10i +.ev +.. +.\" *** Footer +.de EOP +.ev gp-bop +.ll \\n[@ll]u +.lt \\n[@ll]u +\X'ps: exec %%%%BEGINBOT'\c +.COLOR \\*[gp-col@default] +.sp |\\n[footer*start]u +.if d FOOTER .FOOTER +.COLOR P +.br +.ev +.. +.\" *** Presentation Macros +.\" minimum for footer-size is 2 +.\"usage: FOOTERSIZE n +.de FOOTERSIZE +.nr pg*footer-size (v;\\$1) +.nr footer*start \\n[.p]-(\\n[pg*footer-size]-1v) +.pg@move-trap +.. +.FOOTERSIZE 3 +.\"usage: PAUSE +.de PAUSE +\X'ps: exec %%%%PAUSE'\c +.. +.\"usage: BLOCKS [once] [x [y [length]] +.de BLOCKS +.nr gp-block*once 0 +.if '\\$1'once' \{\ +. nr gp-block*once 1 +. shift +.\} +.\"\X'ps:exec %%%%PAUSE'\c +.if \\n[gp-block*once] \X'ps:exec %%%%BEGINONCE'\c +.nr gp-block*po \\n[@po]u +.nr gp-block*ll \\n[@ll]u +.mk gp-BLOCKS +.if \\n[.$]>=2 .sp |(v;\\$2) +.if \\n[.$]>=1 \{\ +. po +\\$1 +. ie \\n[.$]=3 .ll \\$3 +. el .ll (n;\\n[@ll]u-\\$1) +.\} +.. +.de BLOCKE +.br +.po \\n[gp-block*po]u +.ll \\n[gp-block*ll]u +.sp |\\n[gp-BLOCKS]u +.if \\n[gp-block*once] \X'ps:exec %%%%ENDONCE'\c +.\"\X'ps:exec %%%%PAUSE'\c +.. +.ds gp-title*color blue4 +.ds gp-subtitle*color blue4 +.ds gp-title +.ds gp-subtitle +.ds gp-title*format C +.nr gp-title*defindent 0.5i +.nr gp-title*indent \n[gp-title*defindent] +.ds gp-subtitle*format I +.nr gp-subtitle*defindent 0.5i +.nr gp-subtitle*indent \n[gp-subtitle*defindent] +.\"usage: TITLECOLOR color +.de TITLECOLOR +.ds gp-title*color \\$1 +.. +.\"usage: TITLEFORMAT C | L | R | I x +.de TITLEFORMAT +.ds gp-title*format \\$1 +.if '\\$1'I' \{\ +. ie \\n[.$]>=2 .nr gp-title*indent \\$2 +. el .nr gp-title*indent \\n[gp-title*defindent] +.\} +.. +.\"usage: TITLE title +.de TITLE +.SP 0.25i +.S +8 +.if '\\*[gp-title*format]'C' 'ce 99 +.if '\\*[gp-title*format]'L' 'in 0 +.if '\\*[gp-title*format]'R' 'rj 99 +.if '\\*[gp-title*format]'I' 'in \\n[gp-title*indent]u +.COLOR \\*[gp-title*color] "\\$*" +.if '\\*[gp-title*format]'C' 'ce 0 +.if '\\*[gp-title*format]'L' 'in +.if '\\*[gp-title*format]'R' 'rj 0 +.if '\\*[gp-title*format]'I' 'in +.S -8 +.SP 0.3i +.ds gp-title "\\$1 +.ds gp-subtitle +.ADDCONTENT "\\$*" +.. +.\"usage: SUBTITLECOLOR color +.de SUBTITLECOLOR +.ds gp-subtitle*color \\$1 +.. +.\"usage: SUBTITLEFORMAT C | L | R | I x +.de SUBTITLEFORMAT +.ds gp-subtitle*format \\$1 +.if '\\$1'I' \{\ +. ie \\n[.$]>=2 .nr gp-subtitle*indent \\$2 +. el .nr gp-subtitle*indent \\n[gp-subtitle*defindent] +.\} +.. +.\"usage: SUBTITLE title +.de SUBTITLE +.SP 0.2i +.S +4 +.if '\\*[gp-subtitle*format]'C' 'ce 99 +.if '\\*[gp-subtitle*format]'L' 'in 0 +.if '\\*[gp-subtitle*format]'R' 'rj 99 +.if '\\*[gp-subtitle*format]'I' 'in \\n[gp-subtitle*indent]u +.COLOR \\*[gp-subtitle*color] "\\$* +.if '\\*[gp-subtitle*format]'C' 'ce 0 +.if '\\*[gp-subtitle*format]'L' 'in +.if '\\*[gp-subtitle*format]'R' 'rj 0 +.if '\\*[gp-subtitle*format]'I' 'in +.S -4 +.SP 0.20i +.ds gp-subtitle "\\$1 +.. +.\"*** Contents +.\"usage: ADDCONTENT text +.de ADDCONTENT +.am gp-toc*list +.gp-content*set "\\$1" \\n[%] +\\.. +.. +.de gp-content*set +.na +.fi +.nr gp-collength (\\n[@ll]u*7u)/15u +.ll \\n[gp-collength]u-\w'\\$2'u-2m +.ne 2v +.nr gp-set*oldnl \\n[nl] +\\$1\h'1m' +.ll \\n[gp-collength]u +.sp -1 +.nr gp-sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w'\\$2')-1m +\h'|\\n[.n]u'\l'\\n[gp-sep]u.'\h'1m'\\$2\c +.nr gp-set*x \\n[.o]-2p +.nr gp-set*w \\n[.l]+4p +.nr gp-set*h (\\n[nl]-\\n[gp-set*oldnl])+\\n[.v] +.nr gp-set*y \\n[nl]-(\\n[nl]-\\n[gp-set*oldnl])+(\\n[.v]/4) +\X'ps: exec %%%%LINK \\n[gp-set*x] \\n[gp-set*y] \\n[gp-set*w] \\n[gp-set*h] \\$2' +.ll \\n[@ll]u +.. +.de END +.if \\n[pg*cols-per-page]>1 .1C 1 +.rm HEADER +.SK +.MARGIN 0.75i 0.75i +.rm FOOTER +.S -8 +\X'ps: exec %%%%CONTENTS'\c +\X'ps: def %%%%HASCONTENTS'\c +.ce +\\*[Licon] +.br +.SP 3 +.2C +.COLOR \\*[gp-link*color] +.if d gp-toc*list .gp-toc*list +.COLOR P +.. +.\" *** Links +.ds gp-link*color blue7 +.\" usage: LINK name string +.de LINK +.gp-link@set +.nr gp-link*x1 \\n[.k] +.nr gp-link*y1 \\n[nl]+(\\n[.v]/4) +.COLOR \\*[gp-link*color] "\\$2" +.nr gp-link*x2 \\n[.k]-2p +.nr gp-link*y2 \\n[nl]+(\\n[.v]/4) +.ie \\n[gp-link*y1]=\\n[gp-link*y2] \{\ +. nr gp-link*x1 -2p +. nr gp-link*w \\n[gp-link*x2]-\\n[gp-link*x1] +. nr gp-link*x1 +\\n[.o] +\X'ps: exec %%%%LINK \\n[gp-link*x1] \\n[gp-link*y1] \\n[gp-link*w] \\n[.v] \\$1'\c +.\} +.el \{\ +. nr gp-link*x1 +2p +. nr gp-link*w \\n[.l]-\\n[gp-link*x1]+2p +. nr gp-link*x1 +\\n[.o] +\X'ps: exec %%%%LINK \\n[gp-link*x1] \\n[gp-link*y1] \\n[gp-link*w] \\n[.v] \\$1'\c +. nr gp-link*w \\n[gp-link*x2]+2p +. nr gp-link*x1 \\n[.o]-2p +\X'ps: exec %%%%LINK \\n[gp-link*x1] \\n[gp-link*y2] \\n[gp-link*w] \\n[.v] \\$1'\c +.\} +.. +.\" usage: DESTINATION name +.de DESTINATION +\X'ps: exec %%%%DEST \\$1 \\n[%]'\c +.. +.nr gp-link*changed 0 +.\" usage: LINKCOLOR color [border-width [border-color]] +.de LINKCOLOR +.ds gp-link*color \\$1 +.if \\n[.$]>1 \{\ +. ds gp-link*opt "\\$2 +. if \\n[.$]>2 .as gp-link*opt " \\*[gp-col!\\$3] +. nr gp-link*changed 1 +.\} +.. +.de gp-link@set +.if \\n[gp-link*changed] \{\ +\X'ps: exec %%%%LINKOPTIONS \\*[gp-link*opt]'\c +. nr gp-link*changed 0 +.\} +.. diff --git a/presentps b/presentps new file mode 100755 index 0000000..a547eb0 --- /dev/null +++ b/presentps @@ -0,0 +1,444 @@ +#!/usr/bin/perl + +# presentps - make a presentation from PostScript input +# +# Author: Bob Diertens, +# Date: January 10, 2000 +# Version: 1.0 +# Date: August 19, 2003 +# Version: 1.1 +# Adjusted for groff 1.18.2. +# Date: November 6, 2003 +# Version: 1.2 +# Bug in detecting EBEGIN before %%%%ENDTOP +# Date: Februari 26, 2004 +# Version: 1.3 +# Changed the View type for links to prevent changing of the fitting +# for wide-screens. +# +# Copyright (C) 2001 Bob Diertens +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# commandline +sub usage { + die "usage: $0 [-l] [-lc ul|ur|ll|lr] [-p A4|letter]\n"; +} + +$sun = 0; +$page = A4; +$pageoption = 0; +$links = 0; +$linkscorner = "lr"; +while ($_ = $ARGV[0], /^-/) { + shift; + if (/^-S$/) { + $sun = 1; + } elsif (/^-p$/) { + $page = shift; + $pageoption = 1; + } elsif (/^-l$/) { + $links = 1; + } elsif (/^-lc$/) { + $linkscorner = shift; + } else { + &usage; + } +} + +### + +$lastpage = 0; +$hascontents = 0; + +$linkbw = 0; +$linkred = 0; +$linkgreen = 0; +$linkblue = 0; + +$browsebw = 1; +$browsered = 0; +$browsegreen = 0; +$browseblue = 0; + +sub PrintLink { + my $prev = shift; + my $next = shift; + my $x; + my $y; + + if (! $links) { + return; + } + # ulx and uly should be related to the pagesize and cropping + if ($linkscorner eq "ul") { + $ulx = 58; + $uly = 16; + } elsif ($linkscorner eq "ur") { + $ulx = 740; + $uly = 16; + } elsif ($linkscorner eq "ll") { + $ulx = 58; + $uly = 538; + } elsif ($linkscorner eq "lr") { + $ulx = 740; + $uly = 538; + } + if ($prev) { + $tx = $ulx + 2.5; + $ty = $uly + 8; + $lrx = $ulx + 10; + $lry = $uly + 10; + print "/F0 8/Helvetica-Bold\@0 SF(<) $tx $ty Q\n"; + print "[/Rect [$ulx $uly $lrx $lry]\n"; + # round corners with Border do not work + print "/Border [0 0 $browsebw]\n"; + # /Color does not work + print "/C [$browsered $browsegreen $browseblue]\n"; + print "/Page $prev\n"; + print "/Subtype /Link\n"; + print "/View [/Fit]\n"; + print "/ANN pdfmark\n"; + } + $ulx += 10; + if (! $lastpage) { + $tx = $ulx + 2.5; + $ty = $uly + 8; + $lrx = $ulx + 10; + $lry = $uly + 10; + print "/F0 8/Helvetica-Bold\@0 SF(>) $tx $ty Q\n"; + print "[/Rect [$ulx $uly $lrx $lry]\n"; + print "/Border [0 0 $browsebw]\n"; + print "/C [$browsered $browsegreen $browseblue]\n"; + print "/Page $next\n"; + print "/Subtype /Link\n"; + print "/View [/Fit]\n"; + print "/ANN pdfmark\n"; + } + $ulx += 10; + if ($hascontents && ! $lastpage) { +# print "/F0 8/Times-Bold\@0 SF(i) 763.5 546.0 Q\n"; + $tx = $ulx + 2.5; + $ty = $uly + 7.5; + $lrx = $ulx + 10; + $lry = $uly + 10; + print "/F0 8/Helvetica-Bold\@0 SF(c) $tx $ty Q\n"; + print "[/Rect [$ulx $uly $lrx $lry]\n"; + print "/Border [0 0 $browsebw]\n"; + print "/C [$browsered $browsegreen $browseblue]\n"; + print "/Dest /LinkIndex\n"; + print "/Subtype /Link\n"; + print "/View [/Fit]\n"; + print "/ANN pdfmark\n"; + } +} + +sub PrintLinkIndex { + my $page = shift; + my $total = shift; + + print "%%Page: $page $total\n"; + print "BP\n"; + print "%%EndPageSetup\n"; + print "[/Dest /LinkIndex\n"; + print "/Page $total\n"; + print "/View [/Fit]\n"; + print "/DEST pdfmark\n"; + print "EP\n"; +} + +sub PrintTop { + foreach $l (@top) { + print $l; + } +} + +sub PrintBottom { + print "gsave\n"; + foreach $l (@bottom) { + print $l; + } + print "grestore\n"; +} + +# print a page (top bottom text) +# when a pause is found, end page, make a new page with same contents +# and continue + +$pagetotal = 0; +$lastpagestart = 0; + +sub PrintPage { + my $pnr = shift; + my $nrpause = shift; + my $once = 0; + my $prev; + my $next; + my $dest; + + $prev = $lastpagestart; + $pagetotal ++; + $lastpagestart = $pagetotal; + $next = $pagetotal + 1 + $nrpause; + $index[$pnr] = $pagetotal; + print "%%Page: $pnr $pagetotal\n"; + PrintTop; +# PrintLink($prev, $next); + PrintBottom; + @t = (); + foreach $l (@text) { + if ($l =~ /^%%%%PAUSE$/) { + PrintLink($prev, $next); + print "EP\n"; + $pagetotal ++; + print "%%Page: $pnr $pagetotal\n"; + PrintTop; +# PrintLink($prev, $next); + PrintBottom; + foreach $tl (@t) { + print $tl; + } + } elsif ($l =~ /^%%%%BEGINONCE$/) { + $once = 1; + } elsif ($l =~ /^%%%%ENDONCE$/) { + $once = 0; + } elsif ($l =~ /^%%%%CONTENTS$/) { + print "[/Dest /LinkIndex\n"; + print "/Page $pagetotal\n"; + print "/View [/Fit]\n"; + print "/DEST pdfmark\n"; + } elsif ($l =~ /^%%%%LINK (\S+) (\S+) (\S+) (\S+) (\S+)$/) { + $llx = $1 / 1000; + $lly = $2 / 1000; + $urx = $llx + ($3 / 1000); + $ury = $lly + ($4 / 1000); + print "[/Rect [$llx $lly $urx $ury]\n"; + print "/Border [0 0 $linkbw]\n"; + print "/C [$linkred $linkgreen $linkblue]\n"; + $dest = $5; + if ($dest =~ /^\d+$/) { + print "/Page $index[$dest]\n"; + } else { + print "/Dest /link$dest\n"; + } + print "/Subtype /Link\n"; + print "/View [/Fit]\n"; + print "/ANN pdfmark\n"; + } elsif ($l =~ /^%%%%LINKOPTIONS (\S+)$/) { + $linkbw = $1; + } elsif ($l =~ /^%%%%LINKOPTIONS (\S+) (\S+) (\S+) (\S+)$/) { + $linkbw = $1; + $linkred = $2; + $linkgreen = $3; + $linkblue = $4; + } elsif ($l =~ /^%%%%DEST (\S+) (\S+)$/) { + print "[/Dest /link$1\n"; + print "/Page $index[$2]\n"; + print "/View [/Fit]\n"; + print "/DEST pdfmark\n"; + } else { + if (! $once) { + push @t, $l; + } + print $l; + } + } + PrintLink($prev, $next); + print "EP\n"; +} + +# split page in top text and bottom and call PrintPage +sub Page { + my $pln = shift; + my $nrpause = 0; + + @top = (); + @text = (); + @bottom = (); + while ($l = shift @page) { + if ($l =~ / EBEGIN$/ || $l =~ /^EBEGIN$/) { + $nl = shift @page; + if ($nl =~ /^%%%%ENDTOP$/) { + shift @page; + last; + } else { + push @top, $l; + push @top, $nl; + push @top, shift @page; + } + } else { + push @top, $l; + } + } + while ($l = shift @page) { + if ($l =~ / EBEGIN$/ || $l =~ /^EBEGIN$/) { + $nl = shift @page; + if ($nl =~ /^%%%%PAUSE$/) { + push @text, $nl; + shift @page; + $nrpause ++; + } elsif ($nl =~ /^%%%%BEGINONCE$/) { + push @text, $nl; + shift @page; + } elsif ($nl =~ /^%%%%ENDONCE$/) { + push @text, $nl; + shift @page; + } elsif ($nl =~ /^%%%%BEGINBOT$/) { + shift @page; + last; + } else { + push @text, $l; + push @text, $nl; + push @text, shift @page; + } + } elsif ($l =~ /^EP$/) { # there is no BEGINBOT + last; + } else { + push @text, $l; + } + } + while ($l = shift @page) { + if ($l =~ /^EP$/) { + last; + } + push @bottom, $l; + } + $pln =~ /%%Page: (\d+) /; + $pagenr = $1; + PrintPage($pagenr, $nrpause); +} + +### + +# read header and find pagelength + +@pre = (); +while (<>) { + if (/^%%Page:/) { + $nextln = $_; + last; + } elsif (/^%%Pages:/) { + push @pre, "%%Pages: (Atend)\n"; + } elsif (/^%%%%HASCONTENTS/) { + $hascontents = 1; + } elsif (/\/PL (\S+) /) { + $pagelength = $1; + push @pre, $_; + } else { + push @pre, $_; + } +} + +if (defined $pagelength && ! $pageoption) { + if ($pagelength == 792) { + $page = "letter"; + } elsif ($pagelength == 841.89) { + $page = "A4"; + } +} + +# set crop sizes +# default for A4 on 1024x768 +$w = 720; +$h = 540; +$ox = 54; # 0.75 inch +$oy = 290; +if ($sun) { # A4 on 1152x900 + $h = 562; + $oy = 260; +} +if ($page ne "A4") { # assume letter + $oy -= 50; +} + +# print header +$cropdone = 0; +$skip = 0; +foreach (@pre){ + if ($skip) { + $skip --; + next; + } + if (!$cropdone && /^%%EndComments/) { + print "%%%%BeginFeature: PageSize w", ${w} + $ox, "h", ${h} + $oy, "\n"; + print "<> setpagedevice\n"; + print "%%EndFeature\n"; + print "[/CropBox [$ox $oy ", $w + $ox, " ", $h + $oy, "]\n"; + print "/PAGES pdfmark\n"; + $cropdone = 1; + print "[/PageMode /FullScreen\n"; + print "/DOCVIEW pdfmark\n"; + print; + } elsif (/^%%BeginFeature: \*PageSize Default/) { + $skip = 2; + } else { + print; + } +} + +# read pages and straighten them +# print a page when found +while (<>) { + $pageln = $nextln; + @page = (); + while (<>) { + if (/^EEND /) { + push @page, "EEND\n"; + s/^EEND //; + redo; + } elsif (/^EEND\//) { + push @page, "EEND\n"; + s/^EEND//; + redo; + } elsif (/ ((\d|\.)+) ((\d|\.)+) EBEGIN$/) { + $d1 = $1; $d2 = $3; + s/ $d1 $d2 EBEGIN$//; + push @page, $_; + push @page, "$d1 $d2 EBEGIN\n"; + } elsif (/^((\d|\.)+) ((\d|\.)+) EBEGIN$/) { + $d1 = $1; $d2 = $3; + s/^$d1 $d2 EBEGIN$//; + # push @page, $_; + push @page, "$d1 $d2 EBEGIN\n"; + } elsif (/ EP$/) { + s/ EP$//; + push @page, $_; + push @page, "EP\n"; + } elsif (/^%%Trailer$/) { + $lastpage = 1; + $nextln = $_; + last; + } elsif (/^%%Page:/) { + $nextln = $_; + last; + } else { + push @page, $_; + } + } + Page($pageln); + if ($nextln =~ /^%%Trailer$/) { + last; + } +} + +#$pagetotal ++; +#PrintLinkIndex("i", $pagetotal); + +# read an print trailer +print $nextln; +print "%%Pages: $pagetotal\n"; +while (<>) { + print; +} diff --git a/presentps.1 b/presentps.1 new file mode 100644 index 0000000..335a1c5 --- /dev/null +++ b/presentps.1 @@ -0,0 +1,42 @@ +.TH PRESENTPS 1 "January 28, 2001" +.SH NAME +presentps \- post-processor for the groff presentation macros +.SH SYNOPSIS +.B presentps +[\|-l\|] [\|-lc \fIcorner\fP\|] [\|-p \fIsize\fP\|] +.SH DESCRIPTION +.B Presentps +manipulates the PostScript output of +.BR groff (1) +made with the use of the presentation macros +.RB ( groff_present (1)). +The presentation macros put comments in the PostScript upon which +.B presentps +acts. +.SH OPTIONS +.TP +.B \-l +Links to the previous, next, and contents page are created in the +lower right corners of the pages. +.TP +.BI \-lc " corner" +Specifies in which corner the links must be put. +.I corner +can be ul (upper left), ur (upper right), ll (lower left), or lr +(lower right). +.br +Default: lr +.TP +.BI \-p " size" +Forces the size of the pages to +.IR size . +Normally the size is detected in the input. +.I size +can be either A4 or letter. +.SH "SEE ALSO" +.BR groff (1), +.BR groff_present (7), +.BR ps2pdf (1), +.BR acroread (1) +.SH AUTHOR +Bob Diertens, diff --git a/sidebar.pdf b/sidebar.pdf new file mode 100644 index 0000000..e5d54e2 Binary files /dev/null and b/sidebar.pdf differ diff --git a/sidebar.rof b/sidebar.rof new file mode 100644 index 0000000..0072f5a --- /dev/null +++ b/sidebar.rof @@ -0,0 +1,69 @@ +.fam H +.ft H +.MARGIN 1.2i 0.3i +.DEFCOLOR BG 0.2 0.9 0.2 +.de HEADER +.ft H +.FILL 0i 0i 1i 7.5i GradY BG white +.BLOCKS -1.2i 0.2i 1.0i +.PSPIC smile.epsf 0.5i +.sp 0.1i +.ce 9 +\v'-0.5m'\l'0.8i'\v'0.5m' +Demonstration +of +Presentations +with +Groff +and +Acroread +\l'0.8i' +.BLOCKE +.sp 0.2i +.. +.de FOOTER +.BLOCKS -1.2i 7.42i 1.0i +.ft H +.lt 1.0i +.tl '''%\ ' +.BLOCKE +.. +.TITLE "Sidebar as Header" +.SUBTITLE "Initialization" +.VERBON 22 16 +\&.MARGIN 1.2i 0.3i +.VERBOFF +.SUBTITLE "Header" +.VERBON 22 16 +\&.DEFCOLOR BG 0.2 0.9 0.2 +\&.de HEADER +\&.ft H +\&.FILL 0i 0i 1i 7.5i GradY BG white +\&.BLOCKS -1.2i 0.2i 1.0i +\&.PSPIC smile.epsf 0.5i +\&.sp 0.1i +\&.ce 9 +\\v'-0.5m'\\l'0.8i'\\v'0.5m' +Demonstration +of +Presentations +with +Groff +and +Acroread +\\l'0.8i' +\&.BLOCKE +\&.sp 0.2i +\&.. +.VERBOFF +.SK +.SUBTITLE "Footer" +.VERBON 22 16 +\&.de FOOTER +\&.BLOCKS -1.2i 7.42i 1.0i +\&.ft H +\&.lt 1.0i +\&.tl '''%\\' +\&.BLOCKE +\&.. +.VERBOFF diff --git a/smile.epsf b/smile.epsf new file mode 100644 index 0000000..9532e26 --- /dev/null +++ b/smile.epsf @@ -0,0 +1,353 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Tk Canvas Widget +%%For: Bob Diertens,F.240,+31 20 525 7593,, +%%Title: Window .anim.frcanvas.frc.ca +%%CreationDate: Wed Nov 22 15:12:46 2000 +%%BoundingBox: 239 329 373 463 +%%Pages: 1 +%%DocumentData: Clean7Bit +%%Orientation: Portrait +%%EndComments + +%%BeginProlog +50 dict begin + +% This is a standard prolog for Postscript generated by Tk's canvas +% widget. +% SCCS: @(#) prolog.ps 1.7 96/07/08 17:52:14 + +% The definitions below just define all of the variables used in +% any of the procedures here. This is needed for obscure reasons +% explained on p. 716 of the Postscript manual (Section H.2.7, +% "Initializing Variables," in the section on Encapsulated Postscript). + +/baseline 0 def +/stipimage 0 def +/height 0 def +/justify 0 def +/lineLength 0 def +/spacing 0 def +/stipple 0 def +/strings 0 def +/xoffset 0 def +/yoffset 0 def +/tmpstip null def + +% Define the array ISOLatin1Encoding (which specifies how characters are +% encoded for ISO-8859-1 fonts), if it isn't already present (Postscript +% level 2 is supposed to define it, but level 1 doesn't). + +systemdict /ISOLatin1Encoding known not { + /ISOLatin1Encoding [ + /space /space /space /space /space /space /space /space + /space /space /space /space /space /space /space /space + /space /space /space /space /space /space /space /space + /space /space /space /space /space /space /space /space + /space /exclam /quotedbl /numbersign /dollar /percent /ampersand + /quoteright + /parenleft /parenright /asterisk /plus /comma /minus /period /slash + /zero /one /two /three /four /five /six /seven + /eight /nine /colon /semicolon /less /equal /greater /question + /at /A /B /C /D /E /F /G + /H /I /J /K /L /M /N /O + /P /Q /R /S /T /U /V /W + /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore + /quoteleft /a /b /c /d /e /f /g + /h /i /j /k /l /m /n /o + /p /q /r /s /t /u /v /w + /x /y /z /braceleft /bar /braceright /asciitilde /space + /space /space /space /space /space /space /space /space + /space /space /space /space /space /space /space /space + /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent + /dieresis /space /ring /cedilla /space /hungarumlaut /ogonek /caron + /space /exclamdown /cent /sterling /currency /yen /brokenbar /section + /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen + /registered /macron + /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph + /periodcentered + /cedillar /onesuperior /ordmasculine /guillemotright /onequarter + /onehalf /threequarters /questiondown + /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla + /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex + /Idieresis + /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply + /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn + /germandbls + /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla + /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex + /idieresis + /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide + /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn + /ydieresis + ] def +} if + +% font ISOEncode font +% This procedure changes the encoding of a font from the default +% Postscript encoding to ISOLatin1. It's typically invoked just +% before invoking "setfont". The body of this procedure comes from +% Section 5.6.1 of the Postscript book. + +/ISOEncode { + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding ISOLatin1Encoding def + currentdict + end + + % I'm not sure why it's necessary to use "definefont" on this new + % font, but it seems to be important; just use the name "Temporary" + % for the font. + + /Temporary exch definefont +} bind def + +% StrokeClip +% +% This procedure converts the current path into a clip area under +% the assumption of stroking. It's a bit tricky because some Postscript +% interpreters get errors during strokepath for dashed lines. If +% this happens then turn off dashes and try again. + +/StrokeClip { + {strokepath} stopped { + (This Postscript printer gets limitcheck overflows when) = + (stippling dashed lines; lines will be printed solid instead.) = + [] 0 setdash strokepath} if + clip +} bind def + +% desiredSize EvenPixels closestSize +% +% The procedure below is used for stippling. Given the optimal size +% of a dot in a stipple pattern in the current user coordinate system, +% compute the closest size that is an exact multiple of the device's +% pixel size. This allows stipple patterns to be displayed without +% aliasing effects. + +/EvenPixels { + % Compute exact number of device pixels per stipple dot. + dup 0 matrix currentmatrix dtransform + dup mul exch dup mul add sqrt + + % Round to an integer, make sure the number is at least 1, and compute + % user coord distance corresponding to this. + dup round dup 1 lt {pop 1} if + exch div mul +} bind def + +% width height string StippleFill -- +% +% Given a path already set up and a clipping region generated from +% it, this procedure will fill the clipping region with a stipple +% pattern. "String" contains a proper image description of the +% stipple pattern and "width" and "height" give its dimensions. Each +% stipple dot is assumed to be about one unit across in the current +% user coordinate system. This procedure trashes the graphics state. + +/StippleFill { + % The following code is needed to work around a NeWSprint bug. + + /tmpstip 1 index def + + % Change the scaling so that one user unit in user coordinates + % corresponds to the size of one stipple dot. + 1 EvenPixels dup scale + + % Compute the bounding box occupied by the path (which is now + % the clipping region), and round the lower coordinates down + % to the nearest starting point for the stipple pattern. Be + % careful about negative numbers, since the rounding works + % differently on them. + + pathbbox + 4 2 roll + 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll + 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll + + % Stack now: width height string y1 y2 x1 x2 + % Below is a doubly-nested for loop to iterate across this area + % in units of the stipple pattern size, going up columns then + % across rows, blasting out a stipple-pattern-sized rectangle at + % each position + + 6 index exch { + 2 index 5 index 3 index { + % Stack now: width height string y1 y2 x y + + gsave + 1 index exch translate + 5 index 5 index true matrix tmpstip imagemask + grestore + } for + pop + } for + pop pop pop pop pop +} bind def + +% -- AdjustColor -- +% Given a color value already set for output by the caller, adjusts +% that value to a grayscale or mono value if requested by the CL +% variable. + +/AdjustColor { +} bind def + +% x y strings spacing xoffset yoffset justify stipple DrawText -- +% This procedure does all of the real work of drawing text. The +% color and font must already have been set by the caller, and the +% following arguments must be on the stack: +% +% x, y - Coordinates at which to draw text. +% strings - An array of strings, one for each line of the text item, +% in order from top to bottom. +% spacing - Spacing between lines. +% xoffset - Horizontal offset for text bbox relative to x and y: 0 for +% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se. +% yoffset - Vertical offset for text bbox relative to x and y: 0 for +% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se. +% justify - 0 for left justification, 0.5 for center, 1 for right justify. +% stipple - Boolean value indicating whether or not text is to be +% drawn in stippled fashion. If text is stippled, +% procedure StippleText must have been defined to call +% StippleFill in the right way. +% +% Also, when this procedure is invoked, the color and font must already +% have been set for the text. + +/DrawText { + /stipple exch def + /justify exch def + /yoffset exch def + /xoffset exch def + /spacing exch def + /strings exch def + + % First scan through all of the text to find the widest line. + + /lineLength 0 def + strings { + stringwidth pop + dup lineLength gt {/lineLength exch def} {pop} ifelse + newpath + } forall + + % Compute the baseline offset and the actual font height. + + 0 0 moveto (TXygqPZ) false charpath + pathbbox dup /baseline exch def + exch pop exch sub /height exch def pop + newpath + + % Translate coordinates first so that the origin is at the upper-left + % corner of the text's bounding box. Remember that x and y for + % positioning are still on the stack. + + translate + lineLength xoffset mul + strings length 1 sub spacing mul height add yoffset mul translate + + % Now use the baseline and justification information to translate so + % that the origin is at the baseline and positioning point for the + % first line of text. + + justify lineLength mul baseline neg translate + + % Iterate over each of the lines to output it. For each line, + % compute its width again so it can be properly justified, then + % display it. + + strings { + dup stringwidth pop + justify neg mul 0 moveto + stipple { + + % The text is stippled, so turn it into a path and print + % by calling StippledText, which in turn calls StippleFill. + % Unfortunately, many Postscript interpreters will get + % overflow errors if we try to do the whole string at + % once, so do it a character at a time. + + gsave + /char (X) def + { + char 0 3 -1 roll put + currentpoint + gsave + char true charpath clip StippleText + grestore + char stringwidth translate + moveto + } forall + grestore + } {show} ifelse + 0 spacing neg translate + } forall +} bind def + +%%EndProlog +%%BeginSetup +/CL 2 def +%%EndSetup + +%%Page: 1 1 +save +306.0 396.0 translate +0.7997 0.7997 scale +-178 -83 translate +%%95 166 moveto 261 166 lineto 261 0 lineto 95 0 lineto closepath clip newpath +gsave +matrix currentmatrix +178 83 translate 80 80 scale 1 0 moveto 0 0 1 0 360 arc +setmatrix +1.000 1.000 0.000 setrgbcolor AdjustColor +fill +matrix currentmatrix +178 83 translate 80 80 scale 1 0 moveto 0 0 1 0 360 arc +setmatrix +5 setlinewidth 0 setlinejoin 2 setlinecap +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +matrix currentmatrix +156 110 translate 8 8 scale 1 0 moveto 0 0 1 0 360 arc +setmatrix +0.000 0.000 0.000 setrgbcolor AdjustColor +fill +matrix currentmatrix +156 110 translate 8 8 scale 1 0 moveto 0 0 1 0 360 arc +setmatrix +1 setlinewidth 0 setlinejoin 2 setlinecap +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +matrix currentmatrix +200 110 translate 8 8 scale 1 0 moveto 0 0 1 0 360 arc +setmatrix +0.000 0.000 0.000 setrgbcolor AdjustColor +fill +matrix currentmatrix +200 110 translate 8 8 scale 1 0 moveto 0 0 1 0 360 arc +setmatrix +1 setlinewidth 0 setlinejoin 2 setlinecap +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +138 63 moveto +144.67 49.66 152.995 41.335 163 38 curveto +173.005 34.665 182.995 34.665 193 38 curveto +203.005 41.335 211.33 49.66 218 63 curveto +5 setlinewidth +0 setlinecap +1 setlinejoin +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +restore showpage + +%%Trailer +end +%%EOF -- cgit v1.2.3