[latex3-commits] [git/LaTeX3-latex3-latex3] master: Add advice for PDF compression in DVI mode (bba57ded1)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Mar 16 10:33:03 CET 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/bba57ded19106db22327e6a53d0cf03a3802bde4

>---------------------------------------------------------------

commit bba57ded19106db22327e6a53d0cf03a3802bde4
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Mar 16 09:33:03 2020 +0000

    Add advice for PDF compression in DVI mode


>---------------------------------------------------------------

bba57ded19106db22327e6a53d0cf03a3802bde4
 l3backend/CHANGELOG.md      |  3 +++
 l3backend/l3backend-pdf.dtx | 20 +++++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/l3backend/CHANGELOG.md b/l3backend/CHANGELOG.md
index 920e730ce..ad4dd871a 100644
--- a/l3backend/CHANGELOG.md
+++ b/l3backend/CHANGELOG.md
@@ -6,6 +6,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Add advice for PDF compression in DVI mode
+
 ## [2020-03-12]
 
 ### Fixed
diff --git a/l3backend/l3backend-pdf.dtx b/l3backend/l3backend-pdf.dtx
index 14496bbc8..339720bfd 100644
--- a/l3backend/l3backend-pdf.dtx
+++ b/l3backend/l3backend-pdf.dtx
@@ -666,10 +666,24 @@
 %
 % \begin{macro}{\@@_backend_compresslevel:n}
 % \begin{macro}{\@@_backend_compress_objects:n}
-%   These are all no-ops.
+%   These are all no-ops, but can give helpful advice. We make sure we
+%   only give that the once.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_compresslevel:n #1 { }
-\cs_new_protected:Npn \@@_backend_compress_objects:n #1 { }
+\cs_new_protected:Npn \@@_backend_compresslevel:n #1
+  {
+    \__kernel_msg_info:nn { backend } { cannot-set-compression }
+    \cs_gset_protected:Npn \@@_backend_compresslevel:n ##1 { }
+    \cs_gset_protected:Npn \@@_backend_compress_objects:n ##1 { }
+  }
+\cs_new_eq:NN \@@_backend_compress_objects:n
+  \@@_backend_compresslevel:n
+\__kernel_msg_new:nnn { backend } { cannot-set-compression }
+  {
+    LaTeX~cannot~set~PDF~compression~in~DVI~mode.\\ \\
+    If~you~are~using~"ps2pdf",~add \\ \\
+    \iow_indent:n { -dCompressStreams=false~-dCompressPages=false } \\ \\
+    to~your~command~line~call.
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}





More information about the latex3-commits mailing list.