I'm not sure if an answer is still of interest. Anyway:
1) I would strongly advise to use the pdfx package:
\usepackage[a-1b]{pdfx}
2) The error in the pdfx package is caused by the way how the timestamp is put together. Depending on your timezone (e.g. UTC+1, UTC-1, etc) you have a different sign there. This causes the issue.
Use of \getTZh doesn't match its definition.
You therefore need to put the pdfx.sty in your working directory and need to adjust that specific line accordingly:
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm} % change - to + if error occurs (due to timezone)
...
T\xHour:\xMin:\xSec+\xTZh:\xTZm}} % change - to + if error occurs (due to timezone)
Alternatively, you may change the timezone of your system.
3) pdfx automatically loads the hyperref package, too. If you want to have a customized hyperref setup, you can use:
\hypersetup{
unicode,
colorlinks=true
}
In addition to that, you need to provide a color profile and a valid xmp file. Information on this can be found in the pdfx manual. This solution relies on pdftex.
I'm not aware of any solution using dvips.
To launch from PDF the editor with an unrelated text file with specific options, probably you need do this indirectly.
- Create a script that launches all what you want (e.g. containing
gedit +42 file.txt
). Depending on the viewer file.txt
may need to be an absolute path.
- Link from TeX to that script (e.g. with
href
)
- The script extension (for example
.sh
or .mygedit
, rungeditfromline42.sh
or rungeditfromline42.mygedit
) must be among the executable mime types.
Depending on the viewer, one (or both) of the following points need to be set:
- (
Evince, Acroread
) The extension has to be associated with some type of execution of the script. One way I found for this is here (replacing Java with Bash): https://ask.fedoraproject.org/en/question/9735/how-do-i-launch-jar-files-using-nautilus/?answer=15275#post-id-15275 (I don't know of an automatic way of doing this).
- (
xpdf
) Make the script executable chmod +x rungeditfromline42.sh
.
- (No solution yet for
Okular
)
All that so that acroread
knows how to handle (in other cases, will be treated as any normal text). I also noticed that, for some reason, evince
requires the full paths (inside the scripts).
I tested this in Fedora 20. A similar problem is solved in http://latex-beamer-class.10966.n7.nabble.com/run-a-shell-script-from-a-beamer-generated-pdf-td2049.html. But the instruccions are not complete in my opinion.
EDIT 2015: How to make script extension to be associated with some type of execution of the script? (point 4 above)
(If this is step is not taken Acrobat or Evince might open the script file and not execute the script)
In ~/.local/share/applications/
create a file called run-gedit.desktop
:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=bash %f
Icon=icon
Name=run-gedit
Comment=Run the gedit file
From nautilus
right-click on the rungeditfromline42.mygedit
file (see above) and click the "Open With" tab, scroll down until you find "run-gedit" then click it and "Set as default". Go to Evince, click in the link to test that the script is run.
A loosely related note about SyncTeX
Since 2008 is possible to use SyncTeX
to allow synchronisation between the source and PDF files.
To enable synchronisation, SyncTeX creates an auxiliary file in the format filename.synctex.gz
.
Several LaTeX editors use SyncTeX by default. You do not need change the source .tex
file at all. For example in TeXWorks
you only need one rigth mouse click in the PDF viewer to open a menu and then choose go to the source code (to the lines that correspond to that is actually cliked in the PDF viewer), and with same procedure in the text editor you can return to the PDF viewer (showing the page that you are actually editing).
Best Answer
Here is a slightly modified version of your document:
You get an uncompressed PDF and therefore a readable PDF (by opening it directly in your favorite editor).
The first link is coded as a
GoToR
action (a remote go-to action) similar to an ordinary go-to action but jumps to a destination in another PDF file instead of the current file:The second link is coded as a
Launch
action (to launch an external application):See section 12.6.4.1, p.417-418, Document management — Portable document format — Part 1: PDF 1.7