The following link Hyperref to external pdf that will open at particular label gives great answer for linking individual pdfs. However it seems to NOT working for platex with dvipdfmx that is mostly used for Japanese documents. Is there a way to create hypertarget with the engine, or necessary to use pdflatex which is not compatible with Japanese?
Asked
Active
Viewed 289 times
1
-
Do you mean named destination? (Japanese forum http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=2071 may provide an answer) – Hironobu YAMASHITA Mar 12 '17 at 14:45
1 Answers
3
The problem you are facing is the default setting of dvipdfmx. By default, the PDF destination are optimized, so they cannot be accessed from other files. If you disable the optimization, the hypertarget works.
Ref. dvipdfmx.cfg ($TEXMFDIST/dvipdfmx/dvipdfmx.cfg)
%% Dvipdfmx Compatibility Flags
%%
%% 0x0002 Use semi-transparent filling for tpic shading command,
%% instead of opaque gray color. (requires PDF 1.4)
%% 0x0004 Treat all CIDFont as fixed-pitch font.
%% This is only for backward compatibility. Don't use that.
%% 0x0008 Do not replace duplicate fontmap entries.
%% Dvipdfm's (not 'x') behaviour.
%% 0x0010 Do not optimize PDF destinations. Use this if you want to
%% refer from other files to destinations in the current file.
%C 0x0000
So, you should invoke dvipdfmx as follows, to disable optimization of destinations inside the target file that is referenced:
dvipdfmx -C 0x0010 fileA
Alternatively, if you are using TeX Live 2016 or later, simply adding
\special{dvipdfmx:config C 0x0010}
to fileA.tex has the same effect.
-
http://tex.stackexchange.com/questions/275739/named-destinations-by-hyperref-broken-for-xetex-3-14159265-2-6-0-99992-tex-live is the same situation, since XeTeX uses xdvipdfmx, which shares the binary with dvipdfmx, as an output driver. – Hironobu YAMASHITA Mar 13 '17 at 00:10
-
Great answer! By the way, are there any problems when it is disabled? Anyway, I'm putting
\special{dvipdfmx:config C 0x0010}in my target file for the current purpose. – MasaYan Mar 13 '17 at 07:17 -
1When the optimization is enabled, the target names are shortened (This is why references from external files are impossible). When the optimization is disabled, the original target names (e.g. "myhypertarget1" in fileA.tex you referred to) are preserved, which should mean that the file size may become bigger. Personally I don't think that is a serious problem. – Hironobu YAMASHITA Mar 13 '17 at 11:17
-
Thank you for the response. I definitely disable the optimization without worry :) – MasaYan Mar 14 '17 at 02:51