From 22395911d8ae9c8ef0c7ad635ec239b4e3ed4992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 12 Jan 2009 08:03:06 +0000 Subject: [PATCH] * use ulem instead of soul for change tracking (fixes bugs 5091, 5480, 5647). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@28115 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/chkconfig.ltx | 1 + lib/doc/LaTeXConfig.lyx | 53 ++++++++++++++++++++++++++++++++++------- src/Buffer.cpp | 10 ++++---- src/BufferParams.cpp | 14 +++++------ src/BufferView.cpp | 10 ++++---- src/LaTeXFeatures.cpp | 22 ++++++++++------- 6 files changed, 75 insertions(+), 35 deletions(-) diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 6554cf6748..19b62e53c4 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -268,6 +268,7 @@ \TestPackage{soul} \TestPackage{subfig} \TestPackage{textcomp} +\TestPackage{ulem} \TestPackage{units} \TestPackage{url} \TestPackage{varioref} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index b490b79734..18fcf661d2 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ -#LyX 1.6.2svn created this file. For more info see http://www.lyx.org/ -\lyxformat 345 +#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/ +\lyxformat 347 \begin_document \begin_header \textclass article @@ -3949,6 +3949,40 @@ bibtopic is used to split BibTeX created bibliographies into sections. \end_layout +\begin_layout Subsection +CJKutf8 +\end_layout + +\begin_layout Description +Found: +\begin_inset Info +type "package" +arg "CJKutf8" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family typewriter +language/chinese/CJK/ +\end_layout + +\begin_layout Description +Notes: The package +\family sans +CJKutf8 +\family default + (part of the +\family sans + CJK +\family default + bundle) merges base LaTeX's and CJK's UTF-8 support. + It is needed to produce proper output with the combination of CJK, utf-8 + encoding, and hyperref. +\end_layout + \begin_layout Subsection dvipost \end_layout @@ -4612,14 +4646,14 @@ setspace \end_layout \begin_layout Subsection -soul +ulem \end_layout \begin_layout Description Found: \begin_inset Info type "package" -arg "soul" +arg "ulem" \end_inset @@ -4628,17 +4662,18 @@ arg "soul" \begin_layout Description CTAN: \family typewriter -macros/latex/contrib/soul +macros/latex/contrib/misc/ \end_layout \begin_layout Description Notes: The package \family sans -soul +ulem \family default - provides hyphenatable letterspacing (spacing out), underlining, striking - out, and some derivatives. - It is needed by LyX to output struck out text in change tracked documents. + provides various types of underlining, striking through and emphasizing + that can stretch between words and be broken across lines. + It is needed by LyX to output struck out text in change tracked documents + to PDF. \end_layout \begin_layout Subsection diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 39397e466c..e7cbbbf7aa 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -557,19 +557,19 @@ bool Buffer::readDocument(Lexer & lex) if (params().outputChanges) { bool dvipost = LaTeXFeatures::isAvailable("dvipost"); - bool xcolorsoul = LaTeXFeatures::isAvailable("soul") && + bool xcolorulem = LaTeXFeatures::isAvailable("ulem") && LaTeXFeatures::isAvailable("xcolor"); - if (!dvipost && !xcolorsoul) { + if (!dvipost && !xcolorulem) { Alert::warning(_("Changes not shown in LaTeX output"), _("Changes will not be highlighted in LaTeX output, " - "because neither dvipost nor xcolor/soul are installed.\n" + "because neither dvipost nor xcolor/ulem are installed.\n" "Please install these packages or redefine " "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); - } else if (!xcolorsoul) { + } else if (!xcolorulem) { Alert::warning(_("Changes not shown in LaTeX output"), _("Changes will not be highlighted in LaTeX output " - "when using pdflatex, because xcolor and soul are not installed.\n" + "when using pdflatex, because xcolor and ulem are not installed.\n" "Please install both packages or redefine " "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); } diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 3a47808c8f..55a9812a3d 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -858,7 +858,7 @@ void BufferParams::validate(LaTeXFeatures & features) const if (outputChanges) { bool dvipost = LaTeXFeatures::isAvailable("dvipost"); - bool xcolorsoul = LaTeXFeatures::isAvailable("soul") && + bool xcolorulem = LaTeXFeatures::isAvailable("ulem") && LaTeXFeatures::isAvailable("xcolor"); switch (features.runparams().flavor) { @@ -866,18 +866,18 @@ void BufferParams::validate(LaTeXFeatures & features) const if (dvipost) { features.require("ct-dvipost"); features.require("dvipost"); - } else if (xcolorsoul) { - features.require("ct-xcolor-soul"); - features.require("soul"); + } else if (xcolorulem) { + features.require("ct-xcolor-ulem"); + features.require("ulem"); features.require("xcolor"); } else { features.require("ct-none"); } break; case OutputParams::PDFLATEX: - if (xcolorsoul) { - features.require("ct-xcolor-soul"); - features.require("soul"); + if (xcolorulem) { + features.require("ct-xcolor-ulem"); + features.require("ulem"); features.require("xcolor"); // improves color handling in PDF output features.require("pdfcolmk"); diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 4467908787..0601b8bba2 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1138,19 +1138,19 @@ bool BufferView::dispatch(FuncRequest const & cmd) buffer_.params().outputChanges = !buffer_.params().outputChanges; if (buffer_.params().outputChanges) { bool dvipost = LaTeXFeatures::isAvailable("dvipost"); - bool xcolorsoul = LaTeXFeatures::isAvailable("soul") && + bool xcolorulem = LaTeXFeatures::isAvailable("ulem") && LaTeXFeatures::isAvailable("xcolor"); - if (!dvipost && !xcolorsoul) { + if (!dvipost && !xcolorulem) { Alert::warning(_("Changes not shown in LaTeX output"), _("Changes will not be highlighted in LaTeX output, " - "because neither dvipost nor xcolor/soul are installed.\n" + "because neither dvipost nor xcolor/ulem are installed.\n" "Please install these packages or redefine " "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); - } else if (!xcolorsoul) { + } else if (!xcolorulem) { Alert::warning(_("Changes not shown in LaTeX output"), _("Changes will not be highlighted in LaTeX output " - "when using pdflatex, because xcolor and soul are not installed.\n" + "when using pdflatex, because xcolor and ulem are not installed.\n" "Please install both packages or redefine " "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); } diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 6658fd030d..8177d7b3f8 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -174,15 +174,15 @@ static string const changetracking_dvipost_def = "\\newcommand{\\lyxdeleted}[3]{%\n" "\\changestart\\overstrikeon#3\\overstrikeoff\\changeend}\n"; -static string const changetracking_xcolor_soul_def = - "%% Change tracking with soul\n" +static string const changetracking_xcolor_ulem_def = + "%% Change tracking with ulem\n" "\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\n" - "\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\st{#3}}}\n"; + "\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\sout{#3}}}\n"; -static string const changetracking_xcolor_soul_hyperref_def = - "%% Change tracking with soul\n" +static string const changetracking_xcolor_ulem_hyperref_def = + "%% Change tracking with ulem\n" "\\newcommand{\\lyxadded}[3]{{\\texorpdfstring{\\color{lyxadded}}{}#3}}\n" - "\\newcommand{\\lyxdeleted}[3]{{\\texorpdfstring{\\color{lyxdeleted}\\st{#3}}{}}}\n"; + "\\newcommand{\\lyxdeleted}[3]{{\\texorpdfstring{\\color{lyxdeleted}\\sout{#3}}{}}}\n"; static string const changetracking_none_def = "\\newcommand{\\lyxadded}[3]{#3}\n" @@ -687,6 +687,10 @@ string const LaTeXFeatures::getPackages() const if (mustProvide("xy")) packages << "\\usepackage[all]{xy}\n"; + if (mustProvide("ulem")) + packages << "\\PassOptionsToPackage{normalem}{ulem}\n" + "\\usepackage{ulem}\n"; + if (mustProvide("nomencl")) { // Make it work with the new and old version of the package, // but don't use the compatibility option since it is @@ -814,7 +818,7 @@ string const LaTeXFeatures::getMacros() const if (mustProvide("ct-dvipost")) macros << changetracking_dvipost_def; - if (mustProvide("ct-xcolor-soul")) { + if (mustProvide("ct-xcolor-ulem")) { int const prec = macros.precision(2); RGBColor cadd = rgbFromHexName(lcolor.getX11Name(Color_addedtext)); @@ -828,9 +832,9 @@ string const LaTeXFeatures::getMacros() const macros.precision(prec); if (isRequired("hyperref")) - macros << changetracking_xcolor_soul_hyperref_def; + macros << changetracking_xcolor_ulem_hyperref_def; else - macros << changetracking_xcolor_soul_def; + macros << changetracking_xcolor_ulem_def; } if (mustProvide("ct-none"))