All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Regression fixes & improvements in build scripts/preamble
@ 2019-02-23 23:59 Akira Yokosawa
  2019-02-24  0:00 ` [PATCH 1/8] defer/rcuapi: Force break between two API in Table 9.3 Akira Yokosawa
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-23 23:59 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

Hi Paul,

This patch series consists of regression fixes of commit ff9ddf1a7a8f
("defer/rcuapi: Tweak Table 9.3 with nimbusmononarrow font") and
improvements in build scripts and the preamble.

Patches #1 and #2 are regression fixes.

Patch #3 adds LaTeX font-package availability check to the experimental
targets. "make" used to print info on necessary font packages but
always ran pdflatex, which could end up in error.  Now "make" aborts
with a message telling where to look.

Patches #4 and #5 take care of warnings from pdfTeX.
Patch #4 resolves mismatch of PDF minor version. The warning is caused
by the change in Ghostscript 9.26 to make PDF 1.7 the default.
Now pdflatex also uses PDF 1.7 for its output.

Patch #5 is to suppress warning from pdfTeX indicating possible
incompatible page group objects within a page. Page group objects are
generated by Inkscape in ".svg -> .pdf" transformation.  As of now,
there is no .svg file with a different page group object. I've not
figured out the way to generate such a page group object by Inkscape.
Note that this change does not affect TeX Live 2013/Debian.

Before these changes,
    grep -i "pdftex warning" -c perfbook.log
returns 128 (can vary depending on page layout).

After these patches are applied, it returns 0 (on TeX Live 2014 or
later).

Patch #6 adds a recipe to detect conflicting page group object. You
need to set an environment variable to enable the recipe.

Patch #7 tweaks target "clean" to keep .fcv and .ltms files.

Patch #8 increases tabsize of fancyvrb snippets for 1c layout.
"tabsize=8" should be easier to read for kernel developers.

You might notice slowdown of "make" due to patch #3. Hopefully, it
wouldn't be irritating for you.

        Thanks, Akira
--
Akira Yokosawa (8):
  defer/rcuapi: Force break between two API in Table 9.3
  Makefile: Fix recipe of target 'perfbook-msn.pdf'
  Makefile: Add check of font package availability
  Specify PDF minor version 1.7
  Suppress warning from pdfTeX on figures transformed by Inkscape
  Makefile: Add optional recipe to detect conflict in page group object
  Makefile: Don't remove .fcv and .ltms files in target 'clean'
  Widen tabsize of code snippets for 1c layout

 .gitignore                |  2 ++
 Makefile                  | 64 ++++++++++++++++++++++++++++++++++++++++-------
 defer/rcuapi.tex          |  4 +--
 pagegroup                 |  6 +++++
 perfbook.tex              | 19 +++++++++++---
 utilities/extpagegroup.pl | 37 +++++++++++++++++++++++++++
 6 files changed, 118 insertions(+), 14 deletions(-)
 create mode 100644 pagegroup
 create mode 100755 utilities/extpagegroup.pl

-- 
2.7.4


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/8] defer/rcuapi: Force break between two API in Table 9.3
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
@ 2019-02-24  0:00 ` Akira Yokosawa
  2019-02-24  0:01 ` [PATCH 2/8] Makefile: Fix recipe of target 'perfbook-msn.pdf' Akira Yokosawa
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-24  0:00 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 815908256598842f8d62259a0bd1398495fd859b Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 22 Feb 2019 20:30:43 +0900
Subject: [PATCH 1/8] defer/rcuapi: Force break between two API in Table 9.3

The column width specified in commit ff9ddf1a7a8f ("defer/rcuapi:
Tweak Table 9.3 with nimbusmononarrow font") allows both APIs
in this cell to appear without a break between them.
Force the break by specifying a narrower column width for the
cell.

Fixes: ff9ddf1a7a8f ("defer/rcuapi: Tweak Table 9.3 with nimbusmononarrow font")
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 defer/rcuapi.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/defer/rcuapi.tex b/defer/rcuapi.tex
index 644a937..93b9767 100644
--- a/defer/rcuapi.tex
+++ b/defer/rcuapi.tex
@@ -824,8 +824,8 @@ Section~\ref{sec:defer:Maintain Multiple Versions of Recently Updated Objects}.
 	    \tco{hlist_bl_set_first_rcu()} \\
 \multicolumn{4}{l}{{\bf Delete}} \\
 \tco{list_del_rcu()} &
-    \tco{hlist_del_rcu()}
-    \tco{hlist_del_init_rcu()} &
+    \multicolumn{1}{p{1.2in}}{\tco{hlist_del_rcu()}
+			      \tco{hlist_del_init_rcu()}} &
 	\tco{hlist_nulls_del_rcu()}
 	\tco{hlist_nulls_del_init_rcu()} &
 	    \tco{hlist_bl_del_rcu()}
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/8] Makefile: Fix recipe of target 'perfbook-msn.pdf'
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
  2019-02-24  0:00 ` [PATCH 1/8] defer/rcuapi: Force break between two API in Table 9.3 Akira Yokosawa
