def checkConverterEntries():
''' Check all converters (\converter entries) '''
checkProg('the pdflatex program', ['pdflatex $$i'],
- rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex=pdflatex"' ])
+ rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex=pdflatex,hyperref-driver=pdftex"' ])
checkProg('XeTeX', ['xelatex $$i'],
- rc_entry = [ r'\converter xetex pdf4 "%%" "latex=xelatex"' ])
+ rc_entry = [ r'\converter xetex pdf4 "%%" "latex=xelatex,hyperref-driver=xetex"' ])
checkLuatex()
rc_entry = [ r'\converter rtf html "%%" ""' ])
# Do not define a converter to pdf6, ps is a pure export format
checkProg('a PS to PDF converter', ['ps2pdf $$i $$o'],
- rc_entry = [ r'\converter ps pdf "%%" ""' ])
+ rc_entry = [ r'\converter ps pdf "%%" "hyperref-driver=dvips"' ])
#
checkProg('a PS to TXT converter', ['pstotext $$i > $$o'],
rc_entry = [ r'\converter ps text2 "%%" ""' ])
rc_entry = [ r'\converter dvi text4 "%%" ""' ])
#
checkProg('a DVI to PS converter', ['dvips -o $$o $$i'],
- rc_entry = [ r'\converter dvi ps "%%" ""' ])
+ rc_entry = [ r'\converter dvi ps "%%" "hyperref-driver=dvips"' ])
#
checkProg('a DVI to cropped EPS converter', ['dvips -E -o $$o $$i'],
rc_entry = [ r'\converter dvi eps3 "%%" ""' ])
#
- checkProg('a DVI to PDF converter', ['dvipdfmx -o $$o $$i', 'dvipdfm -o $$o $$i'],
- rc_entry = [ r'\converter dvi pdf3 "%%" ""' ])
+ checkProg('a DVI to PDF converter', ['dvipdfmx', 'dvipdfm'],
+ rc_entry = [ r'\converter dvi pdf3 "%% -o $$o $$i" "hyperref-driver=%%"' ])
#
checkProg('a fax program', ['kdeprintfax $$i', 'ksendfax $$i', 'hylapex $$i'],
rc_entry = [ r'\converter ps fax "%%" ""'])
\papercolumns 1
\papersides 2
\paperpagestyle headings
-\tracking_changes false
+\tracking_changes true
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict true
+\author -712698321 "Jürgen Spitzmüller"
\end_header
\begin_body
format:
\end_layout
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+
+\change_inserted -712698321 1523206314
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1523206193
+hyperref-driver
+\end_layout
+
+\end_inset
+
+ The name of the driver that needs to be loaded with the
+\family sans
+hyperref
+\family default
+ package for this converter.
+ The loading of the correct driver is necessary to get some PDF-specific
+ features.
+ See the
+\family sans
+hyperref
+\family default
+ manual for details.
+\end_layout
+
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
\end_layout
\begin_layout Standard
-None of these last three are presently used in any of the converters that
- are installed with \SpecialChar LyX
+
+\change_inserted -712698321 1523206384
+A suitable hyperref-driver is set for some converters that are installed
+ with \SpecialChar LyX
+.
+
+\change_deleted -712698321 1523206388
+None of these
+\change_inserted -712698321 1523206389
+The
+\change_unchanged
+ last three
+\change_inserted -712698321 1523206400
+ flags, however,
+\change_unchanged
+ are presently
+\change_inserted -712698321 1523206407
+not
+\change_unchanged
+used in any of the
+\change_inserted -712698321 1523206437
+pre-installed
+\change_unchanged
+converters
+\change_deleted -712698321 1523206442
+ that are installed with \SpecialChar LyX
+
+\change_unchanged
.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
+\family typewriter
+hyperref-driver
+\family default
+Der Name der Treiberdatei, die für diesen Konverter mit dem
+\family sans
+Hyperref
+\family default
+-Paket geladen werden soll.
+ Dies ist nötig, um bestimmte PDF-Features verwenden zu können.
+ Konsultieren Sie das
+\family sans
+Hyperref
+\family default
+-Handbuch für Einzelheiten.
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+
\family typewriter
parselog
\family default
\end_layout
\begin_layout Standard
-Keines dieser Flags wird zur Zeit in einem Konverter benutzt, der zusammen
- mit \SpecialChar LyX
- installiert wird.
+Ein passender Hyperref-Treiber wird für einige mit \SpecialChar LyX
+ installierten Konverter
+ definiert.
+ Die zuletzt aufgeführten drei Flags hingegen werden zurzeit von keinem
+ der vorinstallierten Konverter verwendet.
\end_layout
\begin_layout Standard
return ExportNoPathToFormat;
}
runparams.flavor = converters.getFlavor(path, this);
+ runparams.hyperref_driver = converters.getHyperrefDriver(path);
Graph::EdgePath::const_iterator it = path.begin();
Graph::EdgePath::const_iterator en = path.end();
for (; it != en; ++it)
OutputParams tmp_params = features.runparams();
pdfoptions().writeLaTeX(tmp_params, os,
features.isProvided("hyperref"));
- // correctly break URLs with hyperref and dvi output
- if (features.runparams().flavor == OutputParams::LATEX
+ // correctly break URLs with hyperref and dvi/ps output
+ if (features.runparams().hyperref_driver == "dvips"
&& features.isAvailable("breakurl"))
os << "\\usepackage{breakurl}\n";
} else if (features.isRequired("nameref"))
nice_ = true;
else if (flag_name == "needauth")
need_auth_ = true;
+ else if (flag_name == "hyperref-driver")
+ href_driver_ = flag_value;
}
if (!result_dir_.empty() && result_file_.empty())
result_file_ = "index." + theFormats().extension(to_);
}
+string Converters::getHyperrefDriver(Graph::EdgePath const & path)
+{
+ for (Graph::EdgePath::const_iterator cit = path.begin();
+ cit != path.end(); ++cit) {
+ Converter const & conv = converterlist_[*cit];
+ if (!conv.hyperref_driver().empty())
+ return conv.hyperref_driver();
+ }
+ return string();
+}
+
+
bool Converters::checkAuth(Converter const & conv, string const & doc_fname,
bool use_shell_escape)
{
std::string const result_file() const { return result_file_; }
///
std::string const parselog() const { return parselog_; }
+ ///
+ std::string const hyperref_driver() const { return href_driver_; }
private:
///
trivstring result_file_;
/// Command to convert the program output to a LaTeX log file format
trivstring parselog_;
+ /// The hyperref driver
+ trivstring href_driver_;
};
///
OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path,
Buffer const * buffer = 0);
+ ///
+ std::string getHyperrefDriver(Graph::EdgePath const & path);
/// Flags for converting files
enum ConversionFlags {
/// No special flags
*/
std::string index_command;
+ /** Hyperref driver
+ */
+ std::string hyperref_driver;
+
/** Line length to use with plaintext or LaTeX export.
*/
size_type linelen;
string opt;
string hyperset;
+ // Driver needed by specific converters
+ if (!runparams.hyperref_driver.empty())
+ opt += runparams.hyperref_driver + ",";
+
// since LyX uses unicode, also set the PDF strings to unicode strings with the
// hyperref option "unicode"
opt += "unicode=true,";
- Set correct path to (biblatex) bibliography databases that are entered
relative to child documents (bug 11105).
+- Load hyperref with a suitable driver (bug 6418).
+
* LYX2LYX