You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In upstream dvipdfmx the `dvidpfmx:config` DVI special can be used to
pass arguments to dvipdfmx. This has seen some use in XeTeX packages.
For example, the ubiqitous package "hyperref" uses:
\special{dvipdfmx:config C 0x0010}
This is normally parsed by dvipdfmx as command line arguments, i.e. as
if xdvipdfmx was ran as:
xdvipdfmx -C 0x0010
The `C` option is a bitset of compatibility flags. In this case hyperref
needs the option `OPT_PDFDOC_NO_DEST_REMOVE`, which makes dvipdfmx
handle PDF destinations differently (I didn't check thoroughly how).
The `opt_flags` global variable used to hold these bitflags and the
`dvipdfmx:config` special could be used to set them. tectonic-typesetting#92 removed that
option.
While passing arbitrary command line arguments to dvidpfmx is probably
not what we want, I definitely know, that we at least need the
compatibility flags to work, and there is probably no other way packages
can set them.
The code that does the option parsing is mostly port from the 'C' option
parsing from dvipdfmx's `read_config_special` and `do_args_second_pass`.
IMHO the way `opt_flags` gets modified is undefined behaviour and does
other weird things with negative values, but the purpose of this commit
is to increase compatibility with upstream, not to fix things (which
should preferably be done upstream IMO).
Like with other options, instead of having a global variable, the
pointer to the value in `dvipdfmx_main` is passed around instead.
While at it, I also added `z` and `g` options which also seem to be used
by LaTeX, so this should be enough for a while.
Hopefully fixestectonic-typesetting#904.
0 commit comments