@ 2019-02-24  0:01 ` Akira Yokosawa
  2019-02-24  0:05 ` [PATCH 3/8] Makefile: Add check of font package availability Akira Yokosawa
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-24  0:01 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 2a6f16a97317ef5fc9f21edfa7351cef1d950e6d Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 22 Feb 2019 20:39:24 +0900
Subject: [PATCH 2/8] Makefile: Fix recipe of target 'perfbook-msn.pdf'

Commit ff9ddf1a7a8f ("defer/rcuapi: Tweak Table 9.3 with
nimbusmononarrow font") botched target 'perfbook-msn.pdf'
and "lmtt" became the default monospace font.
This is because the second "\usepackage{nimbusmononarrow}
in the preamble does nothing.

This can be fixed by removing "\renewcommand*\ttdefault{lmtt}"
instead of adding the redundant "\usepackage{nimbusmononarrow}".

Fixes: ff9ddf1a7a8f ("defer/rcuapi: Tweak Table 9.3 with nimbusmononarrow font")
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4547256..89abea2 100644
--- a/Makefile
+++ b/Makefile
@@ -173,7 +173,7 @@ perfbook-msr.tex: perfbook.tex
 	@echo "## This target requires font package nimbus15. ##"
 
 perfbook-msn.tex: perfbook.tex
-	sed -e 's/%msfontstub/\\usepackage{nimbusmononarrow}/' \
+	sed -e 's/\\renewcommand\*\\ttdefault{lmtt}//' \
 	    -e 's/{lmttforcode}{true}/{lmttforcode}{false}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' < $< > $@
 	@echo "## This target requires font package nimbus15. ##"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/8] Makefile: Add check of font package availability
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
  2019-02-24  0:00 ` [PATCH 1/8] defer/rcuapi: Force break between two API in Table 9.3 Akira Yokosawa
  2019-02-24  0:01 ` [PATCH 2/8] Makefile: Fix recipe of target 'perfbook-msn.pdf' Akira Yokosawa
@ 2019-02-24  0:05 ` Akira Yokosawa
  2019-02-24  0:09 ` [PATCH 4/8] Specify PDF minor version 1.7 Akira Yokosawa
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-24  0:05 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 81b62c1185e0e9439bf201bca5921742f786efca Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 22 Feb 2019 20:59:22 +0900
Subject: [PATCH 3/8] Makefile: Add check of font package availability

Add existence check of relatively recent font packages required for
experimental targets.

