| 1 |
README for project vpe 2012/04/18 v0.2 |
| 2 |
|
| 3 |
TABLE OF CONTENTS |
| 4 |
================= |
| 5 |
A. Project vpe |
| 6 |
B. Copyright, Disclaimer, Lizenz |
| 7 |
C. Files |
| 8 |
D. Requirements |
| 9 |
E. Installation |
| 10 |
F. Howto |
| 11 |
F.1 VTeX/Linux |
| 12 |
F.2 PdfTeX and dvips |
| 13 |
F.3 (X)emacs |
| 14 |
G. User interface |
| 15 |
G.1 Perl script |
| 16 |
G.2 Package |
| 17 |
H. Linux launch details |
| 18 |
I. Author |
| 19 |
J. Questions, bug reports |
| 20 |
K. History |
| 21 |
|
| 22 |
A. PROJECT VPE |
| 23 |
============== |
| 24 |
VPE deals with source specials for pdf files: clicking |
| 25 |
on special annotations will launch an editor with the |
| 26 |
source file at the source line. |
| 27 |
|
| 28 |
The project supports three routes to pdf files: |
| 29 |
|
| 30 |
* VTeX/Linux route: |
| 31 |
MicroPress' VTeX is able to insert specials by itself. |
| 32 |
It smoothly works under Windows. But the AcrobatReader |
| 33 |
versions under Linux/Unix require additional work, see |
| 34 |
section H "Linux launch details", that is done by the |
| 35 |
perl script `vpe.pl'. |
| 36 |
|
| 37 |
* pdfTeX route: |
| 38 |
For Han The Thanh's pdfTeX under Linux/Unix or Windows |
| 39 |
the package `vpe.sty' inserts the specials with the |
| 40 |
help of the perl script `vpe.pl'. |
| 41 |
The catalog entry `/AcroForm' is added, so that |
| 42 |
the `revert' menu entry of AR4.05 is enabled for |
| 43 |
easier reloading, if the pdf file has changed. |
| 44 |
Users of AR4.05 can also try option `form' of |
| 45 |
the package to get nicer source special markers, |
| 46 |
but the memory consumption is higher. |
| 47 |
|
| 48 |
* dvips route: |
| 49 |
As in the pdfTeX route package `vpe.sty' inserts the |
| 50 |
specials with the help of the perl script `vpe.pl'. |
| 51 |
Also the `/AcroForm' entry is added, but the |
| 52 |
`form' option is not implemented. |
| 53 |
|
| 54 |
B. COPYRIGHT, DISCLAIMER, LIZENZ |
| 55 |
================================ |
| 56 |
Copyright (C) 1999, 2000, 2012 Heiko Oberdiek. |
| 57 |
|
| 58 |
This program may be distributed and/or modified under the |
| 59 |
conditions of the LaTeX Project Public License, either version 1.2 |
| 60 |
of this license or (at your option) any later version. |
| 61 |
The latest version of this license is in |
| 62 |
http://www.latex-project.org/lppl.txt |
| 63 |
and version 1.2 or later is part of all distributions of LaTeX |
| 64 |
version 1999/12/01 or later. |
| 65 |
|
| 66 |
C. FILES |
| 67 |
======== |
| 68 |
The project `vpe' consists of three files: |
| 69 |
|
| 70 |
vpe(.pl): Perl script, used by all routes. The extension `.pl' |
| 71 |
may be omitted for installation purposes. |
| 72 |
vpe.sty: LaTeX2e package for pdftex and dvips routes. |
| 73 |
README: Documentation, the file you are reading. |
| 74 |
|
| 75 |
Help and temporary files, generated by use: |
| 76 |
myfile.tex.vpe: Symbol link from source file `myfile.tex' |
| 77 |
to the perl script, required for the source |
| 78 |
specials launch actions in the pdf file. |
| 79 |
Each source file need a link. |
| 80 |
myfile.vpe: Temporary file for data exchange between |
| 81 |
TeX and the perl script called by \write18{}. |
| 82 |
vpe.cfg: Configuration file of package `vpe.sty'. |
| 83 |
|
| 84 |
D. REQUIREMENTS |
| 85 |
=============== |
| 86 |
All routes: |
| 87 |
* Perl5 (version 5 of the perl interpreter). |
| 88 |
|
| 89 |
pdfTeX, dvips routes: |
| 90 |
* \write18 feature (--shell-escape) |
| 91 |
* LaTeX2e |
| 92 |
|
| 93 |
pdfTeX route: |
| 94 |
* pdfTeX >= v0.14 |
| 95 |
|
| 96 |
E. INSTALLATION |
| 97 |
=============== |
| 98 |
1. TeX directory structure (TDS): |
| 99 |
The files |
| 100 |
`vpe.txt' (documentation) |
| 101 |
`vpe.sty' (pdf(e)tex, pdf(e)latex, (e)tex, (e)latex) |
| 102 |
go to |
| 103 |
texmf/doc/latex/oberdiek/vpe.txt |
| 104 |
texmf/tex/latex/oberdiek/vpe.sty |
| 105 |
|
| 106 |
2. Perl script `vpe.pl': |
| 107 |
|
| 108 |
Unix |
| 109 |
* Your are allowed to rename `vpe.pl' to `vpe': |
| 110 |
mv vpe.pl vpe |
| 111 |
* Ensure that the execute permission is set: |
| 112 |
chmod +x vpe |
| 113 |
* Move the file to a directory where the shell can find it |
| 114 |
(environment variable PATH, e.g. /usr/local/bin/). |
| 115 |
* The environment variables TEXEDIT and VPE are |
| 116 |
looked for the editor call, eg: |
| 117 |
export VPE='xterm -e joe +%d %s' (bash) |
| 118 |
%d will be replaced by the line number and |
| 119 |
%s by the file name. |
| 120 |
|
| 121 |
Windows (Dos) |
| 122 |
* Methods for calling by typing the script name without extension |
| 123 |
and perl interpreter: |
| 124 |
a) If your perl distribution provides a pl2exe program, |
| 125 |
use it to generate `vpe.exe'. |
| 126 |
Advantage: I/O redirection works. |
| 127 |
b) A good method is a dos program of John Dallman: |
| 128 |
#!perl.exe (versions below 4) |
| 129 |
hbperl.exe (version 4) |
| 130 |
http://www.perl.com/CPAN/authors/id/JDALLMAN/hbp_403.zip |
| 131 |
Move vpe.pl in a PERLLIB directory and copy the |
| 132 |
exe program to `vpe.exe'. Then the program looks |
| 133 |
for the perl interpreter, the script and calls them. |
| 134 |
Advantage: I/O redirection works. |
| 135 |
c) Windows NT 4.0 users can use associated file types: |
| 136 |
SET PATHEXT=.pl;%PATHEXT% |
| 137 |
See perl win32 faq "How do I associate Perl scripts with perl?": |
| 138 |
http://www.activestate.com/support/faqs/win32/perlwin32faq4.html |
| 139 |
Disadvantage: I/O redirection does not work. |
| 140 |
d) 4DOS: SET .PL=c:/bin/perl.exe |
| 141 |
See perl win32 faq "How can I get Perl to run a Perl script at |
| 142 |
the 4DOS command line by typing the name of the script without |
| 143 |
the extension or "perl", just like a regular exe file?": |
| 144 |
http://www.activestate.com/support/faqs/win32/perlwin32faq1.html |
| 145 |
e) Convert the perl script to a batch file `vpe.bat', if your |
| 146 |
distribution provides `pl2bat.bat'. |
| 147 |
Disadvantage: I/O redirection does not work. |
| 148 |
Many of this methods are listed in the perl win32 faq |
| 149 |
"What's the equivalent of the shebang ("#!") syntax for Win32?": |
| 150 |
http://www.activestate.com/support/faqs/win32/perlwin32faq4.html |
| 151 |
* Running the perl interpreter directly with the perl script: |
| 152 |
perl vpe.pl ... |
| 153 |
Use this method only, if the other methods fail. |
| 154 |
Then you have to configure the command name in the |
| 155 |
configuration file `vpe.cfg': |
| 156 |
\vpesetup{command={perl vpe.pl}} |
| 157 |
* The editor application and the syntax of the paramters |
| 158 |
for the editor can be configured by \vpesetup in |
| 159 |
the configuration file `vpe.cfg': |
| 160 |
\vpesetup{application={pfe.exe},parameters={-g $d $s}} |
| 161 |
$d will be replaced by the line number, |
| 162 |
$s by the file name. |
| 163 |
|
| 164 |
F. HOWTO |
| 165 |
======== |
| 166 |
|
| 167 |
F.1 VTeX/Linux |
| 168 |
-------------- |
| 169 |
Do not use the package `vpe.sty', the VTeX/Linux route |
| 170 |
is only based on the perl script. |
| 171 |
|
| 172 |
a) Enable VTeX's source special generation with option `-*<num>', |
| 173 |
eg: -*20 |
| 174 |
b) Run the perl script on the generated pdf file. It |
| 175 |
fixes the launch actions and creates the necessary symbol |
| 176 |
links (See section H "Linux launch details"): |
| 177 |
vpe myfile.pdf |
| 178 |
|
| 179 |
F.2 PdfTeX and dvips |
| 180 |
-------------------- |
| 181 |
a) Load the package `vpe.sty', eg: |
| 182 |
\usepackage{vpe} |
| 183 |
b) Produce the pdf file, but with enabled \write18{} feature |
| 184 |
for system commands. This can be achieved by setting the |
| 185 |
command line option `--shell-escape' for pdfTeX or TeX. |
| 186 |
An alternative is the boolean variable `shell_escape' |
| 187 |
in the configuration file `texmf.cnf'. For security |
| 188 |
reasons I recommend the command line option. |
| 189 |
c) Only Linux: After the first call it is possible that |
| 190 |
the symbol links are not created yet (depends on write |
| 191 |
puffer effects). Then it can be done by envoking the |
| 192 |
perl script manually: |
| 193 |
vpe myfile.pdf |
| 194 |
|
| 195 |
F.3 (X)emacs |
| 196 |
------------ |
| 197 |
This section is provided by Uwe Brauer. |
| 198 |
|
| 199 |
In order to use vpe with (X)emacs, you will need to set a |
| 200 |
client as the editor variable since otherwise for each |
| 201 |
call a separate (X)macs session would be started. There |
| 202 |
are two server/clients: gnuclient which is shipped with |
| 203 |
xemacs and emacsclient which is shipped with GNU emacs. |
| 204 |
The configuration for emacsclient is a little more |
| 205 |
delicate, that's why in the following only the |
| 206 |
configuration of gnuclient is discussed. Either install |
| 207 |
gnuclient for GNU emacs or, if you want to use emacsclient, |
| 208 |
read the following instuctions |
| 209 |
http://xdvi.sourceforge.net/inverse-search.html. |
| 210 |
|
| 211 |
* insert in your .emacs the line |
| 212 |
(gnuserv-start) |
| 213 |
|
| 214 |
* set the variable VPE, either |
| 215 |
setenv VPE 'gnuclient -q +%d %s' |
| 216 |
in your .tcshrc file or |
| 217 |
export VPE='gnuclient -q +%d %s' |
| 218 |
in your .bashrc file |
| 219 |
|
| 220 |
* now if you want to avoid that a new window(frame) is |
| 221 |
opened every time you call the gnuclient, insert |
| 222 |
something like this in your .emacs file |
| 223 |
|
| 224 |
(custom-set-variables |
| 225 |
;;; ... other stuff ... |
| 226 |
'(gnuserv-frame t) |
| 227 |
'(gnuserv-visit-hook (lambda () (raise-frame) (recenter)))) |
| 228 |
|
| 229 |
* If you use AuCTeX, the following definitions come in handy: |
| 230 |
Copy in your .emacs file |
| 231 |
|
| 232 |
(custom-set-variables |
| 233 |
'(TeX-command-list (quote ( |
| 234 |
;; ..other stuff.. |
| 235 |
("srcpdflatex" "pdflatex --shell-escape %t" TeX-run-command t "nil") |
| 236 |
("vpe" "vpe %g" TeX-run-command t nil)))) |
| 237 |
'(TeX-expand-list (quote ( |
| 238 |
;; ..other stuff.. |
| 239 |
("%g" file "pdf" t))))) |
| 240 |
|
| 241 |
If you don't want to use %g for pdf files, use another letter |
| 242 |
but make sure that it is not already in use. |
| 243 |
Now you can call srcpdflatex for generating an appropriate pdf |
| 244 |
file and the perl script vpe to insert the source specials. |
| 245 |
|
| 246 |
G. USER INTERFACE |
| 247 |
================= |
| 248 |
|
| 249 |
G.1 Perl script |
| 250 |
--------------- |
| 251 |
General options: |
| 252 |
--help: print help and usage screen. |
| 253 |
--verbose: print additional informations. |
| 254 |
|
| 255 |
Options that influence the symbol links: |
| 256 |
--force: force symbol links (`ln -f' is called). |
| 257 |
--delete: remove the symbol links for the source files, |
| 258 |
mentioned in the pdf file: |
| 259 |
vpe --delete myfile.pdf |
| 260 |
|
| 261 |
Internal options, called by the package `vpe.sty': |
| 262 |
--system: detects the system (linux or win) and writes |
| 263 |
the information in the data exchange file: |
| 264 |
vpe --system myfile.vpe |
| 265 |
--sty: generates the absolute file name of the |
| 266 |
source file `file.tex', get the maximum |
| 267 |
line number and writes the informations |
| 268 |
in the data exchange file `myfile.vpe': |
| 269 |
vpe --sty file.tex myfile.vpe |
| 270 |
--progname: this option sets the program name option |
| 271 |
of `kpsewhich', called by the --sty option: |
| 272 |
vpe --sty --progname=pdfelatex file.tex myfile.vpe |
| 273 |
|
| 274 |
G.2 Package |
| 275 |
----------- |
| 276 |
There are three places, where the options can be specified |
| 277 |
in evaluation order: |
| 278 |
a) Configuration file `vpe.cfg` with \vpesetup. |
| 279 |
b) LaTeX package options: local in \usepackage or |
| 280 |
global in \documentclass. |
| 281 |
c) Some options can be set by \vpesetup after the |
| 282 |
package is loaded. |
| 283 |
|
| 284 |
`active', `inactive' (place: abc, default: active) |
| 285 |
Enables/disables insertion of source specials |
| 286 |
|
| 287 |
`debug' (place: a, default: off) |
| 288 |
Verbose messages for debugging purposes. |
| 289 |
|
| 290 |
`dupes', `nodupes' (place: abc, default: dupes) |
| 291 |
Option `nodupes' suppresses source specials that point |
| 292 |
to the same file and line. |
| 293 |
|
| 294 |
`linux', `unix', `win', `dos' (place: ab, default: automatic) |
| 295 |
`system=linux|win' (place b) |
| 296 |
The format of the launch action differs in the win and unix |
| 297 |
case. Therefore the packages has to know, which kind it |
| 298 |
should generate. If none of the options is given, then |
| 299 |
the packages calls the perl script with option `--system' |
| 300 |
to get the information. |
| 301 |
(Recommendation: set in `vpe.cfg' to save time.) |
| 302 |
|
| 303 |
`form', `noform' (place: ab, default: noform) |
| 304 |
Users of AR4.05 can try this option to get nicer |
| 305 |
source special marks. Only the pdfTeX route is |
| 306 |
supported currently. |
| 307 |
|
| 308 |
`acroform', `noacroform' (place: ab, default: acroform) |
| 309 |
With forms AR4.05 enables the `revert' menu entry, |
| 310 |
so that changed files can more easily be reloaded. |
| 311 |
If option `form' is used, the /AcroForm dictionary |
| 312 |
can be suppressed with `noacroform', when another |
| 313 |
/AcroForm is already provided. |
| 314 |
|
| 315 |
`command=...' (place: bc, default: vpe) |
| 316 |
Call of the perl script for the \write18{} feature. |
| 317 |
|
| 318 |
`progname=...' (place: bc, default: automatic) |
| 319 |
TeX cannot provide absolute path names of files, |
| 320 |
therefore the package calls the perl script to ask |
| 321 |
`kpsewhich'. This program needs the program/format |
| 322 |
name in order to select the correct search path |
| 323 |
variables. Automatically the package is able to |
| 324 |
distinguish between `latex', `elatex', `pdflatex' |
| 325 |
and `pdfelatex'. For other names this option has |
| 326 |
to be set. |
| 327 |
|
| 328 |
`application=...' (place: bc, default: pfe.exe) |
| 329 |
`parameters=...' (place: bc, default: `-g $d $s') |
| 330 |
These options configure the editor call for windows: |
| 331 |
`application' contains the call of the editor, |
| 332 |
`parameters' the parameters for the editor. |
| 333 |
$d will be replaced by the line number and |
| 334 |
$s by the file name. |
| 335 |
|
| 336 |
`width', `height', `depth', `color', `border', |
| 337 |
`flag', `attr' (place: bc, default: see vpe.sty) |
| 338 |
With these options the launch annotation |
| 339 |
can be configured (`noform' version). |
| 340 |
Because of the beta status of the options, |
| 341 |
they can change in future, for details see |
| 342 |
the package source. |
| 343 |
|
| 344 |
`everyhbox', `noeveryhbox' (place: ab, default: noeveryhbox) |
| 345 |
By this option a lot of source specials are inserted, |
| 346 |
but there is a high risk to get a lot of "Underfull |
| 347 |
\hbox" warnings. |
| 348 |
|
| 349 |
`no<feature>' (place: a, default: <feature>) |
| 350 |
For the introduction of source specials many |
| 351 |
internal commands are redefined. This can cause |
| 352 |
problems with incompatible packages and macros. |
| 353 |
The redefinitions that cause problems can be |
| 354 |
disabled. Current list of features: |
| 355 |
input, @input, include, |
| 356 |
newpage, clearpage, |
| 357 |
everypar, document, @item, @doendpe, |
| 358 |
@arrayparboxrestore, @xsect, @afterheading, |
| 359 |
@setminipage, @startsection, |
| 360 |
everymath, everyhbox, |
| 361 |
newline, mbox, TILDE, |
| 362 |
ref, cite, |
| 363 |
item, trivlist, endtrivlist, |
| 364 |
@bsphack, @esphack, @Esphack, @xaddvskip, |
| 365 |
@tabularcr, @arraycr, |
| 366 |
hrule, vrule |
| 367 |
|
| 368 |
H. LINUX LAUNCH DETAILS |
| 369 |
======================= |
| 370 |
It is quite easy to launch a program with parameters |
| 371 |
with a link annotation under Windows, because |
| 372 |
AcrobatReader knows a /Win dictionary, eg: |
| 373 |
<< /Type Annot |
| 374 |
/Subtype /Link |
| 375 |
/Rect [100 700 120 720] |
| 376 |
/A << /Type /Action |
| 377 |
/S /Launch |
| 378 |
/Win << /F (pfe.exe) |
| 379 |
/P (-g 21 c:/myhome/myfile.tex) |
| 380 |
>> |
| 381 |
>> |
| 382 |
>> |
| 383 |
A corresponding /Unix dictionary is not yet defined |
| 384 |
in the pdf specification and not implemented in AR. |
| 385 |
Therefore only the file name can be used to store |
| 386 |
the parameter informations, eg: |
| 387 |
/A << /Type /Action |
| 388 |
/S /Launch |
| 389 |
/F (//.////../myhome/myfile.tex.vpe) |
| 390 |
>> |
| 391 |
|
| 392 |
The file that will be launched is a symbol link |
| 393 |
to the script `vpe(.pl)', eg: |
| 394 |
ln -s /usr/local/bin/vpe /myhome/myfile.tex.vpe |
| 395 |
|
| 396 |
The script scans its calling name, the name of the |
| 397 |
symbol link, to extract the parameters for the |
| 398 |
editor call: |
| 399 |
* The initial part encodes the line number, |
| 400 |
* the rest without the extension `.vpe' is the |
| 401 |
file name. |
| 402 |
* Condition: The path names are absolute path names. |
| 403 |
|
| 404 |
The coding algorithm for the line number: |
| 405 |
* The decimal digits of the number are separated |
| 406 |
and ended by the sequence "./". |
| 407 |
* Each decimal digit of the number is converted |
| 408 |
to a sequence of slashes, optionally followed |
| 409 |
by a period. The count of slashes is the |
| 410 |
number. With the period, the count have to be |
| 411 |
incremented by 5. |
| 412 |
* The conversion of the first digit always starts |
| 413 |
with a slash to ensure a absolute path names, |
| 414 |
eg: "5" is converted to "/////", but not as |
| 415 |
first digit it can be shrunk to ".". |
| 416 |
Examples (spaces only for clarifying): |
| 417 |
2: // ./ |
| 418 |
6: /. ./ |
| 419 |
9: ////. ./ |
| 420 |
11: / ./ / ./ |
| 421 |
28: // ./ ///. ./ (see example above) |
| 422 |
505: ///// ./ ./ . ./ |
| 423 |
|
| 424 |
I. AUTHOR |
| 425 |
========= |
| 426 |
Heiko Oberdiek |
| 427 |
Email: heiko.oberdiek at googlemail.com |
| 428 |
|
| 429 |
J. QUESTIONS, BUG REPORTS |
| 430 |
========================= |
| 431 |
If you have questions, problems with `vpe', error reports, |
| 432 |
if you have improvements or want to have additional features, |
| 433 |
please send them to the author. |
| 434 |
|
| 435 |
Because I do not have to much time, I cannot garantee |
| 436 |
that I will fix all problems and add all suggested features. |
| 437 |
|
| 438 |
Regarding bug reports I have some wishes: |
| 439 |
* Please only send a minimal test file. |
| 440 |
I do not have the time to check hundreds of lines |
| 441 |
and pages. |
| 442 |
Strip the minimal file off all unnecessary packages, |
| 443 |
macros, and stuff. |
| 444 |
But the minimal file should be complete, so that I can |
| 445 |
immediately call latex on it. |
| 446 |
* Please no .log, .dvi, .ps, .pdf files. |
| 447 |
I have a lot of TeX and related programs installed |
| 448 |
and can generate them in the most cases. |
| 449 |
* Please get all versions numbers of packages and |
| 450 |
programs (examples see below). Only the |
| 451 |
distribution version does not help, so I do not |
| 452 |
have MikTeX installed and I am using a very old |
| 453 |
teTeX and even emTeX, but almost always the latest |
| 454 |
pdfTeX binaries. Therefore the pdfTeX version is |
| 455 |
much more important. |
| 456 |
Hints: |
| 457 |
* With "\listfiles" LaTeX prints the versions of the |
| 458 |
used files at the end of the .log file. |
| 459 |
* Many programs know options like: |
| 460 |
--version, -v, -help, -h, -? |
| 461 |
|
| 462 |
My environment for developing and testing (2000): |
| 463 |
* linux, debian 2.0 |
| 464 |
* perl 5.004_04 |
| 465 |
* VTeX/Linux: 7.06 |
| 466 |
* pdfTeX: 0.14g-pretest-20000912 |
| 467 |
* TeX: 3.14159, Web2C 7.2 |
| 468 |
* dvips 5.78 |
| 469 |
* Ghostscript 6.01 |
| 470 |
|
| 471 |
K. HISTORY |
| 472 |
========== |
| 473 |
2000/09/15 v0.1: First release |
| 474 |
2005/11/28 (X)emacs section from Uwe Brauer |
| 475 |
2012/04/18 v0.2: |
| 476 |
* Option --version added. |
| 477 |
* `vpe.txt' renamed to `README'. |
| 478 |
* Email address updated. |