Skip to contentSkip to conversation

Add targets for alternative fonts

PATCH In review Akira Yokosawa 2 participants 12 messages Oct 18, 2016 – Oct 19, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

cover Add targets for alternative fonts

From ec360d66cdab86bbe98d544aca52aaec1e03518e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 16 Oct 2016 20:11:35 +0900
Subject: [PATCH 0/6] Add targets for alternative fonts

Hi,

As I implied in the cover-letter of previous patch set, I attempted to add make targets for alternative monospaced fonts.

Courier font is said to be a standard monospeced typewriter font. It is good as long as you don't mix it with other fonts, but when mixed used in Times Roman text, it looks too wide and too thin.

Typewriter fonts available in LaTeX are listed at the LaTeX Font Catalogue site: http://www.tug.dk/FontCatalogue/typewriterfonts.html
(including both monospaced and proportional fonts).

I have no idea how much people prefer courier font, so I took two approaches.

One was to try courier font variations.
The other was to try "txtt" based font packages. "txtt" is a font designed to look better when mixed used with Times fonts.

But I couldn't figure out which to propose because of pros and cons of candidate fonts. So I just added make targets for people to try.

Detailed explanation of these new targets and font packages can be found in the commit message of the 3rd patch ("Makefile: Add targets for alternative monospace fonts").

Summary of pros and cons of each target is as follows.

mss: (courier scaled)
pros: o can build on old TeX installation
cons: o too thin
o scaling by .94 affects apparent vertical position (looks slightly lower than Times Roman text)
msr: (nimbusmono regular)
pros: o thick enough
cons: o requires recent TeX installation
o scaling by .94 affects apparent vertical position (looks slightly lower than Times Roman text)
msn: (nimbusmononarrow)
pros: o can hold up to 64 characters in a line of code snippet
cons: o requires recent TeX installation
o single letter variable names denoted by \co{} may be hard to recognize
mstx: (txtt)
pros: o can build on old TeX installation
o looks mostly good when mixed with Times Roman
cons: o zero character is slashed
o asterisk character has a higher position
msnt: (newtxtt)
pros: o looks mostly good when mixed with Times Roman
cons: o requires recent TeX installation
o asterisk character has a higher position

Shrinking courier based fonts reduces the x-height, and causes monospaced text to look somewhat lower than Times Roman text. Actual baseline is not affected but the look is affected.

My preference is the target "msnt" which uses "newtxtt" font package. But "txtt" based fonts have higher positions of "*" character. I anticipate some people to have hesitation to use it.

There are other obstacles here. Some of the targets require quite recent LaTeX installation or manual installation of font packages.

On Ubuntu Trusty, only the targets "mss" and "mstx" can be built on TeX Live 2013 available there.

On Ubuntu Xenial, TeX Live 2015 works just fine for all the targets.

My recommendation is to use "mss" (courier scaled) option as the default and permit up to 57 characters in a line of code snippets, and give people alternative font choices as make targets.

If "mss" is acceptable as the default, we can modify "perfbook.tex" and revert ad hoc fontsize tweaks done in the past.

The latter half of this patch set is an attempt to use sans serif font (Helvetica) as default font for one-column layout. Sans serif fonts are said to be easier to read on a lower resolution display.

Again, there is an obstacle here. I used a package "mathastext" for math mode font tweaks, but the version of mathastext on Ubuntu Trusty conflicts with hyperref package. The version provided on Ubuntu Xenial works fine with a workaround given in the 5th patch ("Redefine \path command for sans serif font").

Please take time to see which one meets your preference and let me know what you feel.

Thanks, Akira

Akira Yokosawa (6):
Separate font package declarations
Adjust scale of sans serif font
Makefile: Add targets for alternative monospace fonts
Makefile: Add target '1csf' (one-column sans serif) Redefine \path command for sans serif font
Makefile: Add notice of mathastext version for 1csf

 Makefile     | 25 ++++++++++++++++++++++++-
 perfbook.tex | 38 ++++++++++++++++++++++++++------------
 2 files changed, 50 insertions(+), 13 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