Those targets used to just print info on required font, and to run
"pdflatex".  Now "make" aborts with a message indicating where to
see if any of required font packages is missing.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile | 42 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 89abea2..338669a 100644
--- a/Makefile
+++ b/Makefile
@@ -58,14 +58,30 @@ PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG),$(PDFTARGETS_OF_
 
 BIBSOURCES := bib/*.bib alphapf.bst
 
+# required commands
 DOT := $(shell which dot 2>/dev/null)
 FIG2EPS := $(shell which fig2eps 2>/dev/null)
 A2PING := $(shell which a2ping 2>/dev/null)
 INKSCAPE := $(shell which inkscape 2>/dev/null)
 LATEXPAND := $(shell which latexpand 2>/dev/null)
+
+# required fonts
 STEELFONT := $(shell fc-list | grep -c -i steel)
 URWPS := $(shell fc-list | grep "Nimbus Mono PS" | wc -l)
 
+# required font packages
+FONTPACKAGES := $(shell kpsewhich nimbusmono.sty newtxtt.sty newtxsf.sty inconsolata.sty)
+NIMBUSMONO := $(findstring nimbusmono,$(FONTPACKAGES))
+NEWTXTT := $(findstring newtxtt,$(FONTPACKAGES))
+NEWTXSF := $(findstring newtxsf,$(FONTPACKAGES))
+INCONSOLATA := $(findstring inconsolata,$(FONTPACKAGES))
+
+# for line break in error text
+define n
+
+
+endef
+
 ifeq ($(URWPS),0)
 FIXSVGFONTS   = utilities/fixsvgfonts.sh
 FIXANEPSFONTS = utilities/fixanepsfonts.sh
@@ -168,27 +184,43 @@ perfbook-mstx.tex: perfbook.tex
 	sed -e 's/%msfontstub/\\renewcommand*\\ttdefault{txtt}/' < $< > $@
 
 perfbook-msr.tex: perfbook.tex
+ifeq ($(NIMBUSMONO),)
+	$(error Font package 'nimbus15' not found. See #9 in FAQ-BUILD.txt)
+endif
 	sed -e 's/%msfontstub/\\usepackage[scaled=.94]{nimbusmono}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' < $< > $@
-	@echo "## This target requires font package nimbus15. ##"
 
 perfbook-msn.tex: perfbook.tex
+ifeq ($(NIMBUSMONO),)
+	$(error Font package 'nimbus15' not found. See #9 in FAQ-BUILD.txt)
+endif
 	sed -e 's/\\renewcommand\*\\ttdefault{lmtt}//' \
 	    -e 's/{lmttforcode}{true}/{lmttforcode}{false}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' < $< > $@
-	@echo "## This target requires font package nimbus15. ##"
 
 perfbook-msnt.tex: perfbook.tex
+ifeq ($(NEWTXTT),)
+	$(error Font package 'newtxtt' not found.$nInstall it or try 'make mstx' instead. See #9 in FAQ-BUILD.txt)
+endif
+ifeq ($(NIMBUSMONO),)
+	$(error Font package 'nimbus15' not found. See #9 in FAQ-BUILD.txt)
+endif
 	sed -e 's/%msfontstub/\\usepackage[zerostyle=a]{newtxtt}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' < $< > $@
-	@echo "## This target requires font packages newtxtt and nimbus15. ##"
-	@echo "## If build fails, try target 'mstx' instead.               ##"
 
 perfbook-1csf.tex: perfbook-1c.tex
+ifeq ($(NEWTXSF),)
+	$(error Font package 'newtxsf' not found. See #9 in FAQ-BUILD.txt)
+endif
+ifeq ($(INCONSOLATA),)
+	$(error Font package 'inconsolata' not found. See #9 in FAQ-BUILD.txt)
+endif
+ifeq ($(NIMBUSMONO),)
+	$(error Font package 'nimbus15' not found. See #9 in FAQ-BUILD.txt)
+endif
 	sed -e 's/setboolean{sansserif}{false}/setboolean{sansserif}{true}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' \
 	    -e 's/%msfontstub/\\usepackage[var0]{inconsolata}[2013\/07\/17]/' < $< > $@
-	@echo "## This target requires math font packages newtxsf and nimbus15. ##"
 
 # Rules related to perfbook_html are removed as of May, 2016
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/8] Specify PDF minor version 1.7
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
                   ` (2 preceding siblings ...)
  2019-02-24  0:05 ` [PATCH 3/8] Makefile: Add check of font package availability Akira Yokosawa
@ 2019-02-24  0:09 ` Akira Yokosawa
  2019-02-24  0:11 ` [PATCH 5/8] Suppress warning from pdfTeX on figures transformed by Inkscape Akira Yokosawa
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-24  0:09 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From f6814ac4124a9a383ca8ca7f683d46f1365ace58 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 23 Feb 2019 18:25:33 +0900
Subject: [PATCH 4/8] Specify PDF minor version 1.7

Ghostscript 9.26 changed the default PDF output to 1.7 [1].
This causes a lot of warning messages in perfbook.log, saying:

    pdfTeX warning: pdflatex (file ./cartoons/1kHz.pdf): PDF inclusion:
    found PDF version <1.7>, but at most version <1.5> allowed
    <cartoons/1kHz.pdf, id=11175, 319.79472pt x 287.27324pt>
    File: cartoons/1kHz.pdf Graphic file (type pdf)

This warning can be suppressed by setting "\pdfminorversion=7"
in the preamble.

[1]: https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=bb2ea8ca0482

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 perfbook.tex | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/perfbook.tex b/perfbook.tex
index f79e7b0..a1e90dd 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -2,6 +2,9 @@
 % For arxiv.org, must be on or before line 5:
 \pdfoutput=1
 
+% To accomodate change in Ghostscript 9.26 (default output: PDF 1.7)
+\pdfminorversion=7
+
 % standard packages
 
 % A more pleasant font
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/8] Suppress warning from pdfTeX on figures transformed by Inkscape
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
                   ` (3 preceding siblings ...)
  2019-02-24  0:09 ` [PATCH 4/8] Specify PDF minor version 1.7 Akira Yokosawa
@ 2019-02-24  0:11 ` Akira Yokosawa
  2019-02-24  0:14 ` [PATCH 6/8] Makefile: Add optional recipe to detect conflict in page group object Akira Yokosawa
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-24  0:11 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 8ec8fb2ce4a178e086b816de09f81618ae87770d Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 23 Feb 2019 19:23:56 +0900
Subject: [PATCH 5/8] Suppress warning from pdfTeX on figures transformed by Inkscape

This change suppresses warnings such as:

    <./cartoons/r-2014-branch-error.pdf

    pdfTeX warning: pdflatex (file ./cartoons/r-2014-branch-error.pdf):
    PDF inclusion: multiple pdfs with page group included in a single page>

This is a known issue of pdfTeX [1].
The message is emitted when multiple PDF files generated by
Inkscape appear in a single page. This issue has not caused
any problem in perfbook so far.

The variable \pdfsuppresswarningpagegroup is available since
pdfTeX 1.40.15 (TeX Live 2014). So this change doesn't affect
TeX Live 2013/Debian on Ubuntu Trusty.

[1]: https://tex.stackexchange.com/questions/183149/

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 perfbook.tex | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/perfbook.tex b/perfbook.tex
index a1e90dd..bbf8455 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -5,6 +5,10 @@
 % To accomodate change in Ghostscript 9.26 (default output: PDF 1.7)
 \pdfminorversion=7
 
+% Suppress warning emitted when multiple figures drawn by inkscape appear
+% within a page. See: https://tex.stackexchange.com/questions/183149/
+\ifdefined\pdfsuppresswarningpagegroup \pdfsuppresswarningpagegroup=1 \fi
+
 % standard packages
 
 % A more pleasant font
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/8] Makefile: Add optional recipe to detect conflict in page group object
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
                   ` (4 preceding siblings ...)
  2019-02-24  0:11 ` [PATCH 5/8] Suppress warning from pdfTeX on figures transformed by Inkscape Akira Yokosawa
@ 2019-02-24  0:14 ` Akira Yokosawa
  2019-02-24  0:16 ` [PATCH 7/8] Makefile: Don't remove .fcv and .ltms files in target 'clean' Akira Yokosawa
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-24  0:14 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 91e7ad2b3e5dfae239d3f4e64d92b7c21ba9ed75 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 23 Feb 2019 19:26:57 +0900
Subject: [PATCH 6/8] Makefile: Add optional recipe to detect conflict in page group object

As long as "page group objects" are identical, setting
\pdfsuppresswarningpagegroup variable done in the previous commit
is safe.

This commit adds an optional recipe in ".svn -> .pdf"
transformation to extract page group object from the generated .pdf
file, and to compare it with the expected one given in "pagegroup".

The added recipe is enabled only when an environment variable
"PERFBOOK_CHKPAGEGROUP" is set "on". The check requires a command
named "qpdf", which is available on most Linux distributions.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 .gitignore                |  2 ++
 Makefile                  | 16 +++++++++++++++-
 pagegroup                 |  6 ++++++
 utilities/extpagegroup.pl | 37 +++++++++++++++++++++++++++++++++++++
 4 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 pagegroup
 create mode 100755 utilities/extpagegroup.pl

diff --git a/.gitignore b/.gitignore
index 34bbb85..ebd5e98 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,8 @@
 *.svgi
 *.fcv
 *.ltms
+*.pdfp
+*.pdfq
 perfbook_flat.tex
 qqz.tex
 contrib.tex
diff --git a/Makefile b/Makefile
index 338669a..648091a 100644
--- a/Makefile
+++ b/Makefile
@@ -64,6 +64,7 @@ FIG2EPS := $(shell which fig2eps 2>/dev/null)
 A2PING := $(shell which a2ping 2>/dev/null)
 INKSCAPE := $(shell which inkscape 2>/dev/null)
 LATEXPAND := $(shell which latexpand 2>/dev/null)
+QPDF := $(shell which qpdf 2>/dev/null)
 
 # required fonts
 STEELFONT := $(shell fc-list | grep -c -i steel)
@@ -115,6 +116,8 @@ else
 	targ = $(default)
 endif
 
+chkpagegroup = $(PERFBOOK_CHKPAGEGROUP)
+
 .PHONY: all touchsvg clean distclean neatfreak 2c ls-unused $(ABBREVTARGETS) mslm perfbook-mslm.pdf mslmmsg help
 all: $(targ)
 
@@ -285,6 +288,16 @@ else
 endif
 	@inkscape --export-pdf=$@ $<i > /dev/null 2>&1
 	@rm -f $<i
+ifeq ($(chkpagegroup),on)
+ifndef QPDF
+	$(error qpdf not found. Please install it)
+endif
+	@echo "checking page group in $@"
+	@qpdf --qdf $@ $@q
+	@./utilities/extpagegroup.pl < $@q > $@p
+	@diff -q -w $@p pagegroup
+	@rm -f $@q $@p
+endif
 
 CodeSamples/snippets.d: $(SOURCES_OF_SNIPPET) $(GEN_SNIPPET_D)
 	sh ./utilities/gen_snippet_d.sh
@@ -333,7 +346,8 @@ clean:
 	find . -name '*.aux' -o -name '*.blg' \
 		-o -name '*.dvi' -o -name '*.log' \
 		-o -name '*.qqz' -o -name '*.toc' -o -name '*.bbl' \
-		-o -name '*.fcv' -o -name '*.ltms' | xargs rm -f
+		-o -name '*.fcv' -o -name '*.ltms' \
+		-o -name '*.pdfp' -o -name '*.pdfq' | xargs rm -f
 	rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex
 	rm -f $(LATEXGENERATED)
 	rm -f CodeSamples/snippets.mk CodeSamples/snippets.d
diff --git a/pagegroup b/pagegroup
new file mode 100644
index 0000000..4cc4650
--- /dev/null
+++ b/pagegroup
@@ -0,0 +1,6 @@
+  /Group <<
+    /CS /DeviceRGB
+    /I true
+    /S /Transparency
+    /Type /Group
+  >>
diff --git a/utilities/extpagegroup.pl b/utilities/extpagegroup.pl
new file mode 100755
index 0000000..67c206d
--- /dev/null
+++ b/utilities/extpagegroup.pl
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Extract "page group object" in PDF generated by Inkscape
+#
+# Copyright (C) Akira Yokosawa, 2019
+#
+# Authors: Akira Yokosawa <akiyks@gmail.com>
+
+use strict;
+use warnings;
+
+my $line;
+my $in_pagegroup = 0;
+
+while($line = <>) {
+    if ($in_pagegroup == 3) {
+	$in_pagegroup = 0;
+	print $line;
+    }
+    if ($in_pagegroup == 2) {
+	if ($line =~ /\/Group/) {
+	    $in_pagegroup = 3;
+	}
+	print $line;
+    }
+    if ($in_pagegroup == 1) {
+	if ($line =~ /\/Group/) {
+	    $in_pagegroup = 2;
+	    print $line;
+	}
+    }
+    if ($in_pagegroup == 0 && $line =~ /\/Contents/) {
+	$in_pagegroup = 1;
+    }
+    if (eof) { last; }
+}
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/8] Makefile: Don't remove .fcv and .ltms files in target 'clean'
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
                   ` (5 preceding siblings ...)
  2019-02-24  0:14 ` [PATCH 6/8] Makefile: Add optional recipe to detect conflict in page group object Akira Yokosawa
@ 2019-02-24  0:16 ` Akira Yokosawa
  2019-02-24  0:17 ` [PATCH 8/8] Widen tabsize of code snippets for 1c layout Akira Yokosawa
  2019-02-25 16:56 ` [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Paul E. McKenney
  8 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-24  0:16 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From e0bedfe0587f182db5401fe7c244e4b8487aaab9 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 23 Feb 2019 19:40:38 +0900
Subject: [PATCH 7/8] Makefile: Don't remove .fcv and .ltms files in target 'clean'

In the case of a build error due to out-of-date CodeSamples/snippets.d,
Removing the outdated file suffices. .fcv and .ltms files need not
be removed.  Defer their removal to the target 'distclean'.

While we are here, add CodeSamples/snippets.mk to OBSOLETE_FILES.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 648091a..c07dde0 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,7 @@ SVGSOURCES := $(wildcard */*.svg)
 FAKE_EPS_FROM_SVG := $(SVGSOURCES:%.svg=%.eps)
 PDFTARGETS_OF_SVG := $(SVGSOURCES:%.svg=%.pdf)
 
