From 0f2cfd957ead7ddafa5e0d1116ec42c5ca067655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 13 Dec 2010 07:58:07 +0000 Subject: [PATCH] Load the package breakurl with hyperref in DVI output (fix bug 7033). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36860 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/chkconfig.ltx | 1 + lib/doc/LaTeXConfig.lyx | 29 +++++++++++++++++++++++++++++ src/BufferParams.cpp | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 2d3ddef7d2..fa0b813d6e 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -251,6 +251,7 @@ \TestPackage{bm} \TestPackage{booktabs} \TestPackage{braille} +\TestPackage{breakurl} \TestPackage{CJKutf8} \TestPackage{color} % this one should be there if graphics.sty is there. \TestPackage{covington} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 935ac9f812..390d407de2 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -4458,6 +4458,35 @@ bibtopic is used to split BibTeX created bibliographies into sections. \end_layout +\begin_layout Subsection +breakurl +\end_layout + +\begin_layout Description +Found: +\begin_inset Info +type "package" +arg "breakurl" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family typewriter +macros/latex/contrib/breakurl/ +\end_layout + +\begin_layout Description +Notes: The package +\family sans +breakurl +\family default + assures that url's are correctly broken at the end of lines with DVI output + when hyperref is used. +\end_layout + \begin_layout Subsection CJKutf8 \end_layout diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 9ed7159f65..a475765d48 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1789,6 +1789,10 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, texrow.newlines(lines); // set back for the rest lyxpreamble.clear(); + // correctly break URLs with hyperref and dvi output + if (features.runparams().flavor == OutputParams::LATEX + && features.isAvailable("breakurl")) + lyxpreamble += "\\usepackage{breakurl}\n"; } else if (features.isRequired("nameref")) // hyperref loads this automatically lyxpreamble += "\\usepackage{nameref}\n";