All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH 3/3] utilities/autodate: Put commit-id in footer by 'draftwatermark'
Date: Sun, 29 Dec 2019 19:26:28 +0900	[thread overview]
Message-ID: <6c028454-d84f-d32c-35ad-16c8df966482@gmail.com> (raw)
In-Reply-To: <861d7415-b129-5d98-b28c-1988bc2359a4@gmail.com>

From 8575d3513dc813b9ede20a8aa4629826b8028343 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sun, 29 Dec 2019 17:51:53 +0900
Subject: [PATCH 3/3] utilities/autodate: Put commit-id in footer by 'draftwatermark'

A similar footer should be able to be typeset on every page by
a LaTeX package "fancyhdr", but I have not figured out a way to do
so reliably on Chapter pages.

A Release/Edition will have the release/edition tag name instead.

Also update FAQ-BUILD.txt to mention the possible version mismatch
of draftwatermark.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 FAQ-BUILD.txt         | 6 ++++--
 perfbook.tex          | 8 ++++++++
 utilities/autodate.sh | 6 ++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/FAQ-BUILD.txt b/FAQ-BUILD.txt
index 4fb85e7a..f5066798 100644
--- a/FAQ-BUILD.txt
+++ b/FAQ-BUILD.txt
@@ -178,10 +178,11 @@
 			tlmgr install newtx
 
 10.	Building perfbook fails with a warning of buggy cleveref/listings
-	or version mismatch of titlesec. What can I do?
+	or version mismatch of titlesec/draftwatermark. What can I do?
 
 	A.	They are known issues on Ubuntu Xenial (titlesec),
-		Ubuntu Bionic (cleveref), and TeX Live 2014/2015 (listings).
+		Ubuntu Bionic (cleveref), TeX Live 2014/2015 (listings),
+		and TeX Live releases prior to 2015 (draftwatermark).
 		This answer assumes Ubuntu, but it should work on other
 		distros.
 
@@ -189,6 +190,7 @@
 		http://mirrors.ctan.org/macros/latex/contrib/titlesec.zip
 		http://mirrors.ctan.org/macros/latex/contrib/cleveref.zip
 		http://mirrors.ctan.org/macros/latex/contrib/listings.zip
+		http://mirrors.ctan.org/macros/latex/contrib/draftwatermark.zip
 
 	    2.	Install it by following instructions at:
 		https://help.ubuntu.com/community/LaTeX#Installing_packages_manually
diff --git a/perfbook.tex b/perfbook.tex
index 73b79205..0fae78fb 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -60,6 +60,14 @@
 \usepackage{threeparttable}
 \usepackage{titlesec}[2016/03/21] % Suppress number in paragraph heading
 \usepackage{fmtcount}
+\usepackage{draftwatermark}[2015/02/19]
+\SetWatermarkAngle{0.0}
+\SetWatermarkFontSize{8pt}
+\SetWatermarkScale{1.0}
+\SetWatermarkLightness{.6}
+\SetWatermarkHorCenter{.85\paperwidth}
+\SetWatermarkVerCenter{.95\paperheight}
+\SetWatermarkText{\texttt{\commitid}}
 \usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0},linktoc=all]{hyperref}
 \usepackage{footnotebackref} % to enable cross-ref of footnote
 \usepackage[all]{hypcap} % for going to the top of figure and table
diff --git a/utilities/autodate.sh b/utilities/autodate.sh
index 2ebc0754..a954bbe7 100644
--- a/utilities/autodate.sh
+++ b/utilities/autodate.sh
@@ -30,6 +30,7 @@ then
 	date_str=`date -R`
 	modified=""
 	release=""
+	commitid=""
 else
 	date_str=`git show --format="%cD" | head -1`
 	# check if git status is clean
@@ -44,12 +45,15 @@ else
 	case "$description" in
 	*-g*)
 		release=`env printf 'Commit: \\\texttt{%s}' "$description"`
+		commitid=`echo $description | sed -e 's/.*-\(g.*\)/\1/'`
 		;;
 	v*)
 		release="Release $description"
+		commitid=$description
 		;;
 	Edition*)
 		release="Edition"
+		commitid=$description
 		case "$description" in
 		*P*)
 			release="Print $release"
@@ -70,6 +74,7 @@ else
 		;;
 	*)
 		release=`env printf 'Tag: \\\texttt{%s}' "$description"`
+		commitid=`echo $description | sed -e 's/.*-\(g.*\)/\1/'`
 		;;
 	esac
 fi
@@ -83,3 +88,4 @@ fi
 
 env printf '\\date{%s %s, %s %s %s}\n' $month $day $year "$release" $modified
 env printf '\\newcommand{\\commityear}{%s}\n' $year
+env printf '\\newcommand{\\commitid}{%s}\n' $commitid$modified
-- 
2.17.1



  parent reply	other threads:[~2019-12-29 10:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-29 10:21 [PATCH 0/3] Improve autodate.sh Akira Yokosawa
2019-12-29 10:23 ` [PATCH 1/3] utilities/autodate: Use 'fmtcount' package for ordinals Akira Yokosawa
2019-12-29 10:25 ` [PATCH 2/3] utilities/autodate: Ignore untracked files in 'git status' Akira Yokosawa
2019-12-29 10:26 ` Akira Yokosawa [this message]
2019-12-31  0:06 ` [PATCH 0/3] Improve autodate.sh Paul E. McKenney
2019-12-31 23:36   ` Akira Yokosawa
2020-01-01  3:06     ` Paul E. McKenney
2020-01-02  4:00       ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c028454-d84f-d32c-35ad-16c8df966482@gmail.com \
    --to=akiyks@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=perfbook@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.