From 0cfe68cfd9e7c5413c26f25408ea3cb78f1a334c Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 9 Oct 2016 17:59:03 +0900
Subject: [PATCH 1/6] Separate font package declarations

This is a preparation of font-choice tweaks to follow.

---
 perfbook.tex | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
perfbook.tex +3 -1
index 66c93fe..87d5b53 100644
@@ -5,7 +5,9 @@
 % A more pleasant font
 \usepackage[T1]{fontenc} % use postscript type 1 fonts
 \usepackage{textcomp} % use symbols in TS1 encoding
-\usepackage{mathptmx,helvet,courier} % use nice, standard fonts for roman, sans and monospace respectively
+\usepackage{mathptmx} % use nice, standard fonts for roman,
+\usepackage{helvet}   % sans serif,
+\usepackage{courier}  % and monospace respectively
 
 % Improves the text layout
 \usepackage{microtype}
Signature · 1 line
2.7.4
#2 lore raw
Quoted 18 lines · Akira Yokosawa
Quoted 1 line

From 0cfe68cfd9e7c5413c26f25408ea3cb78f1a334c Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Sun, 9 Oct 2016 17:59:03 +0900
Subject: [PATCH 1/6] Separate font package declarations

This is a preparation of font-choice tweaks to follow.

---
 perfbook.tex | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
perfbook.tex +0 -0
index 66c93fe..87d5b53 100644

perfbook.tex line 13

Quoted 10 lines
perfbook.tex +3 -1
@@ -5,7 +5,9 @@
 % A more pleasant font
 \usepackage[T1]{fontenc} % use postscript type 1 fonts
 \usepackage{textcomp} % use symbols in TS1 encoding
-\usepackage{mathptmx,helvet,courier} % use nice, standard fonts for roman, sans and monospace respectively
+\usepackage{mathptmx} % use nice, standard fonts for roman,
+\usepackage{helvet}   % sans serif,
+\usepackage{courier}  % and monospace respectively
 
 % Improves the text layout
 \usepackage{microtype}

Sorry, I failed to put a correct subject to this mail. The one in the mail body is what was intended.

Thanks, Akira

#3 lore raw

PATCH 1/6 Separate font package declarations

In reply to Akira Yokosawa

From 0cfe68cfd9e7c5413c26f25408ea3cb78f1a334c Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 9 Oct 2016 17:59:03 +0900
Subject: [PATCH 1/6] Separate font package declarations

This is a preparation of font-choice tweaks to follow.

---
 perfbook.tex | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
perfbook.tex +3 -1
index 66c93fe..87d5b53 100644
@@ -5,7 +5,9 @@
 % A more pleasant font
 \usepackage[T1]{fontenc} % use postscript type 1 fonts
 \usepackage{textcomp} % use symbols in TS1 encoding
-\usepackage{mathptmx,helvet,courier} % use nice, standard fonts for roman, sans and monospace respectively
+\usepackage{mathptmx} % use nice, standard fonts for roman,
+\usepackage{helvet}   % sans serif,
+\usepackage{courier}  % and monospace respectively
 
 % Improves the text layout
 \usepackage{microtype}
Signature · 1 line
2.7.4
#4 lore raw

PATCH 2/6 Adjust scale of sans serif font

In reply to Akira Yokosawa

From 052b26ecc718edba3cc32d611111b1e43c5a23af Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 9 Oct 2016 18:25:21 +0900
Subject: [PATCH 2/6] Adjust scale of sans serif font

In the documentation[1] of "psnfss2e" package, it is stated that the sans serif font "helvet" should be scaled by 0.92 to match the size of Times font.

This commit adds the option to do so.

[1] http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf

---
 perfbook.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
perfbook.tex +1 -1
index 87d5b53..f808c7f 100644
@@ -6,7 +6,7 @@
 \usepackage[T1]{fontenc} % use postscript type 1 fonts
 \usepackage{textcomp} % use symbols in TS1 encoding
 \usepackage{mathptmx} % use nice, standard fonts for roman,
-\usepackage{helvet}   % sans serif,
+\usepackage[scaled=.92]{helvet}   % sans serif,
 \usepackage{courier}  % and monospace respectively
 
 % Improves the text layout
Signature · 1 line
2.7.4
#5 lore raw

