Rest in peace, dvipost!

This commit is contained in:
Juergen Spitzmueller 2020-01-13 08:59:26 +01:00
parent e340f46476
commit a450797b2a
10 changed files with 26 additions and 79 deletions

View File

@ -354,7 +354,6 @@
\TestPackage{csquotes}
\TestPackage{drs}
\TestPackage[koi8-r.def]{cyrillic}
\TestPackage{dvipost}
\TestPackage{endnotes}
\TestPackage{enotez}
\TestPackage{enumitem}

View File

@ -542,7 +542,6 @@ def checkInkscape():
def checkLatex(dtl_tools):
''' Check latex, return lyx_check_config '''
path, LATEX = checkProg('a Latex2e program', ['latex $$i', 'latex2e $$i'])
path, PPLATEX = checkProg('a DVI postprocessing program', ['pplatex $$i'])
#-----------------------------------------------------------------
path, PLATEX = checkProg('pLaTeX, the Japanese LaTeX', ['platex $$i'])
if PLATEX:
@ -556,15 +555,12 @@ def checkLatex(dtl_tools):
PLATEX = ''
removeFiles(['chklatex.ltx', 'chklatex.log'])
#-----------------------------------------------------------------
# use LATEX to convert from latex to dvi if PPLATEX is not available
if PPLATEX == '':
PPLATEX = LATEX
if dtl_tools:
# Windows only: DraftDVI
addToRC(r'''\converter latex dvi2 "%s" "latex,hyperref-driver=dvips"
\converter dvi2 dvi "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' % PPLATEX)
\converter dvi2 dvi "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' % LATEX)
else:
addToRC(r'\converter latex dvi "%s" "latex,hyperref-driver=dvips"' % PPLATEX)
addToRC(r'\converter latex dvi "%s" "latex,hyperref-driver=dvips"' % LATEX)
# no latex
if LATEX:
# Check if latex is usable

View File

@ -1,5 +1,5 @@
#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 588
\lyxformat 592
\begin_document
\begin_header
\save_transient_properties true
@ -74,6 +74,8 @@
\tablestyle default
\tracking_changes true
\output_changes false
\change_bars false
\postpone_fragile_content false
\html_math_output 0
\html_css_as_file 0
\html_be_strict true
@ -7904,10 +7906,14 @@ CJKutf8
\end_layout
\begin_layout Subsection
\change_deleted -712698321 1578757015
dvipost
\end_layout
\begin_layout Description
\change_deleted -712698321 1578757015
Found:
\begin_inset Info
type "package"
@ -7918,12 +7924,16 @@ arg "dvipost"
\end_layout
\begin_layout Description
\change_deleted -712698321 1578757015
URL:
\family typewriter
http://freshmeat.net/projects/dvipost/
\end_layout
\begin_layout Description
\change_deleted -712698321 1578757015
Notes:
\family sans
dvipost
@ -7940,6 +7950,8 @@ dvipost
\family default
needs te\SpecialChar TeX
version 2 or newer.
\change_unchanged
\end_layout
\begin_layout Subsection

View File

@ -1028,20 +1028,13 @@ bool Buffer::readDocument(Lexer & lex)
readHeader(lex);
if (params().output_changes) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
LaTeXFeatures::isAvailable("xcolor");
if (!dvipost && !xcolorulem) {
if (!xcolorulem) {
Alert::warning(_("Changes not shown in LaTeX output"),
_("Changes will not be highlighted in LaTeX output, "
"because neither dvipost nor xcolor/ulem are installed.\n"
"Please install these packages or redefine "
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
} 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 ulem are not installed.\n"
"because xcolor and ulem are not installed.\n"
"Please install both packages or redefine "
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
}
@ -3035,20 +3028,13 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
undo().recordUndoBufferParams(CursorData());
params().output_changes = !params().output_changes;
if (params().output_changes) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
LaTeXFeatures::isAvailable("xcolor");
if (!dvipost && !xcolorulem) {
if (!xcolorulem) {
Alert::warning(_("Changes not shown in LaTeX output"),
_("Changes will not be highlighted in LaTeX output, "
"because neither dvipost nor xcolor/ulem are installed.\n"
"Please install these packages or redefine "
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
} 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 ulem are not installed.\n"
"because xcolor and ulem are not installed.\n"
"Please install both packages or redefine "
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
}

View File

@ -1503,17 +1503,13 @@ void BufferParams::validate(LaTeXFeatures & features) const
features.require("rtloutputdblcol");
if (output_changes) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
LaTeXFeatures::isAvailable("xcolor");
switch (features.runparams().flavor) {
case OutputParams::LATEX:
case OutputParams::DVILUATEX:
if (dvipost) {
features.require("ct-dvipost");
features.require("dvipost");
} else if (xcolorulem) {
if (xcolorulem) {
features.require("ct-xcolor-ulem");
features.require("ulem");
features.require("xcolor");

View File

@ -429,10 +429,6 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
int column = 0;
bool const dvipost = LaTeXFeatures::isAvailable("dvipost") &&
(runparams.flavor == OutputParams::LATEX
|| runparams.flavor == OutputParams::DVILUATEX);
if (oldChange.type != Change::UNCHANGED) {
if (oldChange.type != Change::DELETED || runparams.ctObject != OutputParams::CT_OMITOBJECT) {
// close \lyxadded or \lyxdeleted
@ -440,7 +436,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
column++;
}
if (oldChange.type == Change::DELETED
&& !runparams.wasDisplayMath && !dvipost)
&& !runparams.wasDisplayMath)
--runparams.inulemcmd;
}
@ -461,7 +457,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
macro_beg = from_ascii("\\lyxudisplayobjdeleted");
else {
macro_beg = from_ascii("\\lyxdeleted");
if (!runparams.inDisplayMath && !dvipost)
if (!runparams.inDisplayMath)
++runparams.inulemcmd;
}
}

View File

@ -235,29 +235,6 @@ static docstring const lyxdot_def = from_ascii(
"%% A simple dot to overcome graphicx limitations\n"
"\\newcommand{\\lyxdot}{.}\n");
static docstring const changetracking_dvipost_def = from_ascii(
"%% Change tracking with dvipost\n"
"\\dvipostlayout\n"
"\\dvipost{osstart color push Red}\n"
"\\dvipost{osend color pop}\n"
"\\dvipost{cbstart color push Blue}\n"
"\\dvipost{cbrule 0pt}\n"
"\\dvipost{cbend color pop}\n"
"\\DeclareRobustCommand{\\lyxadded}[4][]{\\changestart#4\\changeend}\n"
"\\DeclareRobustCommand{\\lyxdeleted}[4][]{%\n"
"\\changestart\\overstrikeon#4\\overstrikeoff\\changeend}\n");
static docstring const changetracking_dvipost_cb_def = from_ascii(
"%% Change tracking with dvipost\n"
"\\dvipostlayout\n"
"\\dvipost{osstart color push Red}\n"
"\\dvipost{osend color pop}\n"
"\\dvipost{cbstart color push Blue}\n"
"\\dvipost{cbend color pop}\n"
"\\DeclareRobustCommand{\\lyxadded}[4][]{\\changestart#4\\changeend}\n"
"\\DeclareRobustCommand{\\lyxdeleted}[4][]{%\n"
"\\changestart\\overstrikeon#4\\overstrikeoff\\changeend}\n");
static docstring const changetracking_xcolor_ulem_base_def = from_ascii(
"%% Change tracking with ulem and xcolor: base macros\n"
"\\DeclareRobustCommand{\\mklyxadded}[1]{\\bgroup\\color{lyxadded}{}#1\\egroup}\n"
@ -1131,7 +1108,6 @@ char const * simplefeatures[] = {
"float",
"wrapfig",
"booktabs",
"dvipost",
"fancybox",
"calc",
"units",
@ -1306,7 +1282,7 @@ string const LaTeXFeatures::getPackages() const
// The rest of these packages are somewhat more complicated
// than those above.
if (mustProvide("changebar") && !mustProvide("ct-dvipost")) {
if (mustProvide("changebar")) {
packages << "\\usepackage";
if (runparams_.flavor == OutputParams::LATEX
|| runparams_.flavor == OutputParams::DVILUATEX)
@ -1753,13 +1729,6 @@ TexString LaTeXFeatures::getMacros() const
macros << lyxref_def << '\n';
// change tracking
if (mustProvide("ct-dvipost")) {
if (isRequired("changebar"))
macros << changetracking_dvipost_cb_def;
else
macros << changetracking_dvipost_def;
}
if (mustProvide("ct-xcolor-ulem")) {
streamsize const prec = macros.os().precision(2);

View File

@ -1101,8 +1101,7 @@ void InsetMathHull::validate(LaTeXFeatures & features) const
+ bgcol + "}{\\ensuremath{\\mathtt{#1}}}}");
features.addPreambleSnippet(
from_ascii("\\newcommand{\\endregexp}{}"));
} else if (outerDisplay() && features.inDeletedInset()
&& !features.mustProvide("ct-dvipost")) {
} else if (outerDisplay() && features.inDeletedInset()) {
features.require("tikz");
features.require("ct-tikz-object-sout");
}

View File

@ -357,10 +357,7 @@ void InsetMathNest::latex(otexstream & os, OutputParams const & runparams) const
WriteStream wi(os, runparams.moving_arg, true,
runparams.dryrun ? WriteStream::wsDryrun : WriteStream::wsDefault,
runparams.encoding);
wi.strikeoutMath(runparams.inDeletedInset
&& (!LaTeXFeatures::isAvailable("dvipost")
|| (runparams.flavor != OutputParams::LATEX
&& runparams.flavor != OutputParams::DVILUATEX)));
wi.strikeoutMath(runparams.inDeletedInset);
if (runparams.inulemcmd) {
wi.ulemCmd(WriteStream::UNDERLINE);
if (runparams.local_font) {

View File

@ -4076,7 +4076,6 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
os << "\n\\change_deleted ";
os << author.bufferId() << ' ' << ptime << '\n';
parse_text_snippet(p, os, FLAG_ITEM, outer, context);
bool dvipost = LaTeXPackages::isAvailable("dvipost");
bool xcolorulem = LaTeXPackages::isAvailable("ulem") &&
LaTeXPackages::isAvailable("xcolor");
// No need to test for luatex, since luatex comes in
@ -4089,9 +4088,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
preamble.registerAutomaticallyLoadedPackage("pdfcolmk");
}
} else {
if (dvipost) {
preamble.registerAutomaticallyLoadedPackage("dvipost");
} else if (xcolorulem) {
if (xcolorulem) {
preamble.registerAutomaticallyLoadedPackage("ulem");
preamble.registerAutomaticallyLoadedPackage("xcolor");
}