[LyX/master] Rest in peace, dvipost!

Juergen Spitzmueller spitz at lyx.org
Mon Jan 13 07:42:44 UTC 2020


commit a450797b2ab160f5953922d59298e6ff6472f8e4
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Jan 13 08:59:26 2020 +0100

    Rest in peace, dvipost!
---
 lib/chkconfig.ltx            |    1 -
 lib/configure.py             |    8 ++------
 lib/doc/LaTeXConfig.lyx      |   14 +++++++++++++-
 src/Buffer.cpp               |   22 ++++------------------
 src/BufferParams.cpp         |    6 +-----
 src/Changes.cpp              |    8 ++------
 src/LaTeXFeatures.cpp        |   33 +--------------------------------
 src/mathed/InsetMathHull.cpp |    3 +--
 src/mathed/InsetMathNest.cpp |    5 +----
 src/tex2lyx/text.cpp         |    5 +----
 10 files changed, 26 insertions(+), 79 deletions(-)

diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx
index b8f90f9..4d647c6 100644
--- a/lib/chkconfig.ltx
+++ b/lib/chkconfig.ltx
@@ -354,7 +354,6 @@
 \TestPackage{csquotes}
 \TestPackage{drs}
 \TestPackage[koi8-r.def]{cyrillic}
-\TestPackage{dvipost}
 \TestPackage{endnotes}
 \TestPackage{enotez}
 \TestPackage{enumitem}
diff --git a/lib/configure.py b/lib/configure.py
index 701a903..9b2fceb 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -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
diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx
index f98488f..6a0905a 100644
--- a/lib/doc/LaTeXConfig.lyx
+++ b/lib/doc/LaTeXConfig.lyx
@@ -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
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index ffdd9b8..eabb218 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -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."));
 			}
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index b1cedda..200d695 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -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");
diff --git a/src/Changes.cpp b/src/Changes.cpp
index 52e69da..a579144 100644
--- a/src/Changes.cpp
+++ b/src/Changes.cpp
@@ -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;
 		}
 	}
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index c1e2597..fd16b28 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -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);
 
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 75e0a41..2413af3 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -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");
 		}
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 66e900a..62c04f4 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -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) {
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 8c0d73e..0972599 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -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");
 				}


More information about the lyx-cvs mailing list