-OBSOLETE_FILES = extraction $(FAKE_EPS_FROM_SVG)
+OBSOLETE_FILES = extraction $(FAKE_EPS_FROM_SVG) CodeSamples/snippets.mk
 
 EPSSOURCES_DUP := \
 	$(wildcard */*.eps) \
@@ -346,16 +346,16 @@ clean:
 	find . -name '*.aux' -o -name '*.blg' \
 		-o -name '*.dvi' -o -name '*.log' \
 		-o -name '*.qqz' -o -name '*.toc' -o -name '*.bbl' \
-		-o -name '*.fcv' -o -name '*.ltms' \
 		-o -name '*.pdfp' -o -name '*.pdfq' | xargs rm -f
 	rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex
 	rm -f $(LATEXGENERATED)
-	rm -f CodeSamples/snippets.mk CodeSamples/snippets.d
+	rm -f CodeSamples/snippets.d
 	@rm -f $(OBSOLETE_FILES)
 
 distclean: clean
 	sh utilities/cleanpdf.sh
 	rm -f $(EPSSOURCES_FROM_DOT) $(EPSSOURCES_FROM_TEX) $(EPSSOURCES_FROM_FIG)
+	find . -name '*.fcv' -o -name '*.ltms' | xargs rm -f
 
 touchsvg:
 	find . -name '*.svg' | xargs touch
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/8] Widen tabsize of code snippets for 1c layout
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
                   ` (6 preceding siblings ...)
  2019-02-24  0:16 ` [PATCH 7/8] Makefile: Don't remove .fcv and .ltms files in target 'clean' Akira Yokosawa
@ 2019-02-24  0:17 ` Akira Yokosawa
  2019-02-25 16:56 ` [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Paul E. McKenney
  8 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2019-02-24  0:17 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 409e0528f63f20877a3fc6a8b4280acd879dd056 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 23 Feb 2019 19:41:35 +0900
Subject: [PATCH 8/8] Widen tabsize of code snippets for 1c layout

Most readers are supposed to be used to tabsize=8.
Use it for 1c layout.

While we are here, use \fvset{} to set common default parameters.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 perfbook.tex | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/perfbook.tex b/perfbook.tex
index bbf8455..ac37477 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -129,13 +129,19 @@
 \usepackage{arydshln}
 \definecolor{lightgray}{gray}{0.9} % for coloring alternate rows in table
 
+\fvset{fontsize=\scriptsize,obeytabs=true}
+\IfTwoColumn{
+\fvset{tabsize=2}
+}{
+\fvset{tabsize=8}
+}
 \DefineVerbatimEnvironment{VerbatimL}{Verbatim}%
-{fontsize=\scriptsize,numbers=left,numbersep=5pt,xleftmargin=9pt,obeytabs=true,tabsize=2}
+{numbers=left,numbersep=5pt,xleftmargin=9pt}
 \AfterEndEnvironment{VerbatimL}{\vspace*{-9pt}}
 \DefineVerbatimEnvironment{VerbatimN}{Verbatim}%
-{fontsize=\scriptsize,numbers=left,numbersep=3pt,xleftmargin=5pt,xrightmargin=5pt,obeytabs=true,tabsize=2,frame=single}
+{numbers=left,numbersep=3pt,xleftmargin=5pt,xrightmargin=5pt,frame=single}
 \DefineVerbatimEnvironment{VerbatimU}{Verbatim}%
-{fontsize=\scriptsize,numbers=none,xleftmargin=5pt,xrightmargin=5pt,obeytabs=true,tabsize=2,samepage=true,frame=single}
+{numbers=none,xleftmargin=5pt,xrightmargin=5pt,samepage=true,frame=single}
 
 \IfLmttForCode{
 \AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{lmtt}}
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/8] Regression fixes & improvements in build scripts/preamble
  2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
                   ` (7 preceding siblings ...)
  2019-02-24  0:17 ` [PATCH 8/8] Widen tabsize of code snippets for 1c layout Akira Yokosawa
@ 2019-02-25 16:56 ` Paul E. McKenney
  8 siblings, 0 replies; 10+ messages in thread
From: Paul E. McKenney @ 2019-02-25 16:56 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Sun, Feb 24, 2019 at 08:59:07AM +0900, Akira Yokosawa wrote:
> Hi Paul,
> 
> This patch series consists of regression fixes of commit ff9ddf1a7a8f
> ("defer/rcuapi: Tweak Table 9.3 with nimbusmononarrow font") and
> improvements in build scripts and the preamble.
> 
> Patches #1 and #2 are regression fixes.
> 
> Patch #3 adds LaTeX font-package availability check to the experimental
> targets. "make" used to print info on necessary font packages but
> always ran pdflatex, which could end up in error.  Now "make" aborts
> with a message telling where to look.
> 
> Patches #4 and #5 take care of warnings from pdfTeX.
> Patch #4 resolves mismatch of PDF minor version. The warning is caused
> by the change in Ghostscript 9.26 to make PDF 1.7 the default.
> Now pdflatex also uses PDF 1.7 for its output.
> 
> Patch #5 is to suppress warning from pdfTeX indicating possible
> incompatible page group objects within a page. Page group objects are
> generated by Inkscape in ".svg -> .pdf" transformation.  As of now,
> there is no .svg file with a different page group object. I've not
> figured out the way to generate such a page group object by Inkscape.
> Note that this change does not affect TeX Live 2013/Debian.
> 
> Before these changes,
>     grep -i "pdftex warning" -c perfbook.log
> returns 128 (can vary depending on page layout).
> 
> After these patches are applied, it returns 0 (on TeX Live 2014 or
> later).
> 
> Patch #6 adds a recipe to detect conflicting page group object. You
> need to set an environment variable to enable the recipe.
> 
> Patch #7 tweaks target "clean" to keep .fcv and .ltms files.
> 
> Patch #8 increases tabsize of fancyvrb snippets for 1c layout.
> "tabsize=8" should be easier to read for kernel developers.
> 
> You might notice slowdown of "make" due to patch #3. Hopefully, it
> wouldn't be irritating for you.

So far, so good.  ;-)

Applied and pushed, thank you!

							Thanx, Paul

>         Thanks, Akira
> --
> Akira Yokosawa (8):
>   defer/rcuapi: Force break between two API in Table 9.3
>   Makefile: Fix recipe of target 'perfbook-msn.pdf'
>   Makefile: Add check of font package availability
>   Specify PDF minor version 1.7
>   Suppress warning from pdfTeX on figures transformed by Inkscape
>   Makefile: Add optional recipe to detect conflict in page group object
>   Makefile: Don't remove .fcv and .ltms files in target 'clean'
>   Widen tabsize of code snippets for 1c layout
> 
>  .gitignore                |  2 ++
>  Makefile                  | 64 ++++++++++++++++++++++++++++++++++++++++-------
>  defer/rcuapi.tex          |  4 +--
>  pagegroup                 |  6 +++++
>  perfbook.tex              | 19 +++++++++++---
>  utilities/extpagegroup.pl | 37 +++++++++++++++++++++++++++
>  6 files changed, 118 insertions(+), 14 deletions(-)
>  create mode 100644 pagegroup
>  create mode 100755 utilities/extpagegroup.pl
> 
> -- 
> 2.7.4
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-25 16:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
2019-02-24  0:00 ` [PATCH 1/8] defer/rcuapi: Force break between two API in Table 9.3 Akira Yokosawa
2019-02-24  0:01 ` [PATCH 2/8] Makefile: Fix recipe of target 'perfbook-msn.pdf' Akira Yokosawa
2019-02-24  0:05 ` [PATCH 3/8] Makefile: Add check of font package availability Akira Yokosawa
2019-02-24  0:09 ` [PATCH 4/8] Specify PDF minor version 1.7 Akira Yokosawa
2019-02-24  0:11 ` [PATCH 5/8] Suppress warning from pdfTeX on figures transformed by Inkscape Akira Yokosawa
2019-02-24  0:14 ` [PATCH 6/8] Makefile: Add optional recipe to detect conflict in page group object Akira Yokosawa
2019-02-24  0:16 ` [PATCH 7/8] Makefile: Don't remove .fcv and .ltms files in target 'clean' Akira Yokosawa
2019-02-24  0:17 ` [PATCH 8/8] Widen tabsize of code snippets for 1c layout Akira Yokosawa
2019-02-25 16:56 ` [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.