PATCH 3/6 Makefile: Add targets for alternative monospace fonts

In reply to Akira Yokosawa

From 22d9797e88856033fb4837542b22da37dd0687e2 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 15 Oct 2016 19:34:08 +0900
Subject: [PATCH 3/6] Makefile: Add targets for alternative monospace fonts

"courier" font is a bit too wide and thin when used among text of "Times Roman" font. Also, code snippets figures tend to become too wide for two-column layout.
Some of such figures have been tweaked by using non-standard font sizes and line spacings.

This issue of courier font is fairly well known among LaTeX community and quite a few packages exist to address it.

Courier based:
o "couriers" (courier-scaled) package [1] provides scaling of courier font.
o "nimbus15" package [2] provides courier based monospace fonts with thicker and narrower geometries.
"txtt" based:
o "txtt" font provided in "txfonts" package (thicker than courier and looks better when mixed with Times font)
o "newtxtt" package [3] provides improved txtt font with an option to select appearance of zero character.

This commit adds 5 make targets to use these alternative fonts.

o "mss" ([m]ono[s]pace [s]caled): "couriers" with "scaled=.94" option.
o "mstx" ([m]ono[s]pace [tx]tt): "txtt"
o "msr" ([m]ono[s]pace [r]egular): "nimbusmono" with "scaled=.94" option.
o "msn" ([m]ono[s]pace [n]arrow): "minbusmononarrow".
o "msnt" ([m]ono[s]pace [n]ew[t]xtt): "newtxtt" with "zerostyle=a" option.

Scaling factor of 0.94 is chosen to reduce overfulness of code snippets which are not yet tweaked.

When these targets are used, code snippet figures of scriptsize can hold the following number of characters within the column width of two-column layout.

courier          : 54 (current default)
mss, msr         : 57
mstx, msnt       : 61
msn              : 64

Note that packages "newtxtt" and "nimbus15" are fairly new, and you may need install them or upgrade TeX installation to use targets "msr", "msn", and "msnt".
The target "mstx" is provided as an easy means to evaluate "newtxtt" without installing it.

[1] http://mirrors.ctan.org/fonts/psfonts/courier-scaled/Couriers.pdf
[2] http://mirrors.ctan.org/fonts/nimbus15/doc/nimbus15-doc.pdf
[3] http://mirrors.ctan.org/fonts/newtxtt/doc/newtxtt-doc.pdf

---
 Makefile | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
Makefile +19 -1
index eb83af4..de6cd0d 100644
@@ -9,7 +9,7 @@ LATEXSOURCES = \
 
 LATEXGENERATED = qqz.tex contrib.tex origpub.tex
 
-ABBREVTARGETS := 1c hb
+ABBREVTARGETS := 1c hb mss mstx msr msn msnt
 
 PDFTARGETS := perfbook.pdf $(foreach v,$(ABBREVTARGETS),perfbook-$(v).pdf)
 
@@ -95,6 +95,24 @@ perfbook-1c.tex: perfbook.tex
 perfbook-hb.tex: perfbook.tex
 	sed -e 's/,twocolumn/&,letterpaperhb/' -e 's/setboolean{hardcover}{false}/setboolean{hardcover}{true}/' < $< > $@
 
+perfbook-mss.tex: perfbook.tex
+	sed -e 's/usepackage{courier}/usepackage[scaled=0.94]{couriers}/' < $< > $@
+
+perfbook-mstx.tex: perfbook.tex
+	sed -e 's/usepackage{courier}/renewcommand*\\ttdefault{txtt}/' < $< > $@
+
+perfbook-msr.tex: perfbook.tex
+	sed -e 's/usepackage{courier}/usepackage[scaled=0.94]{nimbusmono}/' < $< > $@
+	@echo "## This target requires font package nimbus15. ##"
+
+perfbook-msn.tex: perfbook.tex
+	sed -e 's/usepackage{courier}/usepackage{nimbusmononarrow}/' < $< > $@
+	@echo "## This target requires font package nimbus15. ##"
+
+perfbook-msnt.tex: perfbook.tex
+	sed -e 's/usepackage{courier}/usepackage[zerostyle=a]{newtxtt}/' < $< > $@
+	@echo "## This target requires font package newtxtt. ##"
+
 # Rules related to perfbook_html are removed as of May, 2016
 
 $(EPSSOURCES_FROM_TEX): %.eps: %.tex
