mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
* use ulem instead of soul for change tracking
(fixes bugs 5091, 5480, 5647). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28114 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9fba7d7759
commit
743a29799b
@ -268,6 +268,7 @@
|
|||||||
\TestPackage{soul}
|
\TestPackage{soul}
|
||||||
\TestPackage{subfig}
|
\TestPackage{subfig}
|
||||||
\TestPackage{textcomp}
|
\TestPackage{textcomp}
|
||||||
|
\TestPackage{ulem}
|
||||||
\TestPackage{units}
|
\TestPackage{units}
|
||||||
\TestPackage{url}
|
\TestPackage{url}
|
||||||
\TestPackage{varioref}
|
\TestPackage{varioref}
|
||||||
|
@ -4612,14 +4612,14 @@ setspace
|
|||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\begin_layout Subsection
|
\begin_layout Subsection
|
||||||
soul
|
ulem
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\begin_layout Description
|
\begin_layout Description
|
||||||
Found:
|
Found:
|
||||||
\begin_inset Info
|
\begin_inset Info
|
||||||
type "package"
|
type "package"
|
||||||
arg "soul"
|
arg "ulem"
|
||||||
\end_inset
|
\end_inset
|
||||||
|
|
||||||
|
|
||||||
@ -4628,17 +4628,18 @@ arg "soul"
|
|||||||
\begin_layout Description
|
\begin_layout Description
|
||||||
CTAN:
|
CTAN:
|
||||||
\family typewriter
|
\family typewriter
|
||||||
macros/latex/contrib/soul
|
macros/latex/contrib/misc/
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\begin_layout Description
|
\begin_layout Description
|
||||||
Notes: The package
|
Notes: The package
|
||||||
\family sans
|
\family sans
|
||||||
soul
|
ulem
|
||||||
\family default
|
\family default
|
||||||
provides hyphenatable letterspacing (spacing out), underlining, striking
|
provides various types of underlining, striking through and emphasizing
|
||||||
out, and some derivatives.
|
that can stretch between words and be broken across lines.
|
||||||
It is needed by LyX to output struck out text in change tracked documents.
|
It is needed by LyX to output struck out text in change tracked documents
|
||||||
|
to PDF.
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\begin_layout Subsection
|
\begin_layout Subsection
|
||||||
|
@ -566,19 +566,19 @@ bool Buffer::readDocument(Lexer & lex)
|
|||||||
|
|
||||||
if (params().outputChanges) {
|
if (params().outputChanges) {
|
||||||
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
||||||
bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
|
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
|
||||||
LaTeXFeatures::isAvailable("xcolor");
|
LaTeXFeatures::isAvailable("xcolor");
|
||||||
|
|
||||||
if (!dvipost && !xcolorsoul) {
|
if (!dvipost && !xcolorulem) {
|
||||||
Alert::warning(_("Changes not shown in LaTeX output"),
|
Alert::warning(_("Changes not shown in LaTeX output"),
|
||||||
_("Changes will not be highlighted 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 "
|
"Please install these packages or redefine "
|
||||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||||
} else if (!xcolorsoul) {
|
} else if (!xcolorulem) {
|
||||||
Alert::warning(_("Changes not shown in LaTeX output"),
|
Alert::warning(_("Changes not shown in LaTeX output"),
|
||||||
_("Changes will not be highlighted 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 "
|
"Please install both packages or redefine "
|
||||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||||
}
|
}
|
||||||
|
@ -858,7 +858,7 @@ void BufferParams::validate(LaTeXFeatures & features) const
|
|||||||
|
|
||||||
if (outputChanges) {
|
if (outputChanges) {
|
||||||
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
||||||
bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
|
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
|
||||||
LaTeXFeatures::isAvailable("xcolor");
|
LaTeXFeatures::isAvailable("xcolor");
|
||||||
|
|
||||||
switch (features.runparams().flavor) {
|
switch (features.runparams().flavor) {
|
||||||
@ -866,18 +866,18 @@ void BufferParams::validate(LaTeXFeatures & features) const
|
|||||||
if (dvipost) {
|
if (dvipost) {
|
||||||
features.require("ct-dvipost");
|
features.require("ct-dvipost");
|
||||||
features.require("dvipost");
|
features.require("dvipost");
|
||||||
} else if (xcolorsoul) {
|
} else if (xcolorulem) {
|
||||||
features.require("ct-xcolor-soul");
|
features.require("ct-xcolor-ulem");
|
||||||
features.require("soul");
|
features.require("ulem");
|
||||||
features.require("xcolor");
|
features.require("xcolor");
|
||||||
} else {
|
} else {
|
||||||
features.require("ct-none");
|
features.require("ct-none");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OutputParams::PDFLATEX:
|
case OutputParams::PDFLATEX:
|
||||||
if (xcolorsoul) {
|
if (xcolorulem) {
|
||||||
features.require("ct-xcolor-soul");
|
features.require("ct-xcolor-ulem");
|
||||||
features.require("soul");
|
features.require("ulem");
|
||||||
features.require("xcolor");
|
features.require("xcolor");
|
||||||
// improves color handling in PDF output
|
// improves color handling in PDF output
|
||||||
features.require("pdfcolmk");
|
features.require("pdfcolmk");
|
||||||
|
@ -1162,19 +1162,19 @@ bool BufferView::dispatch(FuncRequest const & cmd)
|
|||||||
buffer_.params().outputChanges = !buffer_.params().outputChanges;
|
buffer_.params().outputChanges = !buffer_.params().outputChanges;
|
||||||
if (buffer_.params().outputChanges) {
|
if (buffer_.params().outputChanges) {
|
||||||
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
||||||
bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
|
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
|
||||||
LaTeXFeatures::isAvailable("xcolor");
|
LaTeXFeatures::isAvailable("xcolor");
|
||||||
|
|
||||||
if (!dvipost && !xcolorsoul) {
|
if (!dvipost && !xcolorulem) {
|
||||||
Alert::warning(_("Changes not shown in LaTeX output"),
|
Alert::warning(_("Changes not shown in LaTeX output"),
|
||||||
_("Changes will not be highlighted 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 "
|
"Please install these packages or redefine "
|
||||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||||
} else if (!xcolorsoul) {
|
} else if (!xcolorulem) {
|
||||||
Alert::warning(_("Changes not shown in LaTeX output"),
|
Alert::warning(_("Changes not shown in LaTeX output"),
|
||||||
_("Changes will not be highlighted 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 "
|
"Please install both packages or redefine "
|
||||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||||
}
|
}
|
||||||
|
@ -174,15 +174,15 @@ static string const changetracking_dvipost_def =
|
|||||||
"\\newcommand{\\lyxdeleted}[3]{%\n"
|
"\\newcommand{\\lyxdeleted}[3]{%\n"
|
||||||
"\\changestart\\overstrikeon#3\\overstrikeoff\\changeend}\n";
|
"\\changestart\\overstrikeon#3\\overstrikeoff\\changeend}\n";
|
||||||
|
|
||||||
static string const changetracking_xcolor_soul_def =
|
static string const changetracking_xcolor_ulem_def =
|
||||||
"%% Change tracking with soul\n"
|
"%% Change tracking with ulem\n"
|
||||||
"\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\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 =
|
static string const changetracking_xcolor_ulem_hyperref_def =
|
||||||
"%% Change tracking with soul\n"
|
"%% Change tracking with ulem\n"
|
||||||
"\\newcommand{\\lyxadded}[3]{{\\texorpdfstring{\\color{lyxadded}}{}#3}}\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 =
|
static string const changetracking_none_def =
|
||||||
"\\newcommand{\\lyxadded}[3]{#3}\n"
|
"\\newcommand{\\lyxadded}[3]{#3}\n"
|
||||||
@ -687,6 +687,10 @@ string const LaTeXFeatures::getPackages() const
|
|||||||
if (mustProvide("xy"))
|
if (mustProvide("xy"))
|
||||||
packages << "\\usepackage[all]{xy}\n";
|
packages << "\\usepackage[all]{xy}\n";
|
||||||
|
|
||||||
|
if (mustProvide("ulem"))
|
||||||
|
packages << "\\PassOptionsToPackage{normalem}{ulem}\n"
|
||||||
|
"\\usepackage{ulem}\n";
|
||||||
|
|
||||||
if (mustProvide("nomencl")) {
|
if (mustProvide("nomencl")) {
|
||||||
// Make it work with the new and old version of the package,
|
// Make it work with the new and old version of the package,
|
||||||
// but don't use the compatibility option since it is
|
// but don't use the compatibility option since it is
|
||||||
@ -815,7 +819,7 @@ string const LaTeXFeatures::getMacros() const
|
|||||||
if (mustProvide("ct-dvipost"))
|
if (mustProvide("ct-dvipost"))
|
||||||
macros << changetracking_dvipost_def;
|
macros << changetracking_dvipost_def;
|
||||||
|
|
||||||
if (mustProvide("ct-xcolor-soul")) {
|
if (mustProvide("ct-xcolor-ulem")) {
|
||||||
int const prec = macros.precision(2);
|
int const prec = macros.precision(2);
|
||||||
|
|
||||||
RGBColor cadd = rgbFromHexName(lcolor.getX11Name(Color_addedtext));
|
RGBColor cadd = rgbFromHexName(lcolor.getX11Name(Color_addedtext));
|
||||||
@ -829,9 +833,9 @@ string const LaTeXFeatures::getMacros() const
|
|||||||
macros.precision(prec);
|
macros.precision(prec);
|
||||||
|
|
||||||
if (isRequired("hyperref"))
|
if (isRequired("hyperref"))
|
||||||
macros << changetracking_xcolor_soul_hyperref_def;
|
macros << changetracking_xcolor_ulem_hyperref_def;
|
||||||
else
|
else
|
||||||
macros << changetracking_xcolor_soul_def;
|
macros << changetracking_xcolor_ulem_def;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mustProvide("ct-none"))
|
if (mustProvide("ct-none"))
|
||||||
|
Loading…
Reference in New Issue
Block a user