dvipost-1.1/0000775000175000017500000000000010410424160013243 5ustar ericherich00000000000000dvipost-1.1/dvipost.man0000664000175000017500000001703010410424160015431 0ustar ericherich00000000000000.\" This file was generated by efeudoc .\" document input: ./dvipost.doc:1 .TH dvipost 1 .SH NAME dvipost, pptex, pplatex - post processing of dvi files .SH SYNOPSIS \fBdvipost\fR [\fB-debug\fR] [\fB-version\fR] [\fB-help\fR] \fIin\fR \fIout\fR \fBpplatex\fR [\fB-debug\fR] [\fB-version\fR] [\fB-help\fR] [LaTeX-Arguments] \fBpptex\fR [\fB-debug\fR] [\fB-version\fR] [\fB-help\fR] [TeX-Arguments] .SH DESCRIPTION The command \fBdvipost\fR is a post procesor for dvi files, created by \fBlatex\fR or \fBtex\fR. It is used for special modes, which normally needs the support of dvi drivers (such as \fBdvips\fR). With \fBdvipost\fR, this features could be implemented independent of the prefered driver. Currently, the post processor supports layout raster, change bars and overstrike mode. This version of \fBdvipost\fR does not seek the dvi file, so it could be used as a filter. If \fB-\fR is given as file name, the command uses standard input or standard output respective. The command does not substitute a missing \fB.dvi\fR extension to the filename. Because the command works with a temporary file and creates the ouput file only after successfull processing the input file, it is possible to use the same name for input and output. If the command is renamed or linked to \fBpplatex\fR/\fBpptex\fR, it runs \fBlatex\fR/\fBtex\fR and post processes the createt output. If the name of the dvi file could not be determined by the arguments to \fBlatex\fR/\fBtex\fR (e.g. on an interactive run), the command processes all dvi files in the current directory with a modification time later than the run of \fBlatex\fR/\fBtex\fR. .SS Basics If the filter is used in context of LaTeX, the style file \fBdvipost.sty\fR should be included in the LaTeX source. The filter interpretes dvi extensions in the form of .RS \fBdvipost:\fR \fIname\fR [\fIarg\fR] .RE where \fIarg\fR depends on the command \fIname\fR and may be separated from \fIname\fR by \fB=\fR or space. All other extensions are not interpreted by \fBdvipost\fR and remain in the dvi file. Such a dvipost command could be placed with the TeX primitive .RS \fB\\special{dvipost:\fR \fIcmd\fR\fB}\fR .RE or the LaTeX macro (provided by \fBdvipost.sty\fR) .RS \fB\\dvipost{\fR\fIcmd\fR\fB}\fR .RE in the dvi file. Depending on the type of \fBdvipost\fR commands, the following kinds of arguments may be used: .PD 0 .TP \fIlength\fR is a floating point number followed by a unit specification. The following units are supportet by \fBdivipost\fR: \fBpt\fR, \fBin\fR, \fBcm\fR and \fBmm\fR. If no argument is given or the unit specification is missing, the corresponding \fIlength\fR is set to 0. .TP \fIstring\fR is an arbitrary string argument. .TP \fIflag\fR is an integer argument, where a value different from 0 (usually 1) means true and a missing value or 0 means false. .TP \fIdepth\fR is an integer argument, where a value different from 0 (usually 1) increments a depth counter and a missing value or 0 decrements it. .PD .PP .SS Change bars All text printed with change mode level higher than 0 is marked with a change bar. The following LaTeX macros modifies the change mode level: .PD 0 .TP \fB\\changestart\fR increments the change mode level. .TP \fB\\changeend\fR decrements the change mode level. .TP \fB\\textchanged{\fItext\fB}\fR increments the change mode level for \fItext\fR only. .PD .PP The following \fBdvipost\fR commands are used in context of change bars: .PD 0 .TP \fBcbmode \fIdepth\fB\fR increments/decrements the change mode level. This command is used by the LaTeX macros. .TP \fBcbrule \fIlength\fB\fR determines the thickness of the change bar. The default value is 2pt. .TP \fBcbsep \fIlength\fB\fR sets the distance beetween page margin and change bar. The default value is 2pt. .TP \fBcbexp \fIlength\fB\fR sets the additional height and depth of a character in calculating the change bar positions. The default value is 6pt. .TP \fBcbstart \fIstring\fB\fR places the dvi extension \fIstring\fR before printing characters in change mode. .TP \fBcbend \fIstring\fB\fR places the dvi extension \fIstring\fR after printing characters in change mode. .PD .PP The use of \fBcbstart\fR and \fBcbend\fR allows to set additional attributes to the marked text, depending on the dvi driver. If \fBdvips\fR is used as dvi driver and the preamble of the LaTeX source contains .RS \fB\\usepackage{dvipost}\fR .br \fB\\dvipost{cbstart color push Blue}\fR .br \fB\\dvipost{cbend color pop}\fR .RE the marked text is colored blue. .SS Overstrike mode All text printed with overstrike level higher than 0 is overstriked with a horizontal line. The overstrike line is positioned at the mean height of every block of text not broken by vertical movements and font changes. The following LaTeX macros modifies the overstrike level: .PD 0 .TP \fB\\overstrikeon\fR increments the overstrike level. .TP \fB\\overstrikeoff\fR decrements the overstrike level. .TP \fB\\overstrike{\fItext\fB}\fR increments the overstrike level for \fItext\fR only. .PD .PP The following \fBdvipost\fR commands are used in context of overstrike mode: .PD 0 .TP \fBosmode \fIdepth\fB\fR increments/decrements the overstrike level. This command is used by the LaTeX macros. .TP \fBosrule \fIlength\fB\fR sets the thickness of the overstrike line to \fIlength\fR. The default value is \fB\\fboxrule\fR. .TP \fBosstart \fIstring\fB\fR places the dvi extension \fIstring\fR before change of overstrike mode. .TP \fBosend \fIstring\fB\fR places the dvi extension \fIstring\fR after change of overstrike mode. .PD .PP The use of \fBosstart\fR and \fBosend\fR is similar to \fBcbstart\fR and \fBcbend\fR. .SS Layout parameters Layout parameters are transfered to the dvi file on loading the style file. If any changes are made to layout parameters, like \fB\\evensidemargin\fR, the macro \fB\\dvipostlayout\fR must be called to get the correct placement of change bars. Additional calls to \fB\\dvipostlayout\fR are harmeless. The following layout parameters are transfered to the dvi file: \fB\\hoffset\fR, \fB\\voffset\fR, \fB\\textwidth\fR, \fB\\textheight\fR, \fB\\oddsidemargin\fR, \fB\\evensidemargin\fR, \fB\\topmargin\fR, \fB\\headheight\fR, \fB\\headsep\fR, \fB\\footskip\fR, \fB\\marginparsep\fR and \fB\\marginparwidth\fR. Additional the flag \fBtwoside\fR is set to 0 or 1, depending on the document style option \fBtwoside\fR. Instead of calling \fB\\dvipostlayout\fR, partciucular values could be set. The command .RS \fB\\dvipost{evensidemargin=\\the\\evensidemargin}\fR .RE transfers the actual setting of \fB\\evensidemargin\fR to the dvi file. The \fBdvipost\fR command allows the printing of the layout raster by setting \fBlayout\fR to a length different to 0. The value of \fBlayout\fR is used as the thickness of the raster lines. For example: The command .RS \fB\\dvipost{layout=\\the\\fboxrule}\fR .RE activates the layout raster and uses the same line thicknes as frame boxes. .SH NOTES The filter is primarly written for LaTeX. It could be used for plain TeX, but currently there is no assistance style file included in the distribution. Maybe somone would write one, I am not a plain TeX user. The current state of change bar mode and overstrike mode must be committed do environments, which are placed on different locations than the current text. This is done in \fBdvipost.sty\fR by redefining \fB\\color@begingroup\fR and \fB\\color@endgroup\fR. This may conflict with other packages. If the macro \fB\\footnoterule\fR is redefined, it should start with the command \fB\\dvipost{footnote}\fR for a correct handling of overstrike mode and change bars. .SH COPYRIGHT Copyright (C) 2002 Erich Fruehstueck dvipost-1.1/.cvsignore0000664000175000017500000000024307571575102015263 0ustar ericherich00000000000000Makefile ltxpost dvipost dvipost.man dvipost.tex dvipost.html pplatex pptex config.log config.status config.cache *.o *.dvi *.log *.aux *.ps *.pre *.post *.tar.gz dvipost-1.1/CHANGELOG0000664000175000017500000000136010410275570014466 0ustar ericherich00000000000000Version 1.1 Bugfix: Added support for DVI_FNT commands. The lacke of this caused dvipost to segfault on documents with more than 64 fonts. Removed unneeded package color from examples. Corrected command calls in Makefile.in Version 1.0 Added manpage to distribution. Fixed incorrect installation of commands. Version 0.9: Added autoconf script to create Makefile. Support for interactive running (la)tex: Run dvipost on all *.dvi files which are changed after running (la)tex. Support for old teTeX versions which have a different syntax of running latex (no options allowed) and kpsewhich (needs type of requested file as first argument). (for example: teTeX 0.3.4). Fixed some missing headers in source files. Testet under AIX 3.2 with xlc. dvipost-1.1/COPYING0000664000175000017500000004311007561403575014321 0ustar ericherich00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 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 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) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) year 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. dvipost-1.1/Makefile.in0000664000175000017500000000566310410424160015322 0ustar ericherich00000000000000# Makefile to build dvipost # Copyright (C) 2002 Erich Fruehstueck # # Dvipost 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. # # Dvipost 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 dvipost; see the file COPYING. # If not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. prefix = @prefix@ exec_prefix = @exec_prefix@ CC= @CC@ CFLAGS= @CFLAGS@ @kpseflag@ @texflag@ LN= @LN_S@ INSTALL= @INSTALL@ INSTALL_PROGRAM= @INSTALL_PROGRAM@ INSTALL_DATA= @INSTALL_DATA@ BIN= @bindir@ # Directory to install LaTeX styles LATEX= @texpath@ MANEXT= 1 MANDIR= @mandir@/man$(MANEXT) # Install names NAME= dvipost ALIAS= pptex pplatex FILES= dvipost.sty ### End of configuration part ### # generating rules all:: $(NAME) $(ALIAS) # basic functions HDR= dvipost.h BASE= message.c alloc.c pos.c $(BASE:.c=.o): $(HDR) clean::; rm -f $(BASE:.c=.o) # dvi specific functions DVIHDR= dvi.h dvicmd.h DVI= dvifile.c tfm.c din.c dout.c dvifont.c dvi.c dvipost.c $(DVI:.c=.o): $(HDR) $(DVIHDR) clean::; rm -f $(DVI:.c=.o) # rules for command main.o: $(HDR) $(DVIHDR) clean::; rm -f main.o OBJ= main.o $(BASE:.c=.o) $(DVI:.c=.o) $(NAME): $(OBJ); $(CC) $(CFLAGS) -o $@ $(OBJ) clean::; rm -f $(NAME) $(ALIAS): $(NAME) $(LN) $(NAME) $@ clean::; rm -f $(ALIAS) # install style files install: install-exec install-man install-data uninstall: uninstall-exec uninstall-man uninstall-data uninstall-exec: for p in $(NAME) $(ALIAS); do rm -f $(BIN)/$$p; done install-exec: uninstall-exec $(INSTALL_PROGRAM) $(NAME) $(BIN)/$(NAME) (cd $(BIN); for p in $(ALIAS); do rm -f $$p; $(LN) $(NAME) $$p; done) uninstall-man: for p in $(NAME) $(ALIAS); do rm -f $(MANDIR)/$$p.$(MANEXT); done install-man: uninstall-man $(INSTALL_DATA) dvipost.man $(MANDIR)/$(NAME).$(MANEXT) (cd $(MANDIR); for p in $(ALIAS); \ do rm -f $$p.$(MANEXT); \ $(LN) $(NAME).$(MANEXT) $$p.$(MANEXT); \ done) uninstall-data: for p in $(FILES); do rm -f $(LATEX)/$$p; done texhash install-data: uninstall-data for p in $(FILES); do $(INSTALL_DATA) $$p $(LATEX)/$$p; done texhash distclean:: clean rm -f config.cache config.log config.status Makefile # rebuild rules Makefile: configure Makefile.in ./configure # run test test:: test.dvi test.ps test.ps test.dvi test.post: $(NAME) test.tex dvipost.sty latex test ./$(NAME) -debug test.dvi test.dvi 2> test.post dvips -o test.ps test.dvi purge::; rm -f test.ps test.dvi test.post # additional cleaning rules purge::; rm -f *.log *.aux clean:: purge dvipost-1.1/NOTES0000664000175000017500000000063507554723107014104 0ustar ericherich00000000000000The size of an integer is assumed to be at least 4 Bytes long. The overstrike line is positioned at the mean height of every block of text not broken by vertical movements and font changes. The current state of change bar mode and overstrike mode must be committed do environments, which are placed on different locations than the current text. This is done by redefining \color@begingroup and \color@endgroup. dvipost-1.1/README0000664000175000017500000000207007561400214014131 0ustar ericherich00000000000000dvipost - a latex post filter command to support change bars and overstrike mode. Compiling dvipost: configure make make install Use of dvipost: latex [.tex] dvipost .dvi .dvi or pplatex [.tex] note: dvipost alllows to use the same name for input and output. A second call to dvipost does not change the file. The interface: \usepackage{dvipost} The following macro must be called if any layout parameter like \evensidemargin ... is changed after including dvipost.sty. \dvipostlayout change bars: \changestart Text marked as changed \changeend \textchanged{Text marked as changed} overstrike mode: \overstrikeon Overstriked text \overstrikeoff \overstrike{Overstriked text} Additional to this modes, dvipost allows to display the page layout. This is done by calling \dvipost{layout=} with > 0. dvipost accepts lengths in pt, in, mm and cm. You can also use tex lengths in combination with the \the command: \dvipost{layout=\the\fboxrule} Have a look at dvipost.sty and test.tex to see more details of the interface. dvipost-1.1/alloc.c0000664000175000017500000000213707557473331014532 0ustar ericherich00000000000000/* memmory allocation $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" void *xalloc (size_t size) { void *p; if (size == 0) return NULL; p = malloc(size); if (p == NULL) { message(ERR, "malloc(%lu) failed.\n", (unsigned long) size); exit(EXIT_FAILURE); } return p; } void xfree (void *p) { if (p) free(p); } char *xcopy (const char *str) { return str ? strcpy(xalloc(strlen(str) + 1), str) : NULL; } dvipost-1.1/configure0000775000175000017500000011145107561425230015171 0ustar ericherich00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=dvipost.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:529: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:559: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:610: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:642: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 653 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:684: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:689: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:717: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi if test "$GCC" = yes then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes" fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:785: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 echo "configure:838: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata if ln -s X conftestdata 2>/dev/null then rm -f conftestdata ac_cv_prog_LN_S="ln -s" else ac_cv_prog_LN_S=ln fi fi LN_S="$ac_cv_prog_LN_S" if test "$ac_cv_prog_LN_S" = "ln -s"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking latex environment""... $ac_c" 1>&6 echo "configure:861: checking latex environment" >&5 if texpath=`kpsewhich latex.ltx 2>/dev/null` then kpseflag="" elif texpath=`kpsewhich tex latex.ltx 2>/dev/null` then kpseflag="-DKPSEWHICH_NEED_TYPE" else texpath="."; kpseflag="" fi texpath=`echo $texpath | sed -e 's%/[^/][^/]*/[^/]*$%/misc%'` if test "$texpath" = "." then echo "$ac_t"""broken"" 1>&6 elif test "$kpseflag" != "" then echo "$ac_t""kpsewhich needs type" 1>&6 else echo "$ac_t""ok" 1>&6 fi echo $ac_n "checking if tex accepts options""... $ac_c" 1>&6 echo "configure:885: checking if tex accepts options" >&5 if tex -version < /dev/null > /dev/null then texflag="" echo "$ac_t"""yes"" 1>&6 else texflag="-DTEX_WITHOUT_OPTIONS" echo "$ac_t"""no"" 1>&6 fi trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@LN_S@%$LN_S%g s%@texpath@%$texpath%g s%@kpseflag@%$kpseflag%g s%@texflag@%$texflag%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 dvipost-1.1/configure.in0000664000175000017500000000200107561401752015564 0ustar ericherich00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(dvipost.c) dnl Checks for programs. AC_PROG_CC dnl Add warning flags for gcc if test "$GCC" = yes then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes" fi AC_PROG_INSTALL AC_PROG_LN_S dnl Determine LaTeX install directory AC_MSG_CHECKING(latex environment) if texpath=`kpsewhich latex.ltx 2>/dev/null` then kpseflag="" elif texpath=`kpsewhich tex latex.ltx 2>/dev/null` then kpseflag="-DKPSEWHICH_NEED_TYPE" else texpath="."; kpseflag="" fi changequote(, ) texpath=`echo $texpath | sed -e 's%/[^/][^/]*/[^/]*$%/misc%'` changequote([,]) if test "$texpath" = "." then AC_MSG_RESULT("broken") elif test "$kpseflag" != "" then AC_MSG_RESULT(kpsewhich needs type) else AC_MSG_RESULT(ok) fi AC_SUBST(texpath) AC_SUBST(kpseflag) AC_MSG_CHECKING(if tex accepts options) if tex -version < /dev/null > /dev/null then texflag="" AC_MSG_RESULT("yes") else texflag="-DTEX_WITHOUT_OPTIONS" AC_MSG_RESULT("no") fi AC_SUBST(texflag) AC_OUTPUT(Makefile) dvipost-1.1/din.c0000664000175000017500000001140207557473331014205 0ustar ericherich00000000000000/* reading tools for dvi-files $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #include "dvi.h" #include int din_byte (DviFile *df) { int c = getc(df->file); if (c == EOF) { df_fatal(df, "Unexpected end of file."); return 0; } df->pos++; return c; } unsigned din_unsigned (DviFile *df, unsigned len) { unsigned val = din_byte(df); while (df->ok && --len > 0) val = val * 256 + din_byte(df); return val; } int din_signed (DviFile *df, unsigned len) { int val = din_byte(df); if (val >= 128) val -= 256; while (df->ok && --len > 0) val = val * 256 + din_byte(df); return val; } char *din_string (DviFile *df, unsigned len) { char *tg; tg = xalloc(len + 1); if (fread(tg, 1, len, df->file) != len) { df_fatal(df, "Input error."); xfree(tg); return NULL; } df->pos += len; tg[len] = 0; return tg; } DviToken *din_token (DviFile *df) { static DviToken token; int pos; int i; if (!df->ok) return NULL; pos = df->pos; token.type = din_byte(df); if (DVI_SETC_000 <= token.type && token.type <= DVI_SETC_127) { token.par[0] = token.type; return &token; } if (DVI_FONT_00 <= token.type && token.type <= DVI_FONT_63) { token.par[0] = token.type; return &token; } switch (token.type) { case DVI_NOP: case DVI_EOP: case DVI_PUSH: case DVI_POP: case DVI_W0: case DVI_X0: case DVI_Y0: case DVI_Z0: break; case DVI_SET1: case DVI_PUT1: case DVI_FNT1: token.par[0] = din_unsigned(df, 1); break; case DVI_SET2: case DVI_PUT2: case DVI_FNT2: token.par[0] = din_unsigned(df, 2); break; case DVI_SET3: case DVI_PUT3: case DVI_FNT3: token.par[0] = din_unsigned(df, 3); break; case DVI_SET4: case DVI_PUT4: case DVI_FNT4: token.par[0] = din_signed(df, 4); break; case DVI_SET_RULE: case DVI_PUT_RULE: token.par[0] = din_signed(df, 4); token.par[1] = din_signed(df, 4); break; case DVI_BOP: /* beginning of page */ for (i = 0; i < 10; i++) token.par[i] = din_signed(df, 4); if (din_signed(df, 4) != df->last_page) df_fatal(df, "page offset error."); df->npages++; df->last_page = pos; break; case DVI_RIGHT1: case DVI_DOWN1: case DVI_W1: case DVI_X1: case DVI_Y1: case DVI_Z1: token.par[0] = din_signed(df, 1); break; case DVI_RIGHT2: case DVI_DOWN2: case DVI_W2: case DVI_X2: case DVI_Y2: case DVI_Z2: token.par[0] = din_signed(df, 2); break; case DVI_RIGHT3: case DVI_DOWN3: case DVI_W3: case DVI_X3: case DVI_Y3: case DVI_Z3: token.par[0] = din_signed(df, 3); break; case DVI_RIGHT4: case DVI_DOWN4: case DVI_W4: case DVI_X4: case DVI_Y4: case DVI_Z4: token.par[0] = din_signed(df, 4); break; case DVI_XXX1: case DVI_XXX2: case DVI_XXX3: case DVI_XXX4: token.par[0] = din_unsigned(df, 1 + token.type - DVI_XXX1); token.str = din_string(df, token.par[0]); break; case DVI_FNT_DEF1: case DVI_FNT_DEF2: case DVI_FNT_DEF3: case DVI_FNT_DEF4: token.par[0] = din_unsigned(df, 1 + token.type - DVI_FNT_DEF1); token.par[1] = din_signed(df, 4); token.par[2] = din_signed(df, 4); token.par[3] = din_signed(df, 4); token.par[4] = din_byte(df); token.par[5] = din_byte(df); token.str = din_string(df, token.par[4] + token.par[5]); DviFont_add(&token); break; case DVI_PRE: if (din_byte(df) != 2) df_fatal(df, "Bad DVI file: id byte not 2."); token.par[0] = din_signed(df, 4); token.par[1] = din_signed(df, 4); token.par[2] = din_signed(df, 4); token.par[3] = din_byte(df); token.str = din_string(df, token.par[3]); break; case DVI_POST: if (din_signed(df, 4) != df->last_page) df_fatal(df, "page offset error."); token.par[0] = din_signed(df, 4); token.par[1] = din_signed(df, 4); token.par[2] = din_signed(df, 4); token.par[3] = din_signed(df, 4); token.par[4] = din_signed(df, 4); token.par[5] = din_unsigned(df, 2); token.par[6] = din_unsigned(df, 2); break; case DVI_POST_POST: token.par[0] = din_unsigned(df, 4); if (din_byte(df) != 2) df_fatal(df, "Bad DVI file: id byte not 2."); break; default: df_fatal(df, "undefined command %d.", token.type); return NULL; } return df->ok ? &token : NULL; } dvipost-1.1/dout.c0000664000175000017500000001256007557473331014414 0ustar ericherich00000000000000/* writing tools for dvi-files $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #include "dvi.h" #include void dout_byte (DviFile *df, int c) { if (!df->ok) { ; } else if (putc(c, df->file) == EOF) { df_fatal(df, "Output error."); } else df->pos++; } void dout_unsigned (DviFile *df, unsigned val, unsigned len) { if (--len > 0) dout_unsigned(df, val >> 8, len); dout_byte(df, val & 0xFF); } void dout_signed (DviFile *df, int val, unsigned len) { if (val < 0) { unsigned x = 1 + (unsigned) - (val + 1); dout_unsigned(df, 1 + ~x, len); } else dout_unsigned(df, val, len); } void dout_string (DviFile *df, const char *buf, unsigned len) { while (len-- > 0) dout_byte(df, *(buf++)); } void dout_special (DviFile *df, const char *arg) { int len = arg ? strlen(arg) : 0; if (len == 0) return; if (len < 256) { dout_byte(df, DVI_XXX1); dout_unsigned(df, len, 1); dout_string(df, arg, len); } else { dout_byte(df, DVI_XXX4); dout_unsigned(df, len, 4); dout_string(df, arg, len); } } static int wordlen (int x) { if (x == 0) return 0; if (x < 0) x = -x; if (x < 0x80) return 1; if (x < 0x8000) return 2; if (x < 0x800000) return 3; return 4; } static void dout_move (DviFile *df, int base, int val) { if (val) { int len = wordlen(val); dout_byte(df, base + len - 1); dout_signed(df, val, len); } } void dout_right (DviFile *df, int val) { dout_move(df, DVI_RIGHT1, val); } void dout_down (DviFile *df, int val) { dout_move(df, DVI_DOWN1, val); } extern void dout_setrule (DviFile *df, int h, int w) { dout_byte(df, DVI_SET_RULE); dout_signed(df, h, 4); dout_signed(df, w, 4); } extern void dout_putrule (DviFile *df, int h, int w) { dout_byte(df, DVI_PUT_RULE); dout_signed(df, h, 4); dout_signed(df, w, 4); } void dout_token (DviFile *df, DviToken *tok) { int pos; int i; if (!df->ok) return; pos = df->pos; dout_byte(df, tok->type); switch (tok->type) { case DVI_NOP: case DVI_EOP: case DVI_W0: case DVI_X0: case DVI_Y0: case DVI_Z0: break; case DVI_PUSH: df->depth++; if (df->mdepth < df->depth) df->mdepth = df->depth; break; case DVI_POP: df->depth--; break; case DVI_SET1: case DVI_PUT1: case DVI_FNT1: dout_unsigned(df, tok->par[0], 1); break; case DVI_SET2: case DVI_PUT2: case DVI_FNT2: dout_unsigned(df, tok->par[0], 2); break; case DVI_SET3: case DVI_PUT3: case DVI_FNT3: dout_unsigned(df, tok->par[0], 3); break; case DVI_SET4: case DVI_PUT4: case DVI_FNT4: dout_signed(df, tok->par[0], 4); break; case DVI_SET_RULE: case DVI_PUT_RULE: dout_signed(df, tok->par[0], 4); dout_signed(df, tok->par[1], 4); break; case DVI_BOP: /* beginning of page */ for (i = 0; i < 10; i++) dout_signed(df, tok->par[i], 4); dout_signed(df, df->last_page, 4); df->last_page = pos; df->npages++; break; case DVI_RIGHT1: case DVI_DOWN1: case DVI_W1: case DVI_X1: case DVI_Y1: case DVI_Z1: dout_signed(df, tok->par[0], 1); break; case DVI_RIGHT2: case DVI_DOWN2: case DVI_W2: case DVI_X2: case DVI_Y2: case DVI_Z2: dout_signed(df, tok->par[0], 2); break; case DVI_RIGHT3: case DVI_DOWN3: case DVI_W3: case DVI_X3: case DVI_Y3: case DVI_Z3: dout_signed(df, tok->par[0], 3); break; case DVI_RIGHT4: case DVI_DOWN4: case DVI_W4: case DVI_X4: case DVI_Y4: case DVI_Z4: dout_signed(df, tok->par[0], 4); break; case DVI_XXX1: case DVI_XXX2: case DVI_XXX3: case DVI_XXX4: dout_unsigned(df, tok->par[0], 1 + tok->type - DVI_XXX1); dout_string(df, tok->str, tok->par[0]); break; case DVI_FNT_DEF1: case DVI_FNT_DEF2: case DVI_FNT_DEF3: case DVI_FNT_DEF4: dout_unsigned(df, tok->par[0], 1 + tok->type - DVI_FNT_DEF1); dout_signed(df, tok->par[1], 4); dout_signed(df, tok->par[2], 4); dout_signed(df, tok->par[3], 4); dout_byte(df, tok->par[4]); dout_byte(df, tok->par[5]); dout_string(df, tok->str, tok->par[4] + tok->par[5]); break; case DVI_PRE: dout_byte(df, 2); dout_signed(df, tok->par[0], 4); dout_signed(df, tok->par[1], 4); dout_signed(df, tok->par[2], 4); dout_byte(df, tok->par[3]); dout_string(df, tok->str, tok->par[3]); break; case DVI_POST: dout_signed(df, df->last_page, 4); dout_signed(df, tok->par[0], 4); dout_signed(df, tok->par[1], 4); dout_signed(df, tok->par[2], 4); dout_signed(df, tok->par[3], 4); dout_signed(df, tok->par[4], 4); dout_unsigned(df, df->mdepth, 2); dout_unsigned(df, df->npages, 2); for (i = 0; i < DviFontDim; i++) dout_token(df, &DviFontTab[i].token); dout_byte(df, DVI_POST_POST); dout_unsigned(df, pos, 4); dout_byte(df, 2); for (i = 0; i < 4; i++) dout_byte(df, 223); while (df->ok && df->pos % 4 != 0) dout_byte(df, 223); break; default: break; } } dvipost-1.1/dvi.c0000664000175000017500000004165410410254136014207 0ustar ericherich00000000000000/* process dvi file $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #include "dvi.h" #include #include #define DEBUG 1 /* Allow command debugging */ #define RESOLUTION 300. #define PAGE_HEAD 0 #define PAGE_BODY 1 #define PAGE_NOTE 2 #define PAGE_FOOT 3 #define PAGE_FLOAT 4 #define PAGE_NSTAT 5 static int page_num = 0; static int page_stat = 0; static char *magic = "dvipost"; static char *checkname (const char *base, char *name); DviStat dvi_stat = { NULL, 0, 0, 0, 0, 0, 0 }; DviUnit dvi_unit = { 0 }; DviFont *dvi_font = NULL; PosTab pos_changed = { NULL, 0, 0 }; /* status stack */ static void dvi_push (void) { DviStat *ptr = xalloc(sizeof(DviStat)); *ptr = dvi_stat; dvi_stat.next = ptr; } static void dvi_pop (void) { DviStat *ptr = dvi_stat.next; dvi_stat = *ptr; xfree(ptr); } /* meassurement units */ static double pt_to_dvi = 0.; static double in_to_dvi = 0.; static double mm_to_dvi = 0.; static double cm_to_dvi = 0.; static void set_unit (DviToken *token) { dvi_unit.num = token->par[0]; dvi_unit.den = token->par[1]; dvi_unit.mag = token->par[2]; dvi_unit.true_conv = (dvi_unit.num / 254000.0); dvi_unit.true_conv *= (RESOLUTION / dvi_unit.den); dvi_unit.conv = dvi_unit.true_conv * (dvi_unit.mag / 1000.); pt_to_dvi = (254000. / dvi_unit.num) * (dvi_unit.den / 72.27); in_to_dvi = (254000. / dvi_unit.num) * (double) dvi_unit.den; cm_to_dvi = (100000. / dvi_unit.num) * (double) dvi_unit.den; mm_to_dvi = (10000. / dvi_unit.num) * (double) dvi_unit.den; /* message(NOTE, "1pt = %.0f dvi units.\n", pt_to_dvi); message(NOTE, "1in = %.0f dvi units.\n", in_to_dvi); message(NOTE, "1mm = %.0f dvi units.\n", mm_to_dvi); message(NOTE, "1cm = %.0f dvi units.\n", cm_to_dvi); */ } /* debugging functions and macros */ #if DEBUG static int dbg_pos = 0; static void dbg_printf (const char *fmt, ...) { if (dbg_pos) { va_list list; va_start(list, fmt); vfprintf(stderr, fmt, list); va_end(list); } } static void dbg_end (void) { if (dbg_pos) { putc('\n', stderr); dbg_pos = 0; } } static void dbg_beg (DviFile *df) { if (dbg_pos) putc('\n', stderr); dbg_pos = (verboselevel >= STAT) ? df->pos : 0; } static char *tab1[] = { "set1 ", "set2 ", "set3 ", "set4 ", "setrule ", "put1 ", "put2 ", "put3 ", "put4 ", "putrule ", "nop ", "beginning of page ", "eop ", "push ", "pop ", "right1 ", "right2 ","right3 ", "right4 ", "w0 ", "w1 ", "w2 ", "w3 ", "w4 ", "x0 ", "x1 ", "x2 ", "x3 ", "x4 ", "down1 ", "down2 ", "down3 ", "down4 ", "y0 ", "y1 ", "y2 ", "y3 ", "y4 ", "z0 ", "z1 ", "z2 ", "z3 ", "z4 " }; static char *tab2[] = { "fnt1 ", "fnt2 ", "fnt3 ", "fnt4 ", "xxx ", "xxx ", "xxx ", "xxx ", "fntdef1 ", "fntdef2 ", "fntdef3 ", "fntdef4 ", "pre ", "post ", "post ", "??? ", "??? ", "??? ", "??? ", "??? ", "???" }; static void dbg_type (DviToken *token) { if (dbg_pos == 0) return; fprintf(stderr, "%d: ", dbg_pos); if (token->type >= DVI_FNT1) fputs(tab2[token->type - DVI_FNT1], stderr); else if (token->type >= DVI_FONT_00) fprintf(stderr, "fntnum%d ", token->type - DVI_FONT_00); else if (token->type >= DVI_SET1) fputs(tab1[token->type - DVI_SET1], stderr); else fprintf(stderr, "setchar%d ", token->type); } #define dbg(args) dbg_printf args #define dbg_level(level) \ dbg_printf("\nlevel %d:(h=%d,v=%d,w=%d,x=%d,y=%d,z=%d) ", level, \ dvi_stat.h, dvi_stat.v, dvi_stat.w, dvi_stat.x, dvi_stat.y, dvi_stat.z) #define dbg_font(font) \ dbg_printf("current font is %s ", font ? font->token.str : ""); #else #define dbg_beg(df) #define dbg_end() #define dbg(args) #define dbg_type(token) #define dbg_level(level) #define dbg_font(font) #endif /* post filter status */ typedef struct { char *name; void *par; void (*eval) (void *par, const char *arg); } PostCmd; static int osrule = 0; static int cbrule = 0; static int cbsep = 0; static int cbexp = 0; static int floatdepth = 0; static int cbmode[PAGE_NSTAT] = { 0 }; static int cbstat = 0; static int osmode[PAGE_NSTAT] = { 0 }; static int osstat = 0; static int textwidth = 0; static int textheight = 0; static int evensidemargin = 0; static int oddsidemargin = 0; static int hoffset = 0; static int voffset = 0; static int topmargin = 0; static int headheight = 0; static int headsep = 0; static int footskip = 0; static int marginparsep = 0; static int marginparwidth = 0; static int layout = 0; static int twoside = 0; static int cbframe = 0; static char *pre = NULL; static char *post = NULL; static char *osstart = NULL; static char *osend = NULL; static char *cbstart = NULL; static char *cbend = NULL; static void set_length (void *par, const char *arg) { int *length = par; double x; char *p; x = strtod(arg, &p); if (!p) { *length = 0; return; } while (isspace(*p)) p++; if (checkname("pt", p)) *length = x * pt_to_dvi; else if (checkname("mm", p)) *length = x * mm_to_dvi; else if (checkname("cm", p)) *length = x * cm_to_dvi; else if (checkname("in", p)) *length = x * in_to_dvi; else { message(ERR, "$!: unknown unit %s on page %d.\n", p, page_num); *length = 0; } } static void set_string (void *par, const char *arg) { char **ptr = par; xfree(*ptr); *ptr = xcopy(arg); } static void set_flag (void *par, const char *arg) { int *flag = par; *flag = atoi(arg); } static void set_depth (void *par, const char *arg) { int *depth = par; if (atoi(arg)) depth[page_stat]++; else if (depth[page_stat]) depth[page_stat]--; } static int save_stat = 0; static void set_float (void *par, const char *arg) { if (atoi(arg)) { if (floatdepth == 0) { save_stat = page_stat; page_stat = PAGE_FLOAT; } floatdepth++; } else if (floatdepth) { floatdepth--; if (floatdepth == 0) page_stat = save_stat; } } static void set_page_stat (void *par, const char *arg) { page_stat = (int) (size_t) par; } static PostCmd cmd_tab[] = { { "textwidth", &textwidth, set_length }, { "textheight", &textheight, set_length }, { "oddsidemargin", &oddsidemargin, set_length }, { "evensidemargin", &evensidemargin, set_length }, { "hoffset", &hoffset, set_length }, { "voffset", &voffset, set_length }, { "topmargin", &topmargin, set_length }, { "headheight", &headheight, set_length }, { "headsep", &headsep, set_length }, { "footskip", &footskip, set_length }, { "marginparsep", &marginparsep, set_length }, { "marginparwidth", &marginparwidth, set_length }, { "twoside", &twoside, set_flag }, { "layout", &layout, set_length }, { "cbframe", &cbframe, set_flag }, { "osrule", &osrule, set_length }, { "cbrule", &cbrule, set_length }, { "cbsep", &cbsep, set_length }, { "cbexp", &cbexp, set_length }, { "cbmode", cbmode, set_depth }, { "osmode", osmode, set_depth }, { "pre", &pre, set_string }, { "post", &post, set_string }, { "osstart", &osstart, set_string }, { "osend", &osend, set_string }, { "cbstart", &cbstart, set_string }, { "cbend", &cbend, set_string }, { "top", (void *) PAGE_BODY, set_page_stat }, { "footnote", (void *) PAGE_NOTE, set_page_stat }, { "bottom", (void *) PAGE_FOOT, set_page_stat }, { "float", NULL, set_float }, }; #define cmd_dim (sizeof(cmd_tab) / sizeof(cmd_tab[0])) static char *checkname (const char *base, char *name) { int i; for (i = 0; name[i] != 0; i++) { if (base[i] == 0) break; if (base[i] != name[i]) return NULL; } if (base[i] != 0) return NULL; name += i; switch (*name) { case ':': case '=': case ' ': do name++; while (*name == '=' || *name == ':' || *name == ' '); break; case 0: break; default: return NULL; } return name; } static int postcmd (char *cmd) { char *arg; int i; cmd = checkname(magic, cmd); if (!cmd) return 0; while (isspace(*cmd)) cmd++; dbg_end(); for (i = 0; i < cmd_dim; i++) { if ((arg = checkname(cmd_tab[i].name, cmd))) { cmd_tab[i].eval(cmd_tab[i].par, arg); return 1; } } message(NOTE, "$!: unknown command <%s>\n", cmd); return 1; } DviToken tok_buf; static void cmd_goto (DviFile *out, int v, int h) { dout_down(out, v - dvi_stat.v); dvi_stat.v = v; dout_right(out, h - dvi_stat.h); dvi_stat.h = h; } static void cmd_move (DviFile *out, int v, int h) { dout_down(out, v); dvi_stat.v += v; dout_right(out, h); dvi_stat.h += h; } static void endpage (DviFile *out) { int i; int margin, cbcol; cbcol = marginparsep + marginparwidth + cbsep; if (twoside && page_num % 2 == 0) { margin = evensidemargin; cbcol = hoffset + margin - cbcol - cbrule; } else { margin = oddsidemargin; cbcol = hoffset + margin + textwidth + cbcol; } if (layout) { int footheight; int x0, y0; int n; y0 = voffset; x0 = hoffset; n = 10. * pt_to_dvi; cmd_goto(out, y0 + 0.5 * layout, x0 - n - 0.5 * layout); dout_putrule(out, layout, 2 * n); cmd_goto(out, y0 + n, x0 - 0.5 * layout); dout_putrule(out, 2 * n, layout); x0 += margin; y0 += topmargin; cmd_goto(out, y0, x0); dout_putrule(out, layout, textwidth); cmd_move(out, headheight, 0); dout_putrule(out, headheight, layout); dout_setrule(out, layout, textwidth - layout); dvi_stat.h += textwidth - layout; dout_putrule(out, headheight, layout); y0 += headheight + headsep; cmd_goto(out, y0, x0); dout_putrule(out, layout, textwidth); cmd_move(out, textheight, 0); dout_putrule(out, textheight, layout); dout_setrule(out, layout, textwidth - layout); dvi_stat.h += textwidth - layout; dout_putrule(out, textheight, layout); if (twoside && page_num % 2 == 0) cmd_goto(out, y0, x0 - marginparsep - marginparwidth); else cmd_goto(out, y0, x0 + textwidth + marginparsep); dout_putrule(out, layout, marginparwidth); cmd_move(out, textheight, 0); dout_putrule(out, textheight, layout); dout_setrule(out, layout, marginparwidth - layout); dvi_stat.h += marginparwidth - layout; dout_putrule(out, textheight, layout); footheight = headheight; if (footheight > footskip) footheight = footskip; y0 += textheight + footskip - footheight; cmd_goto(out, y0, x0); dout_putrule(out, layout, textwidth); cmd_move(out, footheight, 0); dout_putrule(out, footheight, layout); dout_setrule(out, layout, textwidth - layout); dvi_stat.h += textwidth - layout; dout_putrule(out, footheight, layout); } if (pos_changed.dim) { dout_special(out, cbstart); for (i = 0; i < pos_changed.dim; i++) { POS *p = pos_changed.tab + i; cmd_goto(out, p->end, cbcol); dout_putrule(out, p->end - p->beg, cbrule); } dout_special(out, cbend); } } /* functions */ static void mv_right(int val) { dbg(("h:=%d%+d", dvi_stat.h, val)); dvi_stat.h += val; dbg(("=%d ", dvi_stat.h)); } static void mv_down(int val) { dbg(("v:=%d%+d", dvi_stat.v, val)); dvi_stat.v += val; dbg(("=%d ", dvi_stat.v)); } static int text_hpos = 0; /* number of text characters past */ static int text_cnt = 0; /* number of text characters past */ static int text_height = 0; /* last character height */ static int text_depth = 0; /* last character depth */ static double acc_height = 0.; /* accumulated width weighted height */ static double acc_depth = 0.; /* accumulated width weighted depth */ static double acc_width = 0.; /* accumulated width */ static void text_beg (DviFile *out) { if (text_cnt) return; text_hpos = dvi_stat.h; if (cbmode[page_stat]) { dout_special(out, cbstart); cbstat = 1; } if (osmode[page_stat]) { dout_special(out, osstart); osstat = 1; } return; } static void text_end (DviFile *out) { if (!text_cnt) return; text_cnt = 0; if (osmode[page_stat]) { if (cbframe) { dout_down(out, text_depth); dout_putrule(out, text_depth + text_height, osrule); dout_down(out, -text_depth); } { int l, o; double x; l = dvi_stat.h - text_hpos; x = (acc_height - acc_depth) / acc_width; o = 0.5 * (1. - osrule + x); dout_down(out, -o); dout_right(out, -l); dout_setrule(out, osrule, l); dout_down(out, o); } } if (osstat) { dout_special(out, osend); osstat = 0; } if (cbstat) { dout_special(out, cbend); cbstat = 0; } text_height = 0; text_depth = 0; acc_height = 0.; acc_depth = 0.; acc_width = 0.; } static void setchar (DviFile *out, int c) { int w, mh, md; w = dvi_font->width[c]; mh = text_height; md = text_depth; text_height = dvi_font->height[c]; text_depth = dvi_font->depth[c]; acc_width += w; acc_height += w * (double) text_height; acc_depth += w * (double) text_depth; if (mh < text_height) mh = text_height; if (md < text_depth) md = text_depth; mv_right(w); text_cnt++; if (!cbmode[page_stat]) return; pos_add(&pos_changed, dvi_stat.v - text_height - cbexp, dvi_stat.v + text_depth + cbexp); if (cbframe) { dout_right(out, -w); dout_down(out, md); dout_putrule(out, md + mh, osrule); dout_down(out, text_depth - md); dout_putrule(out, osrule, w); dout_down(out, -text_height - text_depth); dout_setrule(out, osrule, w); dout_down(out, text_height); } } /* main routine */ int process_dvi (const char *id, FILE *ifile, FILE *ofile) { DviFile dvifile[2], *df, *out; DviToken *token; int level; df = df_init(dvifile, id, ifile); out = df_init(dvifile + 1, "", ofile); level = 0; for (;;) { dbg_beg(df); token = din_token(df); if (token == NULL) { text_end(out); break; } dbg_type(token); if (token->type <= DVI_SETC_127) { text_beg(out); dout_token(out, token); setchar(out, token->type); dbg_end(); continue; } switch (token->type) { case DVI_SET1: case DVI_SET2: case DVI_SET3: case DVI_SET4: text_beg(out); dout_token(out, token); setchar(out, token->par[0] & 0xff); dbg_end(); continue; case DVI_RIGHT1: case DVI_RIGHT2: case DVI_RIGHT3: case DVI_RIGHT4: dbg(("%d ", token->par[0])); dout_token(out, token); mv_right(token->par[0]); continue; case DVI_W1: case DVI_W2: case DVI_W3: case DVI_W4: dvi_stat.w = token->par[0]; /*FALLTHROUGH*/ case DVI_W0: dbg(("%d ", dvi_stat.w)); dout_token(out, token); mv_right(dvi_stat.w); continue; case DVI_X1: case DVI_X2: case DVI_X3: case DVI_X4: dvi_stat.x = token->par[0]; /*FALLTHROUGH*/ case DVI_X0: dbg(("%d ", dvi_stat.x)); dout_token(out, token); mv_right(dvi_stat.x); continue; default: break; } text_end(out); switch (token->type) { case DVI_SET_RULE: dbg(("height %d, width %d \n ", token->par[0], token->par[1])); mv_right(token->par[1]); break; case DVI_PUT_RULE: dbg(("height %d, width %d \n ", token->par[0], token->par[1])); break; case DVI_DOWN1: case DVI_DOWN2: case DVI_DOWN3: case DVI_DOWN4: dbg(("%d ", token->par[0])); mv_down(token->par[0]); break; case DVI_Y1: case DVI_Y2: case DVI_Y3: case DVI_Y4: dvi_stat.y = token->par[0]; /*FALLTHROUGH*/ case DVI_Y0: dbg(("%d ", dvi_stat.y)); mv_down(dvi_stat.y); break; case DVI_Z1: case DVI_Z2: case DVI_Z3: case DVI_Z4: dvi_stat.z = token->par[0]; /*FALLTHROUGH*/ case DVI_Z0: dbg(("%d ", dvi_stat.z)); mv_down(dvi_stat.z); break; case DVI_BOP: dbg(("%d ", token->par[0])); dvi_stat.next = NULL; dvi_stat.h = 0; dvi_stat.v = 0; dvi_stat.w = 0; dvi_stat.x = 0; dvi_stat.y = 0; dvi_stat.z = 0; dvi_font = NULL; page_num = token->par[0]; page_stat = PAGE_HEAD; pos_init(&pos_changed); break; case DVI_EOP: endpage(out); break; case DVI_PUSH: dbg_level(level); dvi_push(); level++; break; case DVI_POP: level--; dvi_pop(); dbg_level(level); break; case DVI_XXX1: case DVI_XXX2: case DVI_XXX3: case DVI_XXX4: dbg(("'%s' ", token->str)); if (postcmd(token->str)) continue; break; case DVI_FNT_DEF1: case DVI_FNT_DEF2: case DVI_FNT_DEF3: case DVI_FNT_DEF4: dbg(("%d: %s ", token->par[0], token->str)); break; case DVI_FNT1: case DVI_FNT2: case DVI_FNT3: case DVI_FNT4: dvi_font = DviFont_get(token->par[0]); dbg_font(dvi_font); break; case DVI_PRE: set_unit(token); break; case DVI_POST: /* postamble beginning */ dout_token(out, token); dbg_end(); return df->ok ? 0 : 1; case DVI_POST_POST: /* postamble ending */ df_fatal(df, "POST_POST without PRE."); break; default: if (token->type < DVI_FONT_00) { ; } else if (token->type <= DVI_FONT_63) { int font = token->type - DVI_FONT_00; dvi_font = DviFont_get(font); dbg_font(dvi_font); } break; } dout_token(out, token); dbg_end(); } return 1; } dvipost-1.1/dvi.h0000664000175000017500000000663707557473331014240 0ustar ericherich00000000000000/* dvi commands $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #ifndef dvi_h #define dvi_h 1 #include #include "dvicmd.h" typedef struct { const char *name; /* file name */ FILE *file; /* file pointer */ unsigned pos; /* file position */ int ok; /* status flag */ int last_page; /* offset of last page */ int depth; /* stack depth */ int mdepth; /* maximum depth size */ int npages; /* number of pages */ } DviFile; extern DviFile *df_init (DviFile *buf, const char *name, FILE *file); extern void df_fatal (DviFile *df, const char *fmt, ...); extern int din_byte (DviFile *df); extern int din_signed (DviFile *df, unsigned len); extern unsigned din_unsigned (DviFile *df, unsigned len); extern char *din_string (DviFile *df, unsigned len); extern void dout_byte (DviFile *df, int val); extern void dout_signed (DviFile *df, int val, unsigned len); extern void dout_unsigned (DviFile *df, unsigned val, unsigned len); extern void dout_string (DviFile *df, const char *buf, unsigned len); extern void dout_special (DviFile *df, const char *arg); extern void dout_right (DviFile *df, int val); extern void dout_down (DviFile *df, int val); extern void dout_setrule (DviFile *df, int h, int w); extern void dout_putrule (DviFile *df, int h, int w); /* token */ typedef struct { int type; /* token type */ int par[10]; /* int parameters */ char *str; /* string parameter */ } DviToken; DviToken *din_token (DviFile *df); void dout_token (DviFile *df, DviToken *token); /* font table */ typedef struct { DviToken token; /* font def token */ int width[256]; /* character width */ int height[256]; /* character height */ int depth[256]; /* character depth */ int offset; /* overstrike offset */ } DviFont; #define DviFont_num(x) (x)->token.par[0] #define DviFont_csum(x) (x)->token.par[1] #define DviFont_scale(x) (x)->token.par[2] #define DviFont_dsize(x) (x)->token.par[3] #define DviFont_name(x) (x)->token.str extern DviFont *DviFontTab; extern int DviFontDim; extern DviFont *DviFont_get (int font); extern void DviFont_add (DviToken *token); extern int tfm_load (int *width, const char *name, int size); extern int DviFont_tfm (DviFont *font); extern DviFont *dvi_font; /* stack */ typedef struct DviStatStruct DviStat;; struct DviStatStruct { DviStat *next; int h; /* horizontal coordinate */ int v; /* vertical coordinate */ int w; /* horizontal spacing */ int x; /* horizontal spacing */ int y; /* vertical spacing */ int z; /* vertical spacing */ }; extern DviStat dvi_stat; /* process state */ typedef struct { int num; /* numerator of units fraction */ int den; /* denominator of units fraction */ int mag; /* magnification */ double true_conv; double conv; } DviUnit; extern double tfm_conv; extern DviUnit dvi_unit; #endif /* dvi.h */ dvipost-1.1/dvicmd.h0000664000175000017500000001000407557473331014703 0ustar ericherich00000000000000/* dvi command names $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #ifndef dvicmd_h #define dvicmd_h 1 #define DVI_SETC_000 0 /* typeset character 0 and move right */ #define DVI_SETC_127 127 /* typeset character 127 and move right */ #define DVI_SET1 128 /* typeset a character and move right */ #define DVI_SET2 129 /* ??? */ #define DVI_SET3 130 /* ??? */ #define DVI_SET4 131 /* ??? */ #define DVI_SET_RULE 132 /* typeset a rule and move right */ #define DVI_PUT1 133 /* typeset a character */ #define DVI_PUT2 134 /* ??? */ #define DVI_PUT3 135 /* ??? */ #define DVI_PUT4 136 /* ??? */ #define DVI_PUT_RULE 137 /* typeset a rule */ #define DVI_NOP 138 /* no operation */ #define DVI_BOP 139 /* beginning of page */ #define DVI_EOP 140 /* ending of page */ #define DVI_PUSH 141 /* save the current positions */ #define DVI_POP 142 /* restore previous positions */ #define DVI_RIGHT1 143 /* move right */ #define DVI_RIGHT2 144 /* ??? */ #define DVI_RIGHT3 145 /* ??? */ #define DVI_RIGHT4 146 /* ??? */ #define DVI_W0 147 /* move right by |w| */ #define DVI_W1 148 /* move right and set |w| */ #define DVI_W2 149 /* ??? */ #define DVI_W3 150 /* ??? */ #define DVI_W4 151 /* ??? */ #define DVI_X0 152 /* move right by |x| */ #define DVI_X1 153 /* move right and set |x| */ #define DVI_X2 154 /* ??? */ #define DVI_X3 155 /* ??? */ #define DVI_X4 156 /* ??? */ #define DVI_DOWN1 157 /* move down */ #define DVI_DOWN2 158 /* ??? */ #define DVI_DOWN3 159 /* ??? */ #define DVI_DOWN4 160 /* ??? */ #define DVI_Y0 161 /* move down by |y| */ #define DVI_Y1 162 /* move down and set |y| */ #define DVI_Y2 163 /* ??? */ #define DVI_Y3 164 /* ??? */ #define DVI_Y4 165 /* ??? */ #define DVI_Z0 166 /* move down by |z| */ #define DVI_Z1 167 /* move down and set |z| */ #define DVI_Z2 168 /* ??? */ #define DVI_Z3 169 /* ??? */ #define DVI_Z4 170 /* ??? */ #define DVI_FONT_00 171 /* set current font to 0 */ #define DVI_FONT_63 234 /* set current font to 63 */ #define DVI_FNT1 235 /* set current font */ #define DVI_FNT2 236 /* Same as FNT1, except that arg is 2 bytes */ #define DVI_FNT3 237 /* Same as FNT1, except that arg is 3 bytes */ #define DVI_FNT4 238 /* Same as FNT1, except that arg is 4 bytes */ #define DVI_XXX1 239 /* extension to \.DVI primitives */ #define DVI_XXX2 240 /* Like XXX1, but 0<=k<65536 */ #define DVI_XXX3 241 /* Like XXX1, but 0<=k<@t$2^{24}$@> */ #define DVI_XXX4 242 /* potentially long extension to \.DVI primitives */ #define DVI_FNT_DEF1 243 /* define the meaning of a font number */ #define DVI_FNT_DEF2 244 /* ??? */ #define DVI_FNT_DEF3 245 /* ??? */ #define DVI_FNT_DEF4 246 /* ??? */ #define DVI_PRE 247 /* preamble */ #define DVI_POST 248 /* postamble beginning */ #define DVI_POST_POST 249 /* postamble ending */ #endif /* dvicmd.h */ dvipost-1.1/dvifile.c0000664000175000017500000000247207557473331015064 0ustar ericherich00000000000000/* reading tools for dvi-files $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #include "dvi.h" #include DviFile *df_init (DviFile *df, const char *name, FILE *file) { static DviFile buf; if (df == NULL) df = &buf; memset(df, 0, sizeof(*df)); df->name = name; df->file = file; df->ok = 1; df->pos = 0; df->last_page = -1; df->depth = 0; df->mdepth = 0; df->npages = 0; return df; } void df_fatal (DviFile *df, const char *fmt, ...) { va_list list; fprintf(stderr, "%s: %s:%d: ", pname, df->name, df->pos); va_start(list, fmt); vfprintf(stderr, fmt, list); va_end(list); putc('\n', stderr); df->ok = 0; } dvipost-1.1/dvifont.c0000664000175000017500000000367507557473331015121 0ustar ericherich00000000000000/* Dvi font definations $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #include "dvi.h" #define BSIZE 8 DviFont *DviFontTab = NULL; int DviFontDim = 0; static int size = 0; static int cmp_font (const void *p1, const void *p2) { const DviFont *f1 = p1; const DviFont *f2 = p2; return (DviFont_num(f2) - DviFont_num(f1)); } DviFont *DviFont_get (int font) { DviFont *fp; int n; for (fp = DviFontTab, n = DviFontDim; n-- > 0; fp++) if (fp->token.par[0] == font) return fp; return NULL; } void DviFont_add (DviToken *token) { DviFont *fp; fp = DviFont_get (token->par[0]); if (fp) return; if (DviFontDim >= size) { fp = DviFontTab; size += BSIZE; DviFontTab = xalloc(size * sizeof(DviFont)); memcpy(DviFontTab, fp, DviFontDim * sizeof(DviFont)); xfree(fp); } fp = DviFontTab + DviFontDim++; fp->token = *token; message(STAT, "Font %d: %s", token->par[0], token->str); if (DviFont_scale(fp) > 0 && DviFont_dsize(fp) > 0) { int m = (1000. * dvi_unit.conv * DviFont_scale(fp)) / (dvi_unit.true_conv * DviFont_dsize(fp)) + 0.5; if (m != 1000) message(STAT, " scaled %d", m); } message(STAT, "---loaded at size %d DVI units \n", DviFont_scale(fp)); DviFont_tfm(fp); qsort(DviFontTab, DviFontDim, sizeof(DviFont), cmp_font); } dvipost-1.1/dvipost.c0000664000175000017500000000551707561422555015132 0ustar ericherich00000000000000/* dvi file post processing $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #include "dvi.h" #include #include #include int dvipost (const char *iname, const char *oname) { FILE *input, *tmp, *output; int c; int stat; /* open temporary file */ tmp = tmpfile(); if (!tmp) { perror(pname); exit(EXIT_FAILURE); } /* open input file */ if (strcmp(iname, "-") != 0) { input = fopen(iname, "rb"); if (!input) { fprintf(stderr, "%s: ", iname); perror(iname); fclose(tmp); return EXIT_FAILURE; } } else { iname = ""; input = stdin; } /* check magic and process input */ message(NOTE, "$!: Process input file %s\n", iname); c = getc(input); ungetc(c, input); switch (c) { case DVI_PRE: stat = process_dvi(iname, input, tmp); break; default: message(ERR, "$!: Bad magic: %s is not a dvi file.\n", iname); stat = 1; break; } fclose(input); if (stat) { fclose(tmp); return EXIT_FAILURE; } if (oname == NULL) { fclose(tmp); return EXIT_SUCCESS; } /* copy file to output */ rewind(tmp); if (oname && strcmp(oname, "-") != 0) { output = fopen(oname, "wb"); if (!output) { fprintf(stderr, "%s: ", pname); perror(oname); fclose(tmp); return EXIT_FAILURE; } } else { oname = ""; output = stdout; } message(NOTE, "$!: Copy data to %s\n", oname); while ((c = getc(tmp)) != EOF) putc(c, output); fclose(tmp); if (ferror(output)) { fprintf(stderr, "%s: ", pname); perror(oname); stat = EXIT_FAILURE; } else stat = EXIT_SUCCESS; fclose(output); return stat; } void dvipost_search (time_t stamp) { struct dirent *entry; DIR *dir; struct stat filestat; dir = opendir("."); if (!dir) { fprintf(stderr, "%s: directory ", pname); perror("."); return; } while ((entry = readdir(dir)) != NULL) { char *p = strrchr(entry->d_name, '.'); if (p == 0 || strcmp(p, ".dvi") != 0) continue; if (stat(entry->d_name, &filestat) != 0) { fprintf(stderr, "%s: ", pname); perror(entry->d_name); continue; } if (filestat.st_mtime >= stamp) dvipost(entry->d_name, entry->d_name); } closedir(dir); } dvipost-1.1/dvipost.doc0000664000175000017500000001736510410275172015445 0ustar ericherich00000000000000/* dvipost manpage $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ \mpage[1] dvipost \Name dvipost, pptex, pplatex - post processing of dvi files \Synopsis |dvipost| [|-debug|] [|-version|] [|-help|] |pplatex| [|-debug|] [|-version|] [|-help|] [LaTeX-Arguments] |pptex| [|-debug|] [|-version|] [|-help|] [TeX-Arguments] \Description The command |dvipost| is a post procesor for dvi files, created by |latex| or |tex|. It is used for special modes, which normally needs the support of dvi drivers (such as |dvips|). With |dvipost|, this features could be implemented independent of the prefered driver. Currently, the post processor supports layout raster, change bars and overstrike mode. This version of |dvipost| does not seek the dvi file, so it could be used as a filter. If |-| is given as file name, the command uses standard input or standard output respective. The command does not substitute a missing |.dvi| extension to the filename. Because the command works with a temporary file and creates the ouput file only after successfull processing the input file, it is possible to use the same name for input and output. If the command is renamed or linked to |pplatex|/|pptex|, it runs |latex|/|tex| and post processes the createt output. If the name of the dvi file could not be determined by the arguments to |latex|/|tex| (e.g. on an interactive run), the command processes all dvi files in the current directory with a modification time later than the run of |latex|/|tex|. \shead Basics If the filter is used in context of \LaTeX;, the style file |dvipost.sty| should be included in the \LaTeX; source. The filter interpretes dvi extensions in the form of |dvipost:| [] where depends on the command and may be separated from by |=| or space. All other extensions are not interpreted by |dvipost| and remain in the dvi file. Such a dvipost command could be placed with the \TeX; primitive |\special{dvipost:| |}| or the \LaTeX; macro (provided by |dvipost.sty|) |\dvipost{||}| in the dvi file. Depending on the type of |dvipost| commands, the following kinds of arguments may be used: \ititem length is a floating point number followed by a unit specification. The following units are supportet by |divipost|: |pt|, |in|, |cm| and |mm|. If no argument is given or the unit specification is missing, the corresponding is set to 0. \ititem string is an arbitrary string argument. \ititem flag is an integer argument, where a value different from 0 (usually 1) means true and a missing value or 0 means false. \ititem depth is an integer argument, where a value different from 0 (usually 1) increments a depth counter and a missing value or 0 decrements it. \shead Change bars All text printed with change mode level higher than 0 is marked with a change bar. The following \LaTeX; macros modifies the change mode level: \ttitem |\changestart| increments the change mode level. \ttitem |\changeend| decrements the change mode level. \ttitem |\textchanged|{} increments the change mode level for only. The following |dvipost| commands are used in context of change bars: \ttitem cbmode increments/decrements the change mode level. This command is used by the \LaTeX; macros. \ttitem cbrule determines the thickness of the change bar. The default value is 2pt. \ttitem cbsep sets the distance beetween page margin and change bar. The default value is 2pt. \ttitem cbexp sets the additional height and depth of a character in calculating the change bar positions. The default value is 6pt. \ttitem cbstart places the dvi extension before printing characters in change mode. \ttitem cbend places the dvi extension after printing characters in change mode. The use of |cbstart| and |cbend| allows to set additional attributes to the marked text, depending on the dvi driver. If |dvips| is used as dvi driver and the preamble of the \LaTeX; source contains |\usepackage{dvipost}|\br |\dvipost{cbstart color push Blue}|\br |\dvipost{cbend color pop}| the marked text is colored blue. \shead Overstrike mode All text printed with overstrike level higher than 0 is overstriked with a horizontal line. The overstrike line is positioned at the mean height of every block of text not broken by vertical movements and font changes. The following \LaTeX; macros modifies the overstrike level: \ttitem |\overstrikeon| increments the overstrike level. \ttitem |\overstrikeoff| decrements the overstrike level. \ttitem |\overstrike|{} increments the overstrike level for only. The following |dvipost| commands are used in context of overstrike mode: \ttitem osmode increments/decrements the overstrike level. This command is used by the \LaTeX; macros. \ttitem osrule sets the thickness of the overstrike line to . The default value is |\fboxrule|. \ttitem osstart places the dvi extension before change of overstrike mode. \ttitem osend places the dvi extension after change of overstrike mode. The use of |osstart| and |osend| is similar to |cbstart| and |cbend|. \shead Layout parameters Layout parameters are transfered to the dvi file on loading the style file. If any changes are made to layout parameters, like |\evensidemargin|, the macro |\dvipostlayout| must be called to get the correct placement of change bars. Additional calls to |\dvipostlayout| are harmeless. \latex{\begin{sloppypar}} The following layout parameters are transfered to the dvi file: |\hoffset|, |\voffset|, |\textwidth|, |\textheight|, |\oddsidemargin|, |\evensidemargin|, |\topmargin|, |\headheight|, |\headsep|, |\footskip|, |\marginparsep| and |\marginparwidth|. Additional the flag |twoside| is set to 0 or 1, depending on the document style option |twoside|. \latex{\end{sloppypar}} Instead of calling |\dvipostlayout|, partciucular values could be set. The command |\dvipost{evensidemargin=\the\evensidemargin}| transfers the actual setting of |\evensidemargin| to the dvi file. The |dvipost| command allows the printing of the layout raster by setting |layout| to a length different to 0. The value of |layout| is used as the thickness of the raster lines. For example: The command |\dvipost{layout=\the\fboxrule}| activates the layout raster and uses the same line thicknes as frame boxes. /* top footnote bottom float */ \Notes The filter is primarly written for \LaTeX;. It could be used for plain \TeX;, but currently there is no assistance style file included in the distribution. Maybe somone would write one, I am not a plain \TeX; user. The current state of change bar mode and overstrike mode must be committed do environments, which are placed on different locations than the current text. This is done in |dvipost.sty| by redefining |\color@begingroup| and |\color@endgroup|. This may conflict with other packages. If the macro |\footnoterule| is redefined, it should start with the command |\dvipost{footnote}| for a correct handling of overstrike mode and change bars. \Copyright Copyright \latex[(C)]{\copyright{}} 2002 Erich Fruehstueck dvipost-1.1/dvipost.h0000664000175000017500000000276107561422555015135 0ustar ericherich00000000000000/* postfilter $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #ifndef dvipost_h #define dvipost_h 1 #define _XOPEN_SOURCE #include #include #include #include #define ERR 0 #define NOTE 1 #define STAT 2 #define DBG 3 extern char *pname; extern int verboselevel; extern void message (int level, const char *fmt, ...); extern void *xalloc (size_t size); extern void xfree (void *data); extern char *xcopy (const char *str); typedef struct { int beg; int end; } POS; typedef struct { POS *tab; size_t dim; size_t size; } PosTab; void pos_init (PosTab *pos); void pos_add (PosTab *pos, int beg, int end); extern int process_dvi (const char *id, FILE *in, FILE *out); extern int dvipost (const char *iname, const char *oname); extern void dvipost_search (time_t stamp); #endif /* dvipost.h */ dvipost-1.1/dvipost.sty0000664000175000017500000000531607557473331015527 0ustar ericherich00000000000000% dvipost interface % $Copyright (C) 2002 Erich Fruehstueck % A-3423 St.Andrä/Wördern, Südtirolergasse 17-21/5 \def\dvipost#1{\special{dvipost: #1}} \dvipost{osrule=\the\fboxrule} \dvipost{cbsep=2pt} \dvipost{cbrule=2pt} \dvipost{cbexp=6pt} % transfer layout parameters to dvipost \def\dvipostlayout{% \if@twoside\dvipost{twoside 1}\else \dvipost{twoside 0}\fi \dvipost{hoffset=\the\hoffset}% \dvipost{voffset=\the\voffset}% \dvipost{textwidth=\the\textwidth}% \dvipost{textheight=\the\textheight}% \dvipost{evensidemargin=\the\evensidemargin}% \dvipost{oddsidemargin=\the\oddsidemargin}% \dvipost{topmargin=\the\topmargin}% \dvipost{headheight=\the\headheight}% \dvipost{headsep=\the\headsep}% \dvipost{footskip=\the\footskip}% \dvipost{marginparsep=\the\marginparsep} \dvipost{marginparwidth=\the\marginparwidth} } \dvipostlayout % macros to set change mode \newif\ifdvipost@cbmode \dvipost@cbmodefalse \DeclareRobustCommand{\changestart}{\dvipost@cbmodetrue \dvipost{cbmode=1}} \DeclareRobustCommand{\changeend}{\dvipost{cbmode=0}\dvipost@cbmodefalse} \def\textchanged#1{\changestart #1\changeend} % macros to set overstrike mode \newif\ifdvipost@osmode \dvipost@osmodefalse \DeclareRobustCommand{\overstrikeon}{\dvipost@osmodetrue\dvipost{osmode=1}} \DeclareRobustCommand{\overstrikeoff}{\dvipost{osmode=0}\dvipost@osmodefalse} \def\overstrike#1{\overstrikeon #1\overstrikeoff} % redefine \color@begingroup and \color@endgroup to % transfer state of cbmode and osmode to the interface % this macros are used by \footnote etc. \let\dvipost@begincolor\color@begingroup \let\dvipost@endcolor\color@endgroup \def\color@begingroup { \dvipost@begincolor \ifdvipost@cbmode\dvipost{cbmode 1}\fi \ifdvipost@osmode\dvipost{osmode 1}\fi } \def\color@endgroup {% \ifdvipost@osmode\dvipost{osmode 0}\fi \ifdvipost@cbmode\dvipost{cbmode 0}\fi \dvipost@endcolor } % redefine \@floatboxreset and \@endfloatbox to % mark the contents of floats. \let\dvipost@floatboxreset\@floatboxreset \let\dvipost@endfloatbox\@endfloatbox \def\@floatboxreset{% \dvipost{float 1} \ifdvipost@cbmode\dvipost{cbmode 1}\fi \ifdvipost@osmode\dvipost{osmode 1}\fi \dvipost@floatboxreset } \def\@endfloatbox{% \ifdvipost@osmode\dvipost{osmode 0}\fi \ifdvipost@cbmode\dvipost{cbmode 0}\fi \dvipost{float 0}% \dvipost@endfloatbox } %\newenvironment{figure} % {\@float{figure}} % {\end@float} % redefine \@texttop \@textbottom and \footnoterule to % to get part of page. \let\dvipost@top\@texttop \def\@texttop{\dvipost{top}\dvipost@top} \let\dvipost@bottom\@textbottom \def\@textbottom{\dvipost{bottom}\dvipost@bottom} \let\dvipost@footnoterule\footnoterule \def\footnoterule{\dvipost{footnote}\dvipost@footnoterule} dvipost-1.1/install.sh0000775000175000017500000001273607561167257015311 0ustar ericherich00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 dvipost-1.1/main.c0000664000175000017500000001627207571152141014356 0ustar ericherich00000000000000/* LaTeX - Postfilter $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #ifdef TEX_WITHOUT_OPTIONS #define TEX_ACCEPT_OPTIONS 0 #else #define TEX_ACCEPT_OPTIONS 1 #endif static char *version = "dvipost version 1.0\n\ Dvipost is copyright (C) 2002 Erich Fruehstueck.\n"; #include "dvipost.h" #include "dvi.h" #include #include #include #include char **tex_argv = NULL; int tex_argc = 0; static int dvipost_help (char **argv, char *oarg); static int dvipost_version (char **argv, char *oarg); static int pptex_help (char **argv, char *oarg); #if TEX_ACCEPT_OPTIONS static int pptex_arg (char **argv, char *oarg) { tex_argv[tex_argc++] = argv[0]; if (oarg == NULL) { tex_argv[tex_argc++] = argv[1]; return 2; } return 1; } static int pptex_noarg (char **argv, char *oarg) { tex_argv[tex_argc++] = argv[0]; return 1; } static int pptex_version (char **argv, char *oarg) { puts(version); tex_argv[tex_argc++] = argv[0]; return 1; } #endif static int dvipost_debug (char **argv, char *oarg) { verboselevel++; return 1; } typedef struct { char *name; char *desc; int (*eval) (char **argv, char *oarg); } ODEF; static ODEF pptex_odef[] = { #if TEX_ACCEPT_OPTIONS { "fmt", NULL, pptex_arg }, { "ini", NULL, pptex_noarg }, { "interaction", NULL, pptex_arg }, { "kpathsea-debug", NULL, pptex_arg }, { "mktex", NULL, pptex_arg }, { "mltex", NULL, pptex_noarg }, { "no-mktex", NULL, pptex_arg }, { "output-comment", NULL, pptex_arg }, { "progname", NULL, pptex_arg }, { "shell-escape", NULL, pptex_noarg }, { "translate-file", NULL, pptex_arg }, { "help", NULL, pptex_help }, { "version", NULL, pptex_version }, #else { "help", "display this help and exit", pptex_help }, { "version", "output version information and exit", dvipost_version }, #endif { "debug", "increase dvipost debug level", dvipost_debug }, { NULL, NULL, NULL }, }; static int dvipost_version (char **argv, char *oarg) { puts(version); puts("There is NO warranty. Redistribution of this software is"); puts("covered by the terms of the GNU General Public License."); puts("You should have received a copy of the GNU General Public"); puts("License along with dvipost; see the file COPYING."); exit(EXIT_SUCCESS); return 0; } static ODEF dvipost_odef[] = { { "debug", "increase dvipost debug level", dvipost_debug }, { "version", "output version information and exit", dvipost_version }, { "help", "display this help and exit", dvipost_help }, { NULL, NULL, NULL }, }; static int pptex_help (char **argv, char *oarg) { ODEF *odef; #if TEX_ACCEPT_OPTIONS printf("Usage: %s [-debug] [TEXARGS]\n\n", pname); #else printf("Usage: %s [-help] [-version] [-debug] [TEXARGS]\n\n", pname); #endif printf("Run %s and process DVI file with dvipost.\n", tex_argv[0]); printf("The following options are interpreted by %s:\n\n", pname); for (odef = pptex_odef; odef->name; odef++) { if (odef->desc) printf("-%-12s %s\n", odef->name, odef->desc); } #if TEX_ACCEPT_OPTIONS printf("\nAll other options and arguments are passed to %s.\n", tex_argv[0]); printf("\n"); tex_argv[tex_argc++] = argv[0]; #else exit(EXIT_SUCCESS); #endif return 1; } static int dvipost_help (char **argv, char *oarg) { ODEF *odef; printf("Usage: %s [OPTION] infile [outfile]\n", pname); for (odef = dvipost_odef; odef->name; odef++) { if (odef->desc) printf("-%-12s %s\n", odef->name, odef->desc); } exit(EXIT_SUCCESS); return 1; } static int optend = 0; static int is_arg (char *arg) { return (arg[0] != '-' || arg[1] == 0); } static int is_optend (char *arg) { return (arg[0] == '-' && arg[1] == '-' && arg[2] == 0); } static int eval_opt (char **argv, ODEF *def) { char *oname; int stat; if (optend || argv[0][0] != '-') return 0; oname = argv[0] + 1; switch (*oname) { case 0: return 0; case '-': oname++; break; default: break; } if (*oname == 0) { optend = 1; return 0; } for (stat = 0; def->name != NULL; def++) { char *p = def->name; char *arg = oname; while (*p && *p == *arg) { p++; arg++; } switch (*arg) { case '=': if (stat == 0) stat = def->eval(argv, arg + 1); break; case 0: if (stat == 0) stat = def->eval(argv, NULL); break; default: break; } } return stat; } static char *get_dvi_name (const char *arg) { char *p, *dvi; p = strrchr(arg, '/'); if (p && p[1]) arg = p + 1; dvi = strcpy(xalloc(strlen(arg) + 4), arg); p = strchr(dvi, '.'); if (p && strcmp(p, ".tex") == 0) *p = 0; strcat(dvi, ".dvi"); return dvi; } static void unrecognized_option (const char *opt) { message(ERR, "$!: unrecognized option: `%s'\n", opt); message(ERR, "Try %s --help for more information.\n", pname); exit(EXIT_FAILURE); } /* the main programm */ int main (int argc, char **argv) { char *dviname; int flag; int i, n; int status; pid_t pid; time_t stamp; tex_argv = xalloc((1 + argc) * sizeof(char*)); tex_argv[0] = argv[0]; tex_argc = 1; pname = strrchr(argv[0], '/'); if (pname == NULL) pname = argv[0]; else pname++; if (strcmp(pname, "pplatex") == 0) { tex_argv[0] = "latex"; } else if (strcmp(pname, "pptex") == 0) { tex_argv[0] = "tex"; } else { for (i = 1; i < argc; ) { if (is_arg(argv[i]) || optend) { tex_argv[tex_argc++] = argv[i++]; } else if (is_optend(argv[i])) { tex_argv[tex_argc++] = argv[i++]; optend = 1; } else if ((n = eval_opt(argv + i, dvipost_odef)) != 0) { i += n; } else unrecognized_option (argv[i]); } tex_argv[tex_argc] = NULL; if (tex_argv[1] == NULL || tex_argc > 3) { dvipost_help(NULL, NULL); return EXIT_SUCCESS; } return dvipost(tex_argv[1], tex_argv[2]); } flag = 1; dviname = NULL; optend = 0; for (i = 1; i < argc; ) { if (is_arg(argv[i]) || optend) { if (argv[i][0] == '\\') { tex_argv[tex_argc++] = argv[i++]; flag = 0; } else if (flag && argv[i][0] != '&') { dviname = get_dvi_name(argv[i]); tex_argv[tex_argc++] = argv[i++]; flag = 0; } else tex_argv[tex_argc++] = argv[i++]; } else if (is_optend(argv[i])) { tex_argv[tex_argc++] = argv[i++]; optend = 1; } else if ((n = eval_opt(argv + i, pptex_odef)) != 0) { i += n; } else unrecognized_option (argv[i]); } tex_argv[tex_argc] = NULL; fflush(stdout); time(&stamp); pid = fork(); if (pid == -1) { perror(argv[0]); exit(EXIT_FAILURE); } if (pid == 0) execvp(tex_argv[0], tex_argv); waitpid(pid, &status, 0); if (dviname) return dvipost(dviname, dviname); dvipost_search(stamp); return EXIT_SUCCESS; } dvipost-1.1/message.c0000664000175000017500000000213507557473331015062 0ustar ericherich00000000000000/* message output $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #include char *pname = "LaTeXPost"; int verboselevel = NOTE; void message (int level, const char *fmt, ...) { if (level <= verboselevel) { va_list list; if (*fmt == '$') { fmt++; if (*fmt == '!') { fputs(pname, stderr); fmt++; } } va_start(list, fmt); vfprintf(stderr, fmt, list); va_end(list); } } dvipost-1.1/pos.c0000664000175000017500000000270707557473331014244 0ustar ericherich00000000000000/* position table $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #define BSIZE 1000 static void pos_expand (PosTab *pos) { if (pos->size <= pos->dim) { POS *save = pos->tab; pos->size += BSIZE; pos->tab = xalloc(pos->size * sizeof(POS)); memcpy(pos->tab, save, pos->dim * sizeof(POS)); xfree(save); } } void pos_init (PosTab *pos) { pos->dim = 0; } void pos_add (PosTab *pos, int beg, int end) { if (beg > end) { int x = beg; beg = end; end = x; } if (pos->dim) { POS *last = pos->tab + pos->dim - 1; if (beg <= last->end && end >= last->beg) { if (last->end < end) last->end = end; if (last->beg > beg) last->beg = beg; return; } } pos_expand(pos); pos->tab[pos->dim].beg = beg; pos->tab[pos->dim].end = end; pos->dim++; } dvipost-1.1/test.tex0000664000175000017500000000553010410275144014755 0ustar ericherich00000000000000\documentclass[12pt,a4paper,twoside]{article} \usepackage{multicol} \usepackage{dvipost} % layout parameters %\hoffset=5mm %\voffset=5mm \parskip\baselineskip % dvipost parameters \dvipostlayout % transfer layout parameters to dvipost \dvipost{layout=0.5pt} %\dvipost{cbframe=1} \dvipost{osstart color push Red} \dvipost{osend color pop} \dvipost{cbstart color push Blue} \dvipost{cbend color pop} %\dvipost{cbrule=2pt} %\dvipost{cbsep=12pt} \dvipost{cbsep=2pt} \dvipost{cbexp=12pt} %\dvipost{cbexp=0pt} \dvipost{osrule=1pt} %\dvipost{osrule=\the\fboxrule} % some test macos \let\cs\changestart \let\ce\changeend \def\stuff{ Here is some stuff inserted.} \def\TN{This Text is new.} \def\TS{This Text is not marked.} \def\TO{This Text is obsolate.} \def\TAB#1#2{ \begin{figure}[#1] \centering \begin{tabular}{|l|r|r|} \hline label & col1 & col2 \\ \hline line1 & 1.1 & 1.2 \\ line2 & \textchanged{\overstrike{0.0}2.1} & 2.2 \\ line3 & 3.1 & 3.2 \\ \hline \end{tabular} \caption{#2} \end{figure} } % test document \begin{document} Output marked as \textchanged{changed} is colored blue. \overstrike{Overstriked} text is colored red. Overstrike mode and change mode are completely independend. Here comes the first paragraph. \textchanged{\overstrike{\TO\stuff\stuff} \TN\stuff\stuff} \TS\stuff\stuff\stuff Here is the second paragraph with some special markings. Here is a total marked formular: $\cs{}\overstrike{\sum_{i=0}^{\infty}x_i}\sum_{i=0}^{\infty}x_i\ce{}$. \TS Here is a partial marked formular: $\sum_{\cs{}\overstrike{i}j\ce{}=0}^{\infty}x_{\cs{}\overstrike{i}j\ce{}}$. \TS \noindent \begin{minipage}[b]{0.45\textwidth} Here starts a minipage. \TS{} \textchanged{\overstrike{\TO} \TN} \TS\stuff \end{minipage} \hfill \begin{minipage}[t]{0.45\textwidth} Here starts a minipage. \TS{} \textchanged{\overstrike{\TO} \TN} \TS\stuff \end{minipage} \TAB{b}{Partially marked float object} \TS\stuff\stuff\stuff\stuff \stuff\stuff\stuff\stuff \marginpar{Here is a partial marked marginpar. \textchanged{\overstrike{\TO} \TN} \TS} \stuff\stuff\stuff\stuff \stuff\stuff\stuff\stuff Here is a partial marked footnote\footnote{% \TS\stuff\stuff\stuff\stuff\stuff \textchanged{\TN\stuff\stuff\stuff\stuff\stuff\stuff\stuff} \TS\stuff\stuff\stuff\stuff\stuff}. \TS{} \textchanged{\overstrike{\TO\stuff}\TN\stuff} \TS\stuff\stuff\stuff\stuff \TAB{t}{Partially marked float object} \changestart \TAB{b}{Total marked float object} \changeend \cs\marginpar{\overstrike{\TO} \TN}\ce Here is a total marked marginpar. \TS\stuff\stuff\stuff\stuff\stuff \begin{multicols}{3}%[\subsection*{Start multicol environment}] Here\cs\footnote{% \TN\stuff\stuff\stuff\stuff}\ce{} is a total marked footnote. \TS\stuff\stuff\stuff\stuff\stuff \TS\stuff\stuff\stuff\stuff\stuff \textchanged{\overstrike{\TO}} \footnote{\TS} \end{multicols} \TS\stuff\stuff\stuff \end{document} dvipost-1.1/tfm.c0000664000175000017500000000755707561161663014236 0ustar ericherich00000000000000/* tfm data $Copyright (C) 2002 Erich Fruehstueck Dvipost 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. Dvipost 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 dvipost; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include "dvipost.h" #include "dvi.h" #include static char tfm_buf[1024]; static int tfm_err = 0; static int tfm_pos = 0; #ifdef KPSEWHICH_NEED_TYPE #define GET_TFM "kpsewhich tfm" #else #define GET_TFM "kpsewhich" #endif static unsigned tfm_byte (FILE *file) { int c; if (tfm_err) return 0; if ((c = getc(file)) != EOF) { tfm_pos++; return c; } fprintf(stderr, "%s:%d: Unexpected end of file.\n", tfm_buf, tfm_pos); tfm_err = 1; return 0; } static int tfm_dim (FILE *file) { unsigned n = tfm_byte(file) << 8; return n + tfm_byte(file); } static int tfm_word (FILE *file) { int val = tfm_byte(file); if (val >= 128) val -= 256; val = val * 256 + tfm_byte(file); val = val * 256 + tfm_byte(file); val = val * 256 + tfm_byte(file); return val; } static void tfm_skip (FILE *file, int n) { while (n-- > 0) tfm_byte(file); } static int tfm_scale (int a, int b) { register int al, bl; if (a < 0) return -tfm_scale(-a, b); if (b < 0) return -tfm_scale(a, -b); al = a & 32767; bl = b & 32767; a >>= 15; b >>= 15; return ((al * bl / 32768) + a * bl + al * b) / 32 + a * b * 1024; } int DviFont_tfm (DviFont *font) { FILE *file; int *tab; int scale; int lh, bc, ec, nw, nh, nd; int i, n; scale = DviFont_scale(font); sprintf(tfm_buf, "%s %s.tfm\n", GET_TFM, font->token.str); file = popen(tfm_buf, "r"); if (!file) { perror(tfm_buf); return -1; } fgets(tfm_buf, sizeof(tfm_buf), file); pclose(file); for (n = 0; n < sizeof(tfm_buf); n++) { if (tfm_buf[n] == '\n') { tfm_buf[n] = 0; break; } } file = fopen(tfm_buf, "rb"); if (!file) { perror(tfm_buf); return -1; } tfm_pos = 0; tfm_err = 0; (void) tfm_dim(file); /* word length of file */ lh = tfm_dim(file); /* words of header data */ bc = tfm_dim(file); /* smallest character code */ ec = tfm_dim(file); /* largest character code */ nw = tfm_dim(file); /* words in width table */ nh = tfm_dim(file); /* words in height table */ nd = tfm_dim(file); /* words in depth table */ (void) tfm_dim(file); /* words in italic correction table */ (void) tfm_dim(file); /* words in lig/kern table */ (void) tfm_dim(file); /* words in kern table */ (void) tfm_dim(file); /* words in extensible char table */ (void) tfm_dim(file); /* words of font parameter data */ tfm_skip(file, 4 * lh); for (i = 0; i < 256; i++) font->width[i] = font->height[i] = font->depth[i] = 0; for (i = bc; i <= ec; i++) { int w = tfm_byte(file); int h = tfm_byte(file); if (i < 256) { font->width[i] = w; font->height[i] = h / 16; font->depth[i] = h % 16; } tfm_skip(file, 2); } if (ec >= 255) ec = 255; n = nw; if (nh > n) n = nh; if (nd > n) n = nd; tab = xalloc(n * sizeof(int)); for (i = 0; i < nw; i++) tab[i] = tfm_scale(tfm_word(file), scale); for (i = bc; i <= ec; i++) font->width[i] = tab[font->width[i]]; for (i = 0; i < nh; i++) tab[i] = tfm_scale(tfm_word(file), scale); for (i = bc; i <= ec; i++) font->height[i] = tab[font->height[i]]; for (i = 0; i < nd; i++) tab[i] = tfm_scale(tfm_word(file), scale); for (i = bc; i <= ec; i++) font->depth[i] = tab[font->depth[i]]; fclose(file); return tfm_err; } dvipost-1.1/dvipost.tex0000664000175000017500000002740410410424160015464 0ustar ericherich00000000000000% This file was generated by efeudoc % document input: ./dvipost.doc:1 \documentclass[10pt,a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{tabularx} \usepackage{varioref} % start of /efeu/lib/efeudoc/efeudoc.ltx \usepackage{textcomp} \usepackage{verbatim} \usepackage{graphicx} \usepackage[dvips,usenames]{color} \usepackage{makeidx} \makeindex \emergencystretch=10pt \parindent=0em \parskip=0.5\baselineskip \topsep=-\parskip \partopsep=0pt \frenchspacing \clubpenalty = 10000 \widowpenalty = 10000 \displaywidowpenalty = 10000 \brokenpenalty=10000 \pagestyle{headings} \newbox\EDtempbox \renewenvironment{description} {\list{}{\settowidth{\labelsep}{~~}% \labelwidth=\leftmargin \advance\labelwidth by -\labelsep \let\makelabel\descriptionlabel}} {\endlist} \renewcommand{\descriptionlabel}[1]{% \savebox{\EDtempbox}{#1}% \ifdim\wd\EDtempbox > \labelwidth \makebox[\labelwidth][l]{\parbox[b]{% \linewidth}{\raggedright #1\\ \strut}}% \else \makebox[\labelwidth][l]{\usebox{\EDtempbox}}% \fi \ignorespaces} \newcommand{\EDsubcaption}[2][0]{\centerline{#2}}% \let\norule\relax \newif\ifcode \codefalse \newenvironment{code}{\bgroup\tt\ignorespaces\codetrue}{\egroup} \newenvironment{EDhangpar}% {\list{}{\labelwidth=0pt\labelsep=0pt \topsep=0pt \itemindent-\leftmargin \listparindent-\leftmargin}\item}% {\endlist} \newcommand{\EDappendix}{\cleardoublepage\appendix \setcounter{secnumdepth}{-1}} \newcommand{\EDmanchapter}[2][1]{\cleardoublepage \addcontentsline{toc}{chapter}{#2}% \markboth{\MakeUppercase{#2}}{}% \chapter*{#2} \clearpage} \def\EDcaptionname{NAME} \newcommand{\EDmanhead}[2][0]{\par{\hskip-\leftmargin \bf #2\par \vspace{-\parsep}}} \newcommand{\EDmansubhead}[2][0]{\par{\hskip-\leftmargin \bf #2\par \vspace{-\parsep}}} \def\EDcaption{\secdef\EDxcaption\EDscaption} \def\EDscaption#1{\EDmanhead{\EDcaptionname}#1\newline} \def\EDxcaption[#1]#2{\EDmanhead{\EDcaptionname}% \addcontentsline{toc}{section}{#1}#2\newline} \newenvironment{EDmanpage}[2][1]{\cleardoublepage \markboth{#2(#1)}{#2(#1)}\let\caption\EDcaption}{} \def\atpoint#1{\hbox to 0pt{\vbox to 0pt{\vss #1}\hss}\ignorespaces}% \makeatletter \def\verbatim@processline{% \leavevmode \ifcode\else\atpoint{\color[gray]{0.9}% \rule[-0.3\baselineskip]{\linewidth}{1.05\baselineskip}}\fi \the\verbatim@line\par}% \newenvironment{EDverbatim}% {\vskip0.5\baselineskip\verbatim}% {\endverbatim\vskip0.5\baselineskip} \makeatother % end of /efeu/lib/efeudoc/efeudoc.ltx % title settings \title{./dvipost.doc} \author{User: Erich Fruehstueck (erich)} \date{March 2006} \begin{document} \begin{EDmanpage}[1]{dvipost} \caption{dvipost, pptex, pplatex {-} post processing of dvi files} \EDmanhead{SYNOPSIS} {\tt{}dvipost\/} [{\tt{}{-}debug\/}] [{\tt{}{-}version\/}] [{\tt{}{-}help\/}] {\it{}in\/} {\it{}out\/} {\tt{}pplatex\/} [{\tt{}{-}debug\/}] [{\tt{}{-}version\/}] [{\tt{}{-}help\/}] [LaTeX{-}Arguments] {\tt{}pptex\/} [{\tt{}{-}debug\/}] [{\tt{}{-}version\/}] [{\tt{}{-}help\/}] [TeX{-}Arguments] \EDmanhead{DESCRIPTION} The command {\tt{}dvipost\/} is a post procesor for dvi files, created by {\tt{}latex\/} or {\tt{}tex\/}. It is used for special modes, which normally needs the support of dvi drivers (such as {\tt{}dvips\/}). With {\tt{}dvipost\/}, this features could be implemented independent of the prefered driver. Currently, the post processor supports layout raster, change bars and overstrike mode. This version of {\tt{}dvipost\/} does not seek the dvi file, so it could be used as a filter. If {\tt{}{-}\/} is given as file name, the command uses standard input or standard output respective. The command does not substitute a missing {\tt{}.dvi\/} extension to the filename. Because the command works with a temporary file and creates the ouput file only after successfull processing the input file, it is possible to use the same name for input and output. If the command is renamed or linked to {\tt{}pplatex\/}/{\tt{}pptex\/}, it runs {\tt{}latex\/}/{\tt{}tex\/} and post processes the createt output. If the name of the dvi file could not be determined by the arguments to {\tt{}latex\/}/{\tt{}tex\/} (e.g. on an interactive run), the command processes all dvi files in the current directory with a modification time later than the run of {\tt{}latex\/}/{\tt{}tex\/}. \EDmansubhead{Basics} If the filter is used in context of \LaTeX{}, the style file {\tt{}dvipost.sty\/} should be included in the \LaTeX{} source. The filter interpretes dvi extensions in the form of \begin{quote} {\tt{}dvipost:\/} {\it{}name\/} [{\it{}arg\/}] \end{quote} where {\it{}arg\/} depends on the command {\it{}name\/} and may be separated from {\it{}name\/} by {\tt{}=\/} or space. All other extensions are not interpreted by {\tt{}dvipost\/} and remain in the dvi file. Such a dvipost command could be placed with the \TeX{} primitive \begin{quote} {\tt{}\texttt{\char92}special\{dvipost:\/} {\it{}cmd\/}{\tt{}\}\/} \end{quote} or the \LaTeX{} macro (provided by {\tt{}dvipost.sty\/}) \begin{quote} {\tt{}\texttt{\char92}dvipost\{\/}{\it{}cmd\/}{\tt{}\}\/} \end{quote} in the dvi file. Depending on the type of {\tt{}dvipost\/} commands, the following kinds of arguments may be used: \begin{description} \item[{{\it{}length\/} }] is a floating point number followed by a unit specification. The following units are supportet by {\tt{}divipost\/}: {\tt{}pt\/}, {\tt{}in\/}, {\tt{}cm\/} and {\tt{}mm\/}. If no argument is given or the unit specification is missing, the corresponding {\it{}length\/} is set to 0. \item[{{\it{}string\/} }] is an arbitrary string argument. \item[{{\it{}flag\/} }] is an integer argument, where a value different from 0 (usually 1) means true and a missing value or 0 means false. \item[{{\it{}depth\/} }] is an integer argument, where a value different from 0 (usually 1) increments a depth counter and a missing value or 0 decrements it. \end{description} \EDmansubhead{Change bars} All text printed with change mode level higher than 0 is marked with a change bar. The following \LaTeX{} macros modifies the change mode level: \begin{description} \item[{{\tt{}{\tt{}\texttt{\char92}changestart\/}\/} }] increments the change mode level. \item[{{\tt{}{\tt{}\texttt{\char92}changeend\/}\/} }] decrements the change mode level. \item[{{\tt{}{\tt{}\texttt{\char92}textchanged\/}\{{\it{}text\/}\}\/} }] increments the change mode level for {\it{}text\/} only. \end{description} The following {\tt{}dvipost\/} commands are used in context of change bars: \begin{description} \item[{{\tt{}cbmode {\it{}depth\/}\/} }] increments/decrements the change mode level. This command is used by the \LaTeX{} macros. \item[{{\tt{}cbrule {\it{}length\/}\/} }] determines the thickness of the change bar. The default value is 2pt. \item[{{\tt{}cbsep {\it{}length\/}\/} }] sets the distance beetween page margin and change bar. The default value is 2pt. \item[{{\tt{}cbexp {\it{}length\/}\/} }] sets the additional height and depth of a character in calculating the change bar positions. The default value is 6pt. \item[{{\tt{}cbstart {\it{}string\/}\/} }] places the dvi extension {\it{}string\/} before printing characters in change mode. \item[{{\tt{}cbend {\it{}string\/}\/} }] places the dvi extension {\it{}string\/} after printing characters in change mode. \end{description} The use of {\tt{}cbstart\/} and {\tt{}cbend\/} allows to set additional attributes to the marked text, depending on the dvi driver. If {\tt{}dvips\/} is used as dvi driver and the preamble of the \LaTeX{} source contains \begin{quote} {\tt{}\texttt{\char92}usepackage\{dvipost\}\/}\\ {\tt{}\texttt{\char92}dvipost\{cbstart color push Blue\}\/}\\ {\tt{}\texttt{\char92}dvipost\{cbend color pop\}\/} \end{quote} the marked text is colored blue. \EDmansubhead{Overstrike mode} All text printed with overstrike level higher than 0 is overstriked with a horizontal line. The overstrike line is positioned at the mean height of every block of text not broken by vertical movements and font changes. The following \LaTeX{} macros modifies the overstrike level: \begin{description} \item[{{\tt{}{\tt{}\texttt{\char92}overstrikeon\/}\/} }] increments the overstrike level. \item[{{\tt{}{\tt{}\texttt{\char92}overstrikeoff\/}\/} }] decrements the overstrike level. \item[{{\tt{}{\tt{}\texttt{\char92}overstrike\/}\{{\it{}text\/}\}\/} }] increments the overstrike level for {\it{}text\/} only. \end{description} The following {\tt{}dvipost\/} commands are used in context of overstrike mode: \begin{description} \item[{{\tt{}osmode {\it{}depth\/}\/} }] increments/decrements the overstrike level. This command is used by the \LaTeX{} macros. \item[{{\tt{}osrule {\it{}length\/}\/} }] sets the thickness of the overstrike line to {\it{}length\/}. The default value is {\tt{}\texttt{\char92}fboxrule\/}. \item[{{\tt{}osstart {\it{}string\/}\/} }] places the dvi extension {\it{}string\/} before change of overstrike mode. \item[{{\tt{}osend {\it{}string\/}\/} }] places the dvi extension {\it{}string\/} after change of overstrike mode. \end{description} The use of {\tt{}osstart\/} and {\tt{}osend\/} is similar to {\tt{}cbstart\/} and {\tt{}cbend\/}. \EDmansubhead{Layout parameters} Layout parameters are transfered to the dvi file on loading the style file. If any changes are made to layout parameters, like {\tt{}\texttt{\char92}evensidemargin\/}, the macro {\tt{}\texttt{\char92}dvipostlayout\/} must be called to get the correct placement of change bars. Additional calls to {\tt{}\texttt{\char92}dvipostlayout\/} are harmeless. \begin{sloppypar} The following layout parameters are transfered to the dvi file: {\tt{}\texttt{\char92}hoffset\/}, {\tt{}\texttt{\char92}voffset\/}, {\tt{}\texttt{\char92}textwidth\/}, {\tt{}\texttt{\char92}textheight\/}, {\tt{}\texttt{\char92}oddsidemargin\/}, {\tt{}\texttt{\char92}evensidemargin\/}, {\tt{}\texttt{\char92}topmargin\/}, {\tt{}\texttt{\char92}headheight\/}, {\tt{}\texttt{\char92}headsep\/}, {\tt{}\texttt{\char92}footskip\/}, {\tt{}\texttt{\char92}marginparsep\/} and {\tt{}\texttt{\char92}marginparwidth\/}. Additional the flag {\tt{}twoside\/} is set to 0 or 1, depending on the document style option {\tt{}twoside\/}. \end{sloppypar} Instead of calling {\tt{}\texttt{\char92}dvipostlayout\/}, partciucular values could be set. The command \begin{quote} {\tt{}\texttt{\char92}dvipost\{evensidemargin=\texttt{\char92}the\texttt{\char92}evensidemargin\}\/} \end{quote} transfers the actual setting of {\tt{}\texttt{\char92}evensidemargin\/} to the dvi file. The {\tt{}dvipost\/} command allows the printing of the layout raster by setting {\tt{}layout\/} to a length different to 0. The value of {\tt{}layout\/} is used as the thickness of the raster lines. For example: The command \begin{quote} {\tt{}\texttt{\char92}dvipost\{layout=\texttt{\char92}the\texttt{\char92}fboxrule\}\/} \end{quote} activates the layout raster and uses the same line thicknes as frame boxes. \EDmanhead{NOTES} The filter is primarly written for \LaTeX{}. It could be used for plain \TeX{}, but currently there is no assistance style file included in the distribution. Maybe somone would write one, I am not a plain \TeX{} user. The current state of change bar mode and overstrike mode must be committed do environments, which are placed on different locations than the current text. This is done in {\tt{}dvipost.sty\/} by redefining {\tt{}\texttt{\char92}color@begingroup\/} and {\tt{}\texttt{\char92}color@endgroup\/}. This may conflict with other packages. If the macro {\tt{}\texttt{\char92}footnoterule\/} is redefined, it should start with the command {\tt{}\texttt{\char92}dvipost\{footnote\}\/} for a correct handling of overstrike mode and change bars. \EDmanhead{COPYRIGHT} Copyright \copyright{} 2002 Erich Fruehstueck \end{EDmanpage} \end{document} dvipost-1.1/dvipost.html0000664000175000017500000002223210410424160015622 0ustar ericherich00000000000000Content-type: text/html Man page of dvipost

dvipost

Section: User Commands (1)
Index Return to Main Contents
 

NAME

dvipost, pptex, pplatex - post processing of dvi files

 

SYNOPSIS

dvipost [-debug] [-version] [-help] in out

pplatex [-debug] [-version] [-help] [LaTeX-Arguments]

pptex [-debug] [-version] [-help] [TeX-Arguments]

 

DESCRIPTION

The command dvipost is a post procesor for dvi files, created by latex or tex. It is used for special modes, which normally needs the support of dvi drivers (such as dvips). With dvipost, this features could be implemented independent of the prefered driver. Currently, the post processor supports layout raster, change bars and overstrike mode.

This version of dvipost does not seek the dvi file, so it could be used as a filter. If - is given as file name, the command uses standard input or standard output respective. The command does not substitute a missing .dvi extension to the filename.

Because the command works with a temporary file and creates the ouput file only after successfull processing the input file, it is possible to use the same name for input and output.

If the command is renamed or linked to pplatex/pptex, it runs latex/tex and post processes the createt output. If the name of the dvi file could not be determined by the arguments to latex/tex (e.g. on an interactive run), the command processes all dvi files in the current directory with a modification time later than the run of latex/tex.

 

Basics

If the filter is used in context of LaTeX, the style file dvipost.sty should be included in the LaTeX source.

The filter interpretes dvi extensions in the form of

dvipost: name [arg]
where arg depends on the command name and may be separated from name by = or space. All other extensions are not interpreted by dvipost and remain in the dvi file.

Such a dvipost command could be placed with the TeX primitive

\special{dvipost: cmd}
or the LaTeX macro (provided by dvipost.sty)
\dvipost{cmd}
in the dvi file.

Depending on the type of dvipost commands, the following kinds of arguments may be used:

length
is a floating point number followed by a unit specification. The following units are supportet by divipost: pt, in, cm and mm. If no argument is given or the unit specification is missing, the corresponding length is set to 0.
string
is an arbitrary string argument.
flag
is an integer argument, where a value different from 0 (usually 1) means true and a missing value or 0 means false.
depth
is an integer argument, where a value different from 0 (usually 1) increments a depth counter and a missing value or 0 decrements it.

 

Change bars

All text printed with change mode level higher than 0 is marked with a change bar.

The following LaTeX macros modifies the change mode level:

\changestart
increments the change mode level.
\changeend
decrements the change mode level.
\textchanged{text}
increments the change mode level for text only.

The following dvipost commands are used in context of change bars:

cbmode depth
increments/decrements the change mode level. This command is used by the LaTeX macros.
cbrule length
determines the thickness of the change bar. The default value is 2pt.
cbsep length
sets the distance beetween page margin and change bar. The default value is 2pt.
cbexp length
sets the additional height and depth of a character in calculating the change bar positions. The default value is 6pt.
cbstart string
places the dvi extension string before printing characters in change mode.
cbend string
places the dvi extension string after printing characters in change mode.

The use of cbstart and cbend allows to set additional attributes to the marked text, depending on the dvi driver.

If dvips is used as dvi driver and the preamble of the LaTeX source contains

\usepackage{dvipost}
\dvipost{cbstart color push Blue}
\dvipost{cbend color pop}
the marked text is colored blue.

 

Overstrike mode

All text printed with overstrike level higher than 0 is overstriked with a horizontal line.

The overstrike line is positioned at the mean height of every block of text not broken by vertical movements and font changes.

The following LaTeX macros modifies the overstrike level:

\overstrikeon
increments the overstrike level.
\overstrikeoff
decrements the overstrike level.
\overstrike{text}
increments the overstrike level for text only.

The following dvipost commands are used in context of overstrike mode:

osmode depth
increments/decrements the overstrike level. This command is used by the LaTeX macros.
osrule length
sets the thickness of the overstrike line to length. The default value is \fboxrule.
osstart string
places the dvi extension string before change of overstrike mode.
osend string
places the dvi extension string after change of overstrike mode.

The use of osstart and osend is similar to cbstart and cbend.

 

Layout parameters

Layout parameters are transfered to the dvi file on loading the style file. If any changes are made to layout parameters, like \evensidemargin, the macro \dvipostlayout must be called to get the correct placement of change bars. Additional calls to \dvipostlayout are harmeless.

The following layout parameters are transfered to the dvi file: \hoffset, \voffset, \textwidth, \textheight, \oddsidemargin, \evensidemargin, \topmargin, \headheight, \headsep, \footskip, \marginparsep and \marginparwidth. Additional the flag twoside is set to 0 or 1, depending on the document style option twoside.

Instead of calling \dvipostlayout, partciucular values could be set. The command

\dvipost{evensidemargin=\the\evensidemargin}
transfers the actual setting of \evensidemargin to the dvi file.

The dvipost command allows the printing of the layout raster by setting layout to a length different to 0. The value of layout is used as the thickness of the raster lines.

For example: The command

\dvipost{layout=\the\fboxrule}
activates the layout raster and uses the same line thicknes as frame boxes.

 

NOTES

The filter is primarly written for LaTeX. It could be used for plain TeX, but currently there is no assistance style file included in the distribution. Maybe somone would write one, I am not a plain TeX user.

The current state of change bar mode and overstrike mode must be committed do environments, which are placed on different locations than the current text. This is done in dvipost.sty by redefining \color@begingroup and \color@endgroup. This may conflict with other packages.

If the macro \footnoterule is redefined, it should start with the command \dvipost{footnote} for a correct handling of overstrike mode and change bars.

 

COPYRIGHT

Copyright (C) 2002 Erich Fruehstueck


 

Index

NAME
SYNOPSIS
DESCRIPTION
Basics
Change bars
Overstrike mode
Layout parameters
NOTES
COPYRIGHT

This document was created by man2html, using the manual pages.
Time: 04:47:44 GMT, March 23, 2006