Signature · 1 line
2.7.4
#6 lore raw

PATCH 4/6 Makefile: Add target '1csf' (one-column sans serif)

In reply to Akira Yokosawa

From bfa3017cea4952b495aa706643a87b83ffd9637e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 10 Oct 2016 16:08:07 +0900
Subject: [PATCH 4/6] Makefile: Add target '1csf' (one-column sans serif)

Sans serif fonts are said to be easier to read on a (not high definition) display than serif fonts.
Current perfbook-1c.pdf is supposed to be for such readers, but is using serif font (Times Roman).
To try a sans serif font (Helvetica) version for one-column layout, this commit adds a new boolean "sansserif" in the preamble and a make target "1csf" that sets the boolean true.

Since the boolean is referred to in an earlier part of the preamble, declarations of custom booleans are moved forward along with the new boolean.

The result can not be said as optimal, but it is mostly good. As for monospece font this commit uses "inconsolata", which is mostly sans serif.
For epigraphs, Times Roman is used as before.

---
 Makefile     |  6 +++++-
 perfbook.tex | 33 ++++++++++++++++++++++-----------
 2 files changed, 27 insertions(+), 12 deletions(-)
Makefile +5 -1
index de6cd0d..2ccce9d 100644
@@ -9,7 +9,7 @@ LATEXSOURCES = \
 
 LATEXGENERATED = qqz.tex contrib.tex origpub.tex
 
-ABBREVTARGETS := 1c hb mss mstx msr msn msnt
+ABBREVTARGETS := 1c hb mss mstx msr msn msnt 1csf
 
 PDFTARGETS := perfbook.pdf $(foreach v,$(ABBREVTARGETS),perfbook-$(v).pdf)
 
@@ -113,6 +113,10 @@ perfbook-msnt.tex: perfbook.tex
 	sed -e 's/usepackage{courier}/usepackage[zerostyle=a]{newtxtt}/' < $< > $@
 	@echo "## This target requires font package newtxtt. ##"
 
+perfbook-1csf.tex: perfbook-1c.tex
+	sed -e 's/setboolean{sansserif}{false}/setboolean{sansserif}{true}/' \
+	    -e 's/usepackage{courier}/usepackage[var0]{inconsolata}/' < $< > $@
+
 # Rules related to perfbook_html are removed as of May, 2016
 
 $(EPSSOURCES_FROM_TEX): %.eps: %.tex
perfbook.tex +22 -11
index f808c7f..0d6f08d 100644
@@ -45,6 +45,27 @@
 \usepackage{qqz}
 \usepackage{origpub}
 
