diff options
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/utils/README | 2 | ||||
-rw-r--r-- | Build/source/utils/xpdfopen/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/utils/xpdfopen/README | 10 | ||||
-rwxr-xr-x | Build/source/utils/xpdfopen/configure | 20 | ||||
-rw-r--r-- | Build/source/utils/xpdfopen/configure.ac | 2 | ||||
-rw-r--r-- | Build/source/utils/xpdfopen/configure.ac.orig | 2 | ||||
-rw-r--r-- | Build/source/utils/xpdfopen/pdfclose.c | 6 | ||||
-rw-r--r-- | Build/source/utils/xpdfopen/pdfopen.1 | 154 | ||||
-rw-r--r-- | Build/source/utils/xpdfopen/pdfopen.c | 19 |
9 files changed, 174 insertions, 48 deletions
diff --git a/Build/source/utils/README b/Build/source/utils/README index 368f3b35675..c8906b09d4b 100644 --- a/Build/source/utils/README +++ b/Build/source/utils/README @@ -36,7 +36,7 @@ vlna 1.5 - checked 25apr11 xindy - see just below -xpdfopen 0.81 - checked 19may11 +xpdfopen 0.82 - checked 31may11 http://mirror.ctan.org/support/xpdfopen/ http://cs.acadiau.ca/~jdiamond/xpdfopen/ diff --git a/Build/source/utils/xpdfopen/ChangeLog b/Build/source/utils/xpdfopen/ChangeLog index a81cf7c58cc..4f1ffa7c702 100644 --- a/Build/source/utils/xpdfopen/ChangeLog +++ b/Build/source/utils/xpdfopen/ChangeLog @@ -1,3 +1,10 @@ +2011-05-28 Jim Diamond <jim.diamond@acadiau.ca> + * pdfopen.c: add -v and --version options. + * pdfopen.1: create man page: thanks to Karl Berry for numerous + suggestions and improvements. + * pdfclose.1: add version number to usage information. + * configure.ac: update for V 0.82. + 2011-05-17 Jim Diamond <jim.diamond@acadiau.ca> * pdfopen.c: add -h and --help options. Reformat usage information. diff --git a/Build/source/utils/xpdfopen/README b/Build/source/utils/xpdfopen/README index 30742f7822c..03595663786 100644 --- a/Build/source/utils/xpdfopen/README +++ b/Build/source/utils/xpdfopen/README @@ -1,5 +1,5 @@ --------------------------------------------------------------------------- -xpdfopen 0.81 - Send open/close commands to Acrobat Reader, xpdf and evince +xpdfopen 0.82 - Send open/close commands to Acrobat Reader, xpdf and evince --------------------------------------------------------------------------- This is a Linux (X11) implementation of Fabrice Popineau's pdfclose/ @@ -28,9 +28,11 @@ Version 0.80 adds an implementation for AR 9 and xpdf. Version 0.81 adds an implementation for evince. +Version 0.82 adds a man page and -v/--version options for pdfopen. + The AR command lines do not behave precisely the same as under Windows, because the Linux Reader behaves somewhat differently: it is not -scriptable, but it is possible to 'fake' keypresses. +scriptable, but it is possible to 'fake' key-presses. pdfopen has the following call sequence: @@ -46,7 +48,7 @@ This program closes an existing AR5, AR7, AR8, AR9, xpdf or evince window displaying the given PDF file. -Version 0.81 compiles on Linux (Slackware64 13.1, anyway) with +Version 0.82 compiles on Linux (Slackware64 13.1, anyway) with the following command: gcc -Wall pdfopen.c sendx.c utils.c -o pdfopen -lX11 -s should you not want to go through the process of creating and running @@ -56,7 +58,7 @@ a configure program. Taco Hoekwater <taco@metatex.org> (Version(s) up to 0.61) Dordrecht, The Netherlands, December 2008. -Jim Diamond <jim.diamond@acadiau.ca> (Version 0.80 and 0.81) +Jim Diamond <jim.diamond@acadiau.ca> (Version 0.80, 0.81 and 0.82) Acadia University, Wolfville, Nova Scotia, Canada; May 2011. diff --git a/Build/source/utils/xpdfopen/configure b/Build/source/utils/xpdfopen/configure index 20df50e899b..502bfd09c2d 100755 --- a/Build/source/utils/xpdfopen/configure +++ b/Build/source/utils/xpdfopen/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for xpdfopen for TeX Live 0.81. +# Generated by GNU Autoconf 2.68 for xpdfopen for TeX Live 0.82. # # Report bugs to <tex-k@tug.org>. # @@ -559,8 +559,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xpdfopen for TeX Live' PACKAGE_TARNAME='xpdfopen-for-tex-live' -PACKAGE_VERSION='0.81' -PACKAGE_STRING='xpdfopen for TeX Live 0.81' +PACKAGE_VERSION='0.82' +PACKAGE_STRING='xpdfopen for TeX Live 0.82' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1216,7 +1216,7 @@ if test "$ac_init_help" = "long"; then # 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 <<_ACEOF -\`configure' configures xpdfopen for TeX Live 0.81 to adapt to many kinds of systems. +\`configure' configures xpdfopen for TeX Live 0.82 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1287,7 +1287,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xpdfopen for TeX Live 0.81:";; + short | recursive ) echo "Configuration of xpdfopen for TeX Live 0.82:";; esac cat <<\_ACEOF @@ -1385,7 +1385,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xpdfopen for TeX Live configure 0.81 +xpdfopen for TeX Live configure 0.82 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1590,7 +1590,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xpdfopen for TeX Live $as_me 0.81, which was +It was created by xpdfopen for TeX Live $as_me 0.82, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2409,7 +2409,7 @@ fi # Define the identity of the package. PACKAGE='xpdfopen-for-tex-live' - VERSION='0.81' + VERSION='0.82' cat >>confdefs.h <<_ACEOF @@ -4920,7 +4920,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xpdfopen for TeX Live $as_me 0.81, which was +This file was extended by xpdfopen for TeX Live $as_me 0.82, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4977,7 +4977,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xpdfopen for TeX Live config.status 0.81 +xpdfopen for TeX Live config.status 0.82 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/Build/source/utils/xpdfopen/configure.ac b/Build/source/utils/xpdfopen/configure.ac index 5ff8f0870ac..6966aac3396 100644 --- a/Build/source/utils/xpdfopen/configure.ac +++ b/Build/source/utils/xpdfopen/configure.ac @@ -6,7 +6,7 @@ dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -AC_INIT([xpdfopen for TeX Live], [0.81], [tex-k@tug.org]) +AC_INIT([xpdfopen for TeX Live], [0.82], [tex-k@tug.org]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([pdfopen.c]) AC_CONFIG_AUX_DIR([../../build-aux]) diff --git a/Build/source/utils/xpdfopen/configure.ac.orig b/Build/source/utils/xpdfopen/configure.ac.orig index e065fd418bf..2e891f0834c 100644 --- a/Build/source/utils/xpdfopen/configure.ac.orig +++ b/Build/source/utils/xpdfopen/configure.ac.orig @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. dnl this is for autoconf 2.5x -AC_INIT(pdfopen, 0.81, jim.diamond@acadiau.ca) +AC_INIT(pdfopen, 0.82, jim.diamond@acadiau.ca) AC_CONFIG_AUX_DIR(config) diff --git a/Build/source/utils/xpdfopen/pdfclose.c b/Build/source/utils/xpdfopen/pdfclose.c index 2688d21a94a..eb497f21789 100644 --- a/Build/source/utils/xpdfopen/pdfclose.c +++ b/Build/source/utils/xpdfopen/pdfclose.c @@ -2,13 +2,13 @@ * pdfclose.c * * Modified by Jim Diamond (jim.diamond@acadiau.ca) 2010/04/21 (V 0.80) - * and again 2011/05/17 (V 0.81) + * and again 2011/05/17 (V 0.81, V 0.82) * and Peter Breitenlohner <tex-live@tug.org> (2009). * * This program does not take a viewer argument, and just tries to close * any known viewer displaying the given file. * - * V 0.81 + * V 0.82 */ #include <stdio.h> @@ -20,6 +20,7 @@ #include "xpdfopen.h" #include "utils.h" +#define VERSION "0.82" char * progname; /* set in main(); NOT static! */ @@ -28,6 +29,7 @@ char * progname; /* set in main(); NOT static! */ static void usage(void) { + fprintf(stderr, "%s version %s\n", progname, VERSION); fprintf(stderr, "Usage: %s <file.pdf>\n", progname); } diff --git a/Build/source/utils/xpdfopen/pdfopen.1 b/Build/source/utils/xpdfopen/pdfopen.1 index a98a623a95b..9531dfadd56 100644 --- a/Build/source/utils/xpdfopen/pdfopen.1 +++ b/Build/source/utils/xpdfopen/pdfopen.1 @@ -1,53 +1,157 @@ .\" This manpage is licensed under the GNU Public License -.TH PDFOPEN 1 2011-05-17 "pdfopen version 0.81" "" - +.TH PDFOPEN 1 2011-05-17 "pdfopen 0.82" "" +. .SH NAME -pdfopen \- open or close a PDF file viewer - +pdfopen, pdfclose \- open or close a PDF file viewer +. .SH SYNOPSIS -pdfopen -[ -.IR option -] -<file.pdf> +.B pdfopen +[\fIOPTION\fP] +\fIFILE.PDF\fP .br -pdfclose <file.pdf> - +.B pdfclose +\fIFILE.PDF\fP +. .SH OPTIONS .TP 8 -.B -h -output help +.B -h, --help +output help and exit .TP -.B --help -output help +.B -v, --version +output the version number and exit .TP -.B -viewer <ar9|ar9tab|ar8|ar7|ar5|xpdf|evince> +.B -viewer +<\fIar9\fP|\fIar9-tab\fP|\fIar8\fP|\fIar7\fP|\fIar5\fP|\fIxpdf\fP|\fIevince\fP> use (respectively) Adobe Reader 9 (in a new window), Adobe Reader 9 (in a new tab of a running AR9, if any), Adobe Reader 8, Adobe Reader 7, Adobe Reader 5, xpdf or evince as the PDF viewer program. -Adobe Reader (in a new window) is the default. +Adobe Reader 9 (in a new window) is the default. +. +.SH RATIONALE +At certain points of TeX document preparation, many people repeat a +"edit-compile-view" cycle. Since PDF viewers such as Adobe's Acrobat +Reader ("\fBacroread\fP") do not automatically refresh the display when the +PDF file changes, this cycle can be more cumbersome than desired. +The +.B pdfopen +program provides the ability to automate the reloading of the PDF +document when it is changed. +Note: there seems to be little need for +.B pdfclose +under GNU/Linux, since (unlike the situation for MS windows) +.B acroread +does not lock the PDF file, which would prevent +.B pdftex +(or a DVI to PDF converter) from creating a new version of the PDF +output file. However, +.B pdfclose +is provided in case someone finds it useful. +. .SH DESCRIPTION .B pdfopen -displays the specified PDF file using the given (or default) viewer. +searches for an instance of the specified (or default) PDF viewer +displaying the specified PDF file. If there is already an instance of the given viewer displaying the -given file, the viewer is instructed to reload the file. +given file, the viewer is instructed to reload the file. If no such +instance is found, \fBpdfopen\fP attempts to run the specified viewer +on the specified document. + +The default viewer is "\fBacroread\fP", which could start any one +of a number of versions of Acrobat Reader, depending on what is +installed on your system. However, the commands to reload the current +document vary from one version of \fBacroread\fP to another; +consequently, if you are using a version of \fBacroread\fP other than +AR9, you should explicitly specify the viewer program. + +Version 0.81 of \fBpdfopen\fP accepts the following viewer options: +.br +\fIar9\fP, \fIar9-tab\fP, \fIar8\fP, \fIar7\fP, \fIar5\fP, \fIxpdf\fP, +and \fIevince\fP. +.br +The difference between \fIar9\fP and \fIar9-tab\fP is significant +when there is no instance of AR9 already displaying the requested +document. In this situation, while \fIar9\fP will +request \fBacroread\fP to create a new instance of \fBacroread\fP +(and thus open a new window) by using the \fB-openInNewInstance\fP +argument, \fIar9-tab\fP starts \fBacroread\fP without this argument; +if there is already an instance of \fBacroread\fP running, a new +tab will be opened in an existing window. .B pdfclose searches for one of the above PDF viewers displaying the given file -and instructs the viewer to close the window. +and instructs the viewer to "close" the window. In most cases, the +PDF viewer continues to run, possibly now displaying just a blank +window. (This behaviour varies somewhat from one PDF viewer to another.) +. +.SH PORTABILITY AND AVAILABILITY +Users familiar with the Windows version of +.B pdfopen +might wonder about the lack of a +.B --page +.IR <pagenumber> +option. Unfortunately, to date no GNU/Linux versions of +.B acroread +support this feature. Anyone having a friend at Adobe is encouraged +to ask them to implement a +"\fB-page \fP\fI<pagenumber>\fP" +command line option for \fBacroread\fP. -.SH NOTES -If the file argument to -.B pdfclose -is shown in a tab-capable viewer (such as Adobe Reader 9), the tab -displaying the file is closed, but the window itself is not closed. +These programs have been tested on Slackware64 Version 13.1 and a few +other versions / distributions of GNU/Linux. The code is reasonably +generic and should work out of the box using most recent X11 +implementations. (Reports to the contrary are welcome, particularly +if they come with robust fixes.) These programs are designed for X11-based systems. If you somehow find compiled versions of these programs on a system using another window system, they are very unlikely to be of any use to you. +Source and binaries of the programs can be downloaded from +CTAN://support/xpdfopen/ +(e.g., http://mirror.ctan.org/support/xpdfopen). +. +.SH CAVEATS +If you use +.I ar9-tab +to reload the PDF document and the instance +of +.B acroread +with the given document is currently displaying some other document, +the command causes your document to be displayed, but not reloaded. + +.B pdfopen +works by looking for a window with a name (window title) matching that +expected for the given viewer and document. If for some reason your +viewer's window name is not as expected, +.B pdfopen +may not work for you. +With at least AR9 and some window managers, using +.B pdfopen +to reload the document gives focus to the +.B acroread +window, even though the mouse cursor is not necessarily in that +window. This can be annoying. A contribution from an X11 wizard to +retain focus in the current window (or to restore focus to that +window after reloading the PDF document) would be cheerily accepted. +. .SH AUTHOR This manual page was written by Jim Diamond <Jim.Diamond@acadiau.ca>. +I am the current maintainer of the X11 versions of +.B pdfopen +and +\fBpdfclose\fP. +Report any bugs you find to me. Feature enhancement requests are +welcome, coded enhancements even more so. + +Past authors: +Fabrice Popineau wrote the MS-windows versions of +.B pdfopen +and +.B pdfclose +upon which these programs were originally based. +Taco Hoekwater created the GNU/Linux versions, up to Version 0.61 +(including some documentation which inspired parts of this man page). + diff --git a/Build/source/utils/xpdfopen/pdfopen.c b/Build/source/utils/xpdfopen/pdfopen.c index c94460ccd8e..53383a65ad6 100644 --- a/Build/source/utils/xpdfopen/pdfopen.c +++ b/Build/source/utils/xpdfopen/pdfopen.c @@ -3,8 +3,9 @@ * * Heavily modified by Jim Diamond (jim.diamond@acadiau.ca) 2010/04/11 * to work with AR 9 and xpdf. - * Also some mods by Peter Breitenlohner <tex-live@tug.org> from 2009 - * and suggestions from 2010. + * (Also some mods by Peter Breitenlohner <tex-live@tug.org> from 2009 + * and suggestions from 2010, and some suggestions from Karl Berry + * (2011).) * * Note 1: the calling sequence was changed considerably to match what * the program actually seemed to do as well as what made sense to me. @@ -23,7 +24,7 @@ * please send it to me for inclusion. */ -#define VERSION "0.81" +#define VERSION "0.82" #include <stdio.h> #include <stdlib.h> @@ -162,7 +163,11 @@ usage(void) fprintf(stderr, "This is version %s of %s.\n", VERSION, progname); fprintf(stderr, "Usage:\n %s [-h|--help]\n", progname); - fprintf(stderr, " Show this help.\n"); + fprintf(stderr, " Show this help and exit.\n"); + + fprintf(stderr, " %s [-v|--version]\n", progname); + fprintf(stderr, " Show the version number and exit.\n"); + fprintf(stderr, " %s [-viewer <prog>] <file.pdf>\n", progname); fprintf(stderr, " If the PDF viewer <prog> is displaying <file.pdf>, " "reload that file.\n"); @@ -352,6 +357,12 @@ main(int argc, char * argv[]) return argc < 2 ? EXIT_FAILURE : EXIT_SUCCESS; } + if (!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version")) + { + printf("This is pdfopen version %s\n", VERSION); + return EXIT_SUCCESS; + } + if (argc == 4 && !strcmp(argv[1], "-viewer")) { viewer = argv[2]; |