+% custom booleans
+
+\newboolean{inbook}
+\setboolean{inbook}{true}
+\newcommand{\IfInBook}[2]{\ifthenelse{\boolean{inbook}}{#1}{#2}}
+\newboolean{twocolumn}
+\setboolean{twocolumn}{true}
+\newcommand{\IfTwoColumn}[2]{\ifthenelse{\boolean{twocolumn}}{#1}{#2}}
+\newboolean{hardcover}
+\setboolean{hardcover}{false}
+\newcommand{\IfHardCover}[2]{\ifthenelse{\boolean{hardcover}}{#1}{#2}}
+\newboolean{sansserif}
+\setboolean{sansserif}{false}
+\newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}}
+
+\IfSansSerif{
+\renewcommand{\familydefault}{\sfdefault}
+\normalfont
+\usepackage[italic]{mathastext}
+}{}
+
 \begin{document}
 
 %%HTMLSKIP
@@ -69,7 +90,7 @@
 % ---  End of workaround for Fedora 23 Texlive bug
 \newcommand{\co}[1]{\lstinline[breaklines=true,breakatwhitespace=true]{#1}}
 \newcommand{\nbco}[1]{\lstinline[breaklines=false,breakatwhitespace=false]{#1}}
-\newcommand{\Epigraph}[2]{\epigraphhead[65]{\epigraph{#1}{#2}}}
+\newcommand{\Epigraph}[2]{\epigraphhead[65]{\rmfamily\epigraph{#1}{#2}}}
 
 \title{Is Parallel Programming Hard, And, If So, What Can You Do About It?}
 \author{
@@ -93,16 +114,6 @@
 \renewcommand\dbltopfraction{.75}
 \renewcommand\dblfloatpagefraction{.5}
 
-\newboolean{inbook}
-\setboolean{inbook}{true}
-\newcommand{\IfInBook}[2]{\ifthenelse{\boolean{inbook}}{#1}{#2}}
-\newboolean{twocolumn}
-\setboolean{twocolumn}{true}
-\newcommand{\IfTwoColumn}[2]{\ifthenelse{\boolean{twocolumn}}{#1}{#2}}
-\newboolean{hardcover}
-\setboolean{hardcover}{false}
-\newcommand{\IfHardCover}[2]{\ifthenelse{\boolean{hardcover}}{#1}{#2}}
-
 \IfTwoColumn{
 \setlength{\textheight}{8.25in}
 \setlength{\textwidth}{6.5in}
Signature · 1 line
2.7.4
#7 lore raw

PATCH 5/6 Redefine \path command for sans serif font

In reply to Akira Yokosawa

From e5db129b6fe3f2612a9f823f213a734499a0893e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 10 Oct 2016 23:34:50 +0900
Subject: [PATCH 5/6] Redefine \path command for sans serif font

The "mathastext" package interferes with \path command and make it lose line-breaking at a "/" or a ".".
Redefining \path command seems to work.

---
 perfbook.tex | 1 +
 1 file changed, 1 insertion(+)
perfbook.tex +1 -0
index 0d6f08d..0dfc380 100644
@@ -64,6 +64,7 @@
 \renewcommand{\familydefault}{\sfdefault}
 \normalfont
 \usepackage[italic]{mathastext}
+\renewcommand{\path}[1]{\nolinkurl{#1}} % workaround of interference with mathastext
 }{}
 
 \begin{document}
Signature · 1 line
2.7.4
#8 lore raw

PATCH 6/6 Makefile: Add notice of mathastext version for 1csf

In reply to Akira Yokosawa

From ec360d66cdab86bbe98d544aca52aaec1e03518e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 16 Oct 2016 19:35:37 +0900
Subject: [PATCH 6/6] Makefile: Add notice of mathastext version for 1csf

On Ubuntu Trusty, the version of mathastext package installed in TeX Lve is 1.3c. It conflicts with hyperref package's \url and \path commands and breaks their line-break behavior. The issue was resolved in version 1.3i.
This commit adds a notice to the target "1csf" regarding this.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 2ccce9d..a73aadb 100644
@@ -116,6 +116,7 @@ perfbook-msnt.tex: perfbook.tex
 perfbook-1csf.tex: perfbook-1c.tex
 	sed -e 's/setboolean{sansserif}{false}/setboolean{sansserif}{true}/' \
 	    -e 's/usepackage{courier}/usepackage[var0]{inconsolata}/' < $< > $@
+	@echo "## This target requires recent version (>= 1.3i) of mathastext. ##"
 
 # Rules related to perfbook_html are removed as of May, 2016
 
Signature · 1 line
2.7.4
#9 lore raw
In reply to Akira Yokosawa
Quoted 105 lines · Akira Yokosawa
Quoted 1 line

From ec360d66cdab86bbe98d544aca52aaec1e03518e Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Sun, 16 Oct 2016 20:11:35 +0900
Subject: [PATCH 0/6] Add targets for alternative fonts

Hi,

As I implied in the cover-letter of previous patch set, I attempted to add make targets for alternative monospaced fonts.

Courier font is said to be a standard monospeced typewriter font. It is good as long as you don't mix it with other fonts, but when mixed used in Times Roman text, it looks too wide and too thin.

Typewriter fonts available in LaTeX are listed at the LaTeX Font Catalogue site: http://www.tug.dk/FontCatalogue/typewriterfonts.html
(including both monospaced and proportional fonts).

I have no idea how much people prefer courier font, so I took two approaches.

One was to try courier font variations.
The other was to try "txtt" based font packages. "txtt" is a font designed to look better when mixed used with Times fonts.

But I couldn't figure out which to propose because of pros and cons of candidate fonts. So I just added make targets for people to try.

Detailed explanation of these new targets and font packages can be found in the commit message of the 3rd patch ("Makefile: Add targets for alternative monospace fonts").

Summary of pros and cons of each target is as follows.

mss: (courier scaled)
pros: o can build on old TeX installation
cons: o too thin
o scaling by .94 affects apparent vertical position (looks slightly lower than Times Roman text)
msr: (nimbusmono regular)
pros: o thick enough
cons: o requires recent TeX installation
o scaling by .94 affects apparent vertical position (looks slightly lower than Times Roman text)
msn: (nimbusmononarrow)
pros: o can hold up to 64 characters in a line of code snippet
cons: o requires recent TeX installation
o single letter variable names denoted by \co{} may be hard to recognize
mstx: (txtt)
pros: o can build on old TeX installation
o looks mostly good when mixed with Times Roman
cons: o zero character is slashed
o asterisk character has a higher position
msnt: (newtxtt)
pros: o looks mostly good when mixed with Times Roman
cons: o requires recent TeX installation
o asterisk character has a higher position

Shrinking courier based fonts reduces the x-height, and causes monospaced text to look somewhat lower than Times Roman text. Actual baseline is not affected but the look is affected.

My preference is the target "msnt" which uses "newtxtt" font package. But "txtt" based fonts have higher positions of "*" character. I anticipate some people to have hesitation to use it.

There are other obstacles here. Some of the targets require quite recent LaTeX installation or manual installation of font packages.

On Ubuntu Trusty, only the targets "mss" and "mstx" can be built on TeX Live 2013 available there.

On Ubuntu Xenial, TeX Live 2015 works just fine for all the targets.

My recommendation is to use "mss" (courier scaled) option as the default and permit up to 57 characters in a line of code snippets, and give people alternative font choices as make targets.

If "mss" is acceptable as the default, we can modify "perfbook.tex" and revert ad hoc fontsize tweaks done in the past.

The latter half of this patch set is an attempt to use sans serif font (Helvetica) as default font for one-column layout. Sans serif fonts are said to be easier to read on a lower resolution display.

Again, there is an obstacle here. I used a package "mathastext" for math mode font tweaks, but the version of mathastext on Ubuntu Trusty conflicts with hyperref package. The version provided on Ubuntu Xenial works fine with a workaround given in the 5th patch ("Redefine \path command for sans serif font").

Please take time to see which one meets your preference and let me know what you feel.

Thanks, Akira

Akira Yokosawa (6):
Separate font package declarations
Adjust scale of sans serif font
Makefile: Add targets for alternative monospace fonts
Makefile: Add target '1csf' (one-column sans serif) Redefine \path command for sans serif font
Makefile: Add notice of mathastext version for 1csf

Quoted 3 lines
 Makefile     | 25 ++++++++++++++++++++++++-
 perfbook.tex | 38 ++++++++++++++++++++++++++------------
 2 files changed, 50 insertions(+), 13 deletions(-)

Applied and pushed, thank you!

Getting on a plane soon, but will check tables containing code later, as these have been the places where font size has been the most troublesome.

Next time, could you please resend the whole series as v2? Just makes it a bit easier to process. ;-)

Thanx, Paul

#10 lore raw
Quoted 110 lines · Paul E. McKenney
Quoted 105 lines · Akira Yokosawa
Quoted 1 line

From ec360d66cdab86bbe98d544aca52aaec1e03518e Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Sun, 16 Oct 2016 20:11:35 +0900
Subject: [PATCH 0/6] Add targets for alternative fonts

Hi,

As I implied in the cover-letter of previous patch set, I attempted to add make targets for alternative monospaced fonts.

Courier font is said to be a standard monospeced typewriter font. It is good as long as you don't mix it with other fonts, but when mixed used in Times Roman text, it looks too wide and too thin.

Typewriter fonts available in LaTeX are listed at the LaTeX Font Catalogue site: http://www.tug.dk/FontCatalogue/typewriterfonts.html
(including both monospaced and proportional fonts).

I have no idea how much people prefer courier font, so I took two approaches.

One was to try courier font variations.
The other was to try "txtt" based font packages. "txtt" is a font designed to look better when mixed used with Times fonts.

But I couldn't figure out which to propose because of pros and cons of candidate fonts. So I just added make targets for people to try.

Detailed explanation of these new targets and font packages can be found in the commit message of the 3rd patch ("Makefile: Add targets for alternative monospace fonts").

Summary of pros and cons of each target is as follows.

mss: (courier scaled)
pros: o can build on old TeX installation
cons: o too thin
o scaling by .94 affects apparent vertical position (looks slightly lower than Times Roman text)
msr: (nimbusmono regular)
pros: o thick enough
cons: o requires recent TeX installation
o scaling by .94 affects apparent vertical position (looks slightly lower than Times Roman text)
msn: (nimbusmononarrow)
pros: o can hold up to 64 characters in a line of code snippet
cons: o requires recent TeX installation
o single letter variable names denoted by \co{} may be hard to recognize
mstx: (txtt)
pros: o can build on old TeX installation
o looks mostly good when mixed with Times Roman
cons: o zero character is slashed
o asterisk character has a higher position
msnt: (newtxtt)
pros: o looks mostly good when mixed with Times Roman
cons: o requires recent TeX installation
o asterisk character has a higher position

Shrinking courier based fonts reduces the x-height, and causes monospaced text to look somewhat lower than Times Roman text. Actual baseline is not affected but the look is affected.

My preference is the target "msnt" which uses "newtxtt" font package. But "txtt" based fonts have higher positions of "*" character. I anticipate some people to have hesitation to use it.

There are other obstacles here. Some of the targets require quite recent LaTeX installation or manual installation of font packages.

On Ubuntu Trusty, only the targets "mss" and "mstx" can be built on TeX Live 2013 available there.

On Ubuntu Xenial, TeX Live 2015 works just fine for all the targets.

My recommendation is to use "mss" (courier scaled) option as the default and permit up to 57 characters in a line of code snippets, and give people alternative font choices as make targets.

If "mss" is acceptable as the default, we can modify "perfbook.tex" and revert ad hoc fontsize tweaks done in the past.

The latter half of this patch set is an attempt to use sans serif font (Helvetica) as default font for one-column layout. Sans serif fonts are said to be easier to read on a lower resolution display.

Again, there is an obstacle here. I used a package "mathastext" for math mode font tweaks, but the version of mathastext on Ubuntu Trusty conflicts with hyperref package. The version provided on Ubuntu Xenial works fine with a workaround given in the 5th patch ("Redefine \path command for sans serif font").

Please take time to see which one meets your preference and let me know what you feel.

Thanks, Akira

Akira Yokosawa (6):
Separate font package declarations
Adjust scale of sans serif font
Makefile: Add targets for alternative monospace fonts
Makefile: Add target '1csf' (one-column sans serif) Redefine \path command for sans serif font
Makefile: Add notice of mathastext version for 1csf

Quoted 3 lines
 Makefile     | 25 ++++++++++++++++++++++++-
 perfbook.tex | 38 ++++++++++++++++++++++++++------------
 2 files changed, 50 insertions(+), 13 deletions(-)
Quoted 7 lines

Applied and pushed, thank you!

Getting on a plane soon, but will check tables containing code later, as these have been the places where font size has been the most troublesome.

Next time, could you please resend the whole series as v2? Just makes it a bit easier to process. ;-)

Yes. I noticed the error just before leaving home. I half expected to get request for v2. Doing manual patch submission in the morning was a bad idea...

Regards, Akira

Quoted 4 lines

Thanx, Paul

#11 lore raw
Quoted 113 lines · Akira Yokosawa
Quoted 112 lines · Paul E. McKenney
Quoted 105 lines · Akira Yokosawa
Quoted 1 line

From ec360d66cdab86bbe98d544aca52aaec1e03518e Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Sun, 16 Oct 2016 20:11:35 +0900
Subject: [PATCH 0/6] Add targets for alternative fonts

Hi,

As I implied in the cover-letter of previous patch set, I attempted to add make targets for alternative monospaced fonts.

Courier font is said to be a standard monospeced typewriter font. It is good as long as you don't mix it with other fonts, but when mixed used in Times Roman text, it looks too wide and too thin.

Typewriter fonts available in LaTeX are listed at the LaTeX Font Catalogue site: http://www.tug.dk/FontCatalogue/typewriterfonts.html
(including both monospaced and proportional fonts).

I have no idea how much people prefer courier font, so I took two approaches.

One was to try courier font variations.
The other was to try "txtt" based font packages. "txtt" is a font designed to look better when mixed used with Times fonts.

But I couldn't figure out which to propose because of pros and cons of candidate fonts. So I just added make targets for people to try.

Detailed explanation of these new targets and font packages can be found in the commit message of the 3rd patch ("Makefile: Add targets for alternative monospace fonts").

Summary of pros and cons of each target is as follows.

mss: (courier scaled)
pros: o can build on old TeX installation
cons: o too thin
o scaling by .94 affects apparent vertical position (looks slightly lower than Times Roman text)
msr: (nimbusmono regular)
pros: o thick enough
cons: o requires recent TeX installation
o scaling by .94 affects apparent vertical position (looks slightly lower than Times Roman text)
msn: (nimbusmononarrow)
pros: o can hold up to 64 characters in a line of code snippet
cons: o requires recent TeX installation
o single letter variable names denoted by \co{} may be hard to recognize
mstx: (txtt)
pros: o can build on old TeX installation
o looks mostly good when mixed with Times Roman
cons: o zero character is slashed
o asterisk character has a higher position
msnt: (newtxtt)
pros: o looks mostly good when mixed with Times Roman
cons: o requires recent TeX installation
o asterisk character has a higher position

Shrinking courier based fonts reduces the x-height, and causes monospaced text to look somewhat lower than Times Roman text. Actual baseline is not affected but the look is affected.

My preference is the target "msnt" which uses "newtxtt" font package. But "txtt" based fonts have higher positions of "*" character. I anticipate some people to have hesitation to use it.

There are other obstacles here. Some of the targets require quite recent LaTeX installation or manual installation of font packages.

On Ubuntu Trusty, only the targets "mss" and "mstx" can be built on TeX Live 2013 available there.

On Ubuntu Xenial, TeX Live 2015 works just fine for all the targets.

My recommendation is to use "mss" (courier scaled) option as the default and permit up to 57 characters in a line of code snippets, and give people alternative font choices as make targets.

If "mss" is acceptable as the default, we can modify "perfbook.tex" and revert ad hoc fontsize tweaks done in the past.

The latter half of this patch set is an attempt to use sans serif font (Helvetica) as default font for one-column layout. Sans serif fonts are said to be easier to read on a lower resolution display.

Again, there is an obstacle here. I used a package "mathastext" for math mode font tweaks, but the version of mathastext on Ubuntu Trusty conflicts with hyperref package. The version provided on Ubuntu Xenial works fine with a workaround given in the 5th patch ("Redefine \path command for sans serif font").

Please take time to see which one meets your preference and let me know what you feel.

Thanks, Akira

Akira Yokosawa (6):
Separate font package declarations
Adjust scale of sans serif font
Makefile: Add targets for alternative monospace fonts
Makefile: Add target '1csf' (one-column sans serif) Redefine \path command for sans serif font
Makefile: Add notice of mathastext version for 1csf

Quoted 3 lines
 Makefile     | 25 ++++++++++++++++++++++++-
 perfbook.tex | 38 ++++++++++++++++++++++++++------------
 2 files changed, 50 insertions(+), 13 deletions(-)

Applied and pushed, thank you!

Quoted 8 lines
Quoted 5 lines

Getting on a plane soon, but will check tables containing code later, as these have been the places where font size has been the most troublesome.

Next time, could you please resend the whole series as v2? Just makes it a bit easier to process. ;-)

Yes. I noticed the error just before leaving home. I half expected to get request for v2. Doing manual patch submission in the morning was a bad idea...

I do know that feeling... ;-)

Thanx, Paul