All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
@ 2017-03-20  4:58 Akira Yokosawa
  2017-03-21 18:35 ` Paul E. McKenney
  0 siblings, 1 reply; 9+ messages in thread
From: Akira Yokosawa @ 2017-03-20  4:58 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Mon, 20 Mar 2017 13:10:38 +0900
Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'

By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
in verbatim, verbbox, table, tabular, tabulary, and minipage
environments, we can improve consistency of looks independent of
monospace font choice for main text. cmtt font is more than suitable
for listing of code snippet and program output.

However, when mixed used with Times Roman (clone) font, cmtt's
slightly lower x-height than Times Roman, and its similar thickness
as Times Roman, it is not distinctive enough as can be seen in
"mslm" target.

In this respect, "txtt" and its enhanced version "newtxtt" fonts
are more suitable as is described in [1].

This commit enables the font choice of cmtt for code snippets in
targets "msnt" and "mstx".

Help messages in Makefile are updated accordingly.

Any feedback on the font choice is welcome.

[1] Excerpt from newtxtt documentation:

    This package provides an interface to another alternative---the
    typewriter fonts provided with txfonts, with some enhancements.
    They have the same widths as cmtt, but are taller, heavier,
    more geometric and less shapely, with very low contrast, and
    are more suited to match Roman fonts of height and weight
    approximating that of Times.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile     | 17 +++++++++++------
 perfbook.tex | 13 +++++++++++++
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 2c88e6c..e5f620c 100644
--- a/Makefile
+++ b/Makefile
@@ -110,7 +110,8 @@ perfbook-msns.tex: perfbook.tex
 	sed -e 's/\[scaled=\.94\]{couriers}/{courier}/' < $< > $@

 perfbook-mstx.tex: perfbook.tex
-	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' < $< > $@
+	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' \
+	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@

 perfbook-msr.tex: perfbook.tex
 	sed -e 's/\[scaled=\.94\]{couriers}/[scaled=.94]{nimbusmono}/' < $< > $@
@@ -121,8 +122,10 @@ perfbook-msn.tex: perfbook.tex
 	@echo "## This target requires font package nimbus15. ##"

 perfbook-msnt.tex: perfbook.tex
-	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' < $< > $@
+	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' \
+	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
 	@echo "## This target requires font package newtxtt. ##"
+	@echo "## If build fails, try target 'mstx' instead. ##"

 perfbook-mslm.tex: perfbook.tex
 	sed -e 's/%\\usepackage{lmodern}/\\usepackage{lmodern}/' \
@@ -181,17 +184,19 @@ help:
 	@echo
 	@echo "Experimental targets:"
 	@echo "  Full,              Abbr."
-	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
-	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
-	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
 	@echo "  perfbook-msnt.pdf, msnt: 2c with newtxtt as monospace (non-slashed 0)"
+	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
 	@echo "  perfbook-mslm.pdf, mslm: 2c with lmtt (Latin Modern Typewriter) as monospace"
 	@echo "       (Latin Modern is a clone of Computer Modern with additional type faces)"
+	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
+	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
+
 	@echo "  perfbook-1csf.pdf, 1csf: 1c with sans serif font"
 	@echo "  perfbook-msns.pdf, msns: 2c with non-scaled courier"
+	@echo "  \"msnt\" requires \"newtxtt\". \"mstx\" is fallback target for older TeX env."
+	@echo "  \"msnt\" and \"mstx\" use \"cmtt\" font for code snippet."
 	@echo "  \"msr\" and \"msn\" require \"nimbus15\"."
 	@echo "  \"msn\" doesn't cover bold face for monospace."
-	@echo "  \"msnt\" requires \"newtxtt\"."
 	@echo "  \"1csf\" requires recent version (>=1.3i) of \"mathastext\"."

 clean:
diff --git a/perfbook.tex b/perfbook.tex
index e8234c4..94f2f4b 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -15,6 +15,7 @@
 % Improves the text layout
 \usepackage{microtype}
 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
+\usepackage{etoolbox}

 \usepackage{lscape}
 \usepackage{epsfig}
@@ -64,6 +65,9 @@
 \newboolean{sansserif}
 \setboolean{sansserif}{false}
 \newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}}
+\newboolean{cmttforcode}
+\setboolean{cmttforcode}{false}
+\newcommand{\IfCmttForCode}[2]{\ifthenelse{\boolean{cmttforcode}}{#1}{#2}}

 \newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}}

@@ -74,6 +78,15 @@
 \renewcommand{\path}[1]{\nolinkurl{#1}} % workaround of interference with mathastext
 }{}

+\IfCmttForCode{
+\AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{cmtt}}
+\AtBeginEnvironment{verbbox}{\renewcommand{\ttdefault}{cmtt}}
+\AtBeginEnvironment{table}{\renewcommand{\ttdefault}{cmtt}}
+\AtBeginEnvironment{tabular}{\renewcommand{\ttdefault}{cmtt}}
+\AtBeginEnvironment{tabulary}{\renewcommand{\ttdefault}{cmtt}}
+\AtBeginEnvironment{minipage}{\renewcommand{\ttdefault}{cmtt}}
+}{}
+                   
 \begin{document}

 %%HTMLSKIP
-- 
2.7.4


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

* Re: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
  2017-03-20  4:58 [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx' Akira Yokosawa
@ 2017-03-21 18:35 ` Paul E. McKenney
  2017-03-21 22:04   ` Akira Yokosawa
  0 siblings, 1 reply; 9+ messages in thread
From: Paul E. McKenney @ 2017-03-21 18:35 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Mon, Mar 20, 2017 at 01:58:15PM +0900, Akira Yokosawa wrote:
> >From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Mon, 20 Mar 2017 13:10:38 +0900
> Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
> 
> By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
> in verbatim, verbbox, table, tabular, tabulary, and minipage
> environments, we can improve consistency of looks independent of
> monospace font choice for main text. cmtt font is more than suitable
> for listing of code snippet and program output.
> 
> However, when mixed used with Times Roman (clone) font, cmtt's
> slightly lower x-height than Times Roman, and its similar thickness
> as Times Roman, it is not distinctive enough as can be seen in
> "mslm" target.
> 
> In this respect, "txtt" and its enhanced version "newtxtt" fonts
> are more suitable as is described in [1].
> 
> This commit enables the font choice of cmtt for code snippets in
> targets "msnt" and "mstx".
> 
> Help messages in Makefile are updated accordingly.
> 
> Any feedback on the font choice is welcome.
> 
> [1] Excerpt from newtxtt documentation:
> 
>     This package provides an interface to another alternative---the
>     typewriter fonts provided with txfonts, with some enhancements.
>     They have the same widths as cmtt, but are taller, heavier,
>     more geometric and less shapely, with very low contrast, and
>     are more suited to match Roman fonts of height and weight
>     approximating that of Times.
> 
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>

Queued and pushed, thank you!

I did remove some trailing whitespace that this patch added to
perfbook.tex.  Please let me know if this whitespace was needed for
some reason.

							Thanx, Paul

> ---
>  Makefile     | 17 +++++++++++------
>  perfbook.tex | 13 +++++++++++++
>  2 files changed, 24 insertions(+), 6 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 2c88e6c..e5f620c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -110,7 +110,8 @@ perfbook-msns.tex: perfbook.tex
>  	sed -e 's/\[scaled=\.94\]{couriers}/{courier}/' < $< > $@
> 
>  perfbook-mstx.tex: perfbook.tex
> -	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' < $< > $@
> +	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' \
> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
> 
>  perfbook-msr.tex: perfbook.tex
>  	sed -e 's/\[scaled=\.94\]{couriers}/[scaled=.94]{nimbusmono}/' < $< > $@
> @@ -121,8 +122,10 @@ perfbook-msn.tex: perfbook.tex
>  	@echo "## This target requires font package nimbus15. ##"
> 
>  perfbook-msnt.tex: perfbook.tex
> -	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' < $< > $@
> +	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' \
> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
>  	@echo "## This target requires font package newtxtt. ##"
> +	@echo "## If build fails, try target 'mstx' instead. ##"
> 
>  perfbook-mslm.tex: perfbook.tex
>  	sed -e 's/%\\usepackage{lmodern}/\\usepackage{lmodern}/' \
> @@ -181,17 +184,19 @@ help:
>  	@echo
>  	@echo "Experimental targets:"
>  	@echo "  Full,              Abbr."
> -	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
> -	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
> -	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
>  	@echo "  perfbook-msnt.pdf, msnt: 2c with newtxtt as monospace (non-slashed 0)"
> +	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
>  	@echo "  perfbook-mslm.pdf, mslm: 2c with lmtt (Latin Modern Typewriter) as monospace"
>  	@echo "       (Latin Modern is a clone of Computer Modern with additional type faces)"
> +	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
> +	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
> +
>  	@echo "  perfbook-1csf.pdf, 1csf: 1c with sans serif font"
>  	@echo "  perfbook-msns.pdf, msns: 2c with non-scaled courier"
> +	@echo "  \"msnt\" requires \"newtxtt\". \"mstx\" is fallback target for older TeX env."
> +	@echo "  \"msnt\" and \"mstx\" use \"cmtt\" font for code snippet."
>  	@echo "  \"msr\" and \"msn\" require \"nimbus15\"."
>  	@echo "  \"msn\" doesn't cover bold face for monospace."
> -	@echo "  \"msnt\" requires \"newtxtt\"."
>  	@echo "  \"1csf\" requires recent version (>=1.3i) of \"mathastext\"."
> 
>  clean:
> diff --git a/perfbook.tex b/perfbook.tex
> index e8234c4..94f2f4b 100644
> --- a/perfbook.tex
> +++ b/perfbook.tex
> @@ -15,6 +15,7 @@
>  % Improves the text layout
>  \usepackage{microtype}
>  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
> +\usepackage{etoolbox}
> 
>  \usepackage{lscape}
>  \usepackage{epsfig}
> @@ -64,6 +65,9 @@
>  \newboolean{sansserif}
>  \setboolean{sansserif}{false}
>  \newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}}
> +\newboolean{cmttforcode}
> +\setboolean{cmttforcode}{false}
> +\newcommand{\IfCmttForCode}[2]{\ifthenelse{\boolean{cmttforcode}}{#1}{#2}}
> 
>  \newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}}
> 
> @@ -74,6 +78,15 @@
>  \renewcommand{\path}[1]{\nolinkurl{#1}} % workaround of interference with mathastext
>  }{}
> 
> +\IfCmttForCode{
> +\AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{cmtt}}
> +\AtBeginEnvironment{verbbox}{\renewcommand{\ttdefault}{cmtt}}
> +\AtBeginEnvironment{table}{\renewcommand{\ttdefault}{cmtt}}
> +\AtBeginEnvironment{tabular}{\renewcommand{\ttdefault}{cmtt}}
> +\AtBeginEnvironment{tabulary}{\renewcommand{\ttdefault}{cmtt}}
> +\AtBeginEnvironment{minipage}{\renewcommand{\ttdefault}{cmtt}}
> +}{}
> +                   
>  \begin{document}
> 
>  %%HTMLSKIP
> -- 
> 2.7.4
> 


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

* Re: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
  2017-03-21 18:35 ` Paul E. McKenney
@ 2017-03-21 22:04   ` Akira Yokosawa
  2017-03-21 22:41     ` Paul E. McKenney
  0 siblings, 1 reply; 9+ messages in thread
From: Akira Yokosawa @ 2017-03-21 22:04 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook, Akira Yokosawa

On 2017/03/22 3:35, Paul E. McKenney wrote:
> On Mon, Mar 20, 2017 at 01:58:15PM +0900, Akira Yokosawa wrote:
>> >From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
>> From: Akira Yokosawa <akiyks@gmail.com>
>> Date: Mon, 20 Mar 2017 13:10:38 +0900
>> Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
>>
>> By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
>> in verbatim, verbbox, table, tabular, tabulary, and minipage
>> environments, we can improve consistency of looks independent of
>> monospace font choice for main text. cmtt font is more than suitable
>> for listing of code snippet and program output.
>>
>> However, when mixed used with Times Roman (clone) font, cmtt's
>> slightly lower x-height than Times Roman, and its similar thickness
>> as Times Roman, it is not distinctive enough as can be seen in
>> "mslm" target.
>>
>> In this respect, "txtt" and its enhanced version "newtxtt" fonts
>> are more suitable as is described in [1].
>>
>> This commit enables the font choice of cmtt for code snippets in
>> targets "msnt" and "mstx".
>>
>> Help messages in Makefile are updated accordingly.
>>
>> Any feedback on the font choice is welcome.
>>
>> [1] Excerpt from newtxtt documentation:
>>
>>     This package provides an interface to another alternative---the
>>     typewriter fonts provided with txfonts, with some enhancements.
>>     They have the same widths as cmtt, but are taller, heavier,
>>     more geometric and less shapely, with very low contrast, and
>>     are more suited to match Roman fonts of height and weight
>>     approximating that of Times.
>>
>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> 
> Queued and pushed, thank you!
> 
> I did remove some trailing whitespace that this patch added to
> perfbook.tex.  Please let me know if this whitespace was needed for
> some reason.

My bad. And thanks for the fix.

Is there any config option to flag trailing whitespaces at "git add"?

And please try the modified targets and see if you really want to promote
"msnt" as the default font choice.

                                       Thanks, Akira

> 
> 							Thanx, Paul
> 
>> ---
>>  Makefile     | 17 +++++++++++------
>>  perfbook.tex | 13 +++++++++++++
>>  2 files changed, 24 insertions(+), 6 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 2c88e6c..e5f620c 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -110,7 +110,8 @@ perfbook-msns.tex: perfbook.tex
>>  	sed -e 's/\[scaled=\.94\]{couriers}/{courier}/' < $< > $@
>>
>>  perfbook-mstx.tex: perfbook.tex
>> -	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' < $< > $@
>> +	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' \
>> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
>>
>>  perfbook-msr.tex: perfbook.tex
>>  	sed -e 's/\[scaled=\.94\]{couriers}/[scaled=.94]{nimbusmono}/' < $< > $@
>> @@ -121,8 +122,10 @@ perfbook-msn.tex: perfbook.tex
>>  	@echo "## This target requires font package nimbus15. ##"
>>
>>  perfbook-msnt.tex: perfbook.tex
>> -	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' < $< > $@
>> +	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' \
>> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
>>  	@echo "## This target requires font package newtxtt. ##"
>> +	@echo "## If build fails, try target 'mstx' instead. ##"
>>
>>  perfbook-mslm.tex: perfbook.tex
>>  	sed -e 's/%\\usepackage{lmodern}/\\usepackage{lmodern}/' \
>> @@ -181,17 +184,19 @@ help:
>>  	@echo
>>  	@echo "Experimental targets:"
>>  	@echo "  Full,              Abbr."
>> -	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
>> -	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
>> -	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
>>  	@echo "  perfbook-msnt.pdf, msnt: 2c with newtxtt as monospace (non-slashed 0)"
>> +	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
>>  	@echo "  perfbook-mslm.pdf, mslm: 2c with lmtt (Latin Modern Typewriter) as monospace"
>>  	@echo "       (Latin Modern is a clone of Computer Modern with additional type faces)"
>> +	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
>> +	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
>> +
>>  	@echo "  perfbook-1csf.pdf, 1csf: 1c with sans serif font"
>>  	@echo "  perfbook-msns.pdf, msns: 2c with non-scaled courier"
>> +	@echo "  \"msnt\" requires \"newtxtt\". \"mstx\" is fallback target for older TeX env."
>> +	@echo "  \"msnt\" and \"mstx\" use \"cmtt\" font for code snippet."
>>  	@echo "  \"msr\" and \"msn\" require \"nimbus15\"."
>>  	@echo "  \"msn\" doesn't cover bold face for monospace."
>> -	@echo "  \"msnt\" requires \"newtxtt\"."
>>  	@echo "  \"1csf\" requires recent version (>=1.3i) of \"mathastext\"."
>>
>>  clean:
>> diff --git a/perfbook.tex b/perfbook.tex
>> index e8234c4..94f2f4b 100644
>> --- a/perfbook.tex
>> +++ b/perfbook.tex
>> @@ -15,6 +15,7 @@
>>  % Improves the text layout
>>  \usepackage{microtype}
>>  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
>> +\usepackage{etoolbox}
>>
>>  \usepackage{lscape}
>>  \usepackage{epsfig}
>> @@ -64,6 +65,9 @@
>>  \newboolean{sansserif}
>>  \setboolean{sansserif}{false}
>>  \newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}}
>> +\newboolean{cmttforcode}
>> +\setboolean{cmttforcode}{false}
>> +\newcommand{\IfCmttForCode}[2]{\ifthenelse{\boolean{cmttforcode}}{#1}{#2}}
>>
>>  \newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}}
>>
>> @@ -74,6 +78,15 @@
>>  \renewcommand{\path}[1]{\nolinkurl{#1}} % workaround of interference with mathastext
>>  }{}
>>
>> +\IfCmttForCode{
>> +\AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{cmtt}}
>> +\AtBeginEnvironment{verbbox}{\renewcommand{\ttdefault}{cmtt}}
>> +\AtBeginEnvironment{table}{\renewcommand{\ttdefault}{cmtt}}
>> +\AtBeginEnvironment{tabular}{\renewcommand{\ttdefault}{cmtt}}
>> +\AtBeginEnvironment{tabulary}{\renewcommand{\ttdefault}{cmtt}}
>> +\AtBeginEnvironment{minipage}{\renewcommand{\ttdefault}{cmtt}}
>> +}{}
>> +                   
>>  \begin{document}
>>
>>  %%HTMLSKIP
>> -- 
>> 2.7.4
>>
> 
> 


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

* Re: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
  2017-03-21 22:04   ` Akira Yokosawa
@ 2017-03-21 22:41     ` Paul E. McKenney
  2017-03-21 22:54       ` Akira Yokosawa
  0 siblings, 1 reply; 9+ messages in thread
From: Paul E. McKenney @ 2017-03-21 22:41 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Wed, Mar 22, 2017 at 07:04:45AM +0900, Akira Yokosawa wrote:
> On 2017/03/22 3:35, Paul E. McKenney wrote:
> > On Mon, Mar 20, 2017 at 01:58:15PM +0900, Akira Yokosawa wrote:
> >> >From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
> >> From: Akira Yokosawa <akiyks@gmail.com>
> >> Date: Mon, 20 Mar 2017 13:10:38 +0900
> >> Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
> >>
> >> By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
> >> in verbatim, verbbox, table, tabular, tabulary, and minipage
> >> environments, we can improve consistency of looks independent of
> >> monospace font choice for main text. cmtt font is more than suitable
> >> for listing of code snippet and program output.
> >>
> >> However, when mixed used with Times Roman (clone) font, cmtt's
> >> slightly lower x-height than Times Roman, and its similar thickness
> >> as Times Roman, it is not distinctive enough as can be seen in
> >> "mslm" target.
> >>
> >> In this respect, "txtt" and its enhanced version "newtxtt" fonts
> >> are more suitable as is described in [1].
> >>
> >> This commit enables the font choice of cmtt for code snippets in
> >> targets "msnt" and "mstx".
> >>
> >> Help messages in Makefile are updated accordingly.
> >>
> >> Any feedback on the font choice is welcome.
> >>
> >> [1] Excerpt from newtxtt documentation:
> >>
> >>     This package provides an interface to another alternative---the
> >>     typewriter fonts provided with txfonts, with some enhancements.
> >>     They have the same widths as cmtt, but are taller, heavier,
> >>     more geometric and less shapely, with very low contrast, and
> >>     are more suited to match Roman fonts of height and weight
> >>     approximating that of Times.
> >>
> >> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> > 
> > Queued and pushed, thank you!
> > 
> > I did remove some trailing whitespace that this patch added to
> > perfbook.tex.  Please let me know if this whitespace was needed for
> > some reason.
> 
> My bad. And thanks for the fix.
> 
> Is there any config option to flag trailing whitespaces at "git add"?

There is!

You can create a pre-commit hook, which is a script that lives in your
.git/hooks/pre-commit file.  I believe that the default hook checks for
trailing whitespace.  You need to make the script executable.  To make
the commit fail, make the script exit non-zero.  If you want to force the
commit despite the script complaining, give "git commit" the "-n" flag.

It has been years since I set mine up, so I am probably forgetting
something, but there is always:

	https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

> And please try the modified targets and see if you really want to promote
> "msnt" as the default font choice.

Now that you mention it, I get this:

	! LaTeX Error: File `newtxtt.sty' not found.

I downloaded this file from:

	ftp://ftp.dante.de/tex-archive/fonts/newtxtt/tex/newtxtt.sty

and it was much happier.  But I bet that I should put it somewhere
other than in the main perfbook directory, given that I don't want
"git status" to gripe about it forever.  Any advice on location?

One thing I am not all that happy with is that it is hard for me
to distinguish the inline fixed-width font from the normal font.
Or is that the fault of my setup?

						Thanx, Paul

							Thanx, Paul

> >> ---
> >>  Makefile     | 17 +++++++++++------
> >>  perfbook.tex | 13 +++++++++++++
> >>  2 files changed, 24 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/Makefile b/Makefile
> >> index 2c88e6c..e5f620c 100644
> >> --- a/Makefile
> >> +++ b/Makefile
> >> @@ -110,7 +110,8 @@ perfbook-msns.tex: perfbook.tex
> >>  	sed -e 's/\[scaled=\.94\]{couriers}/{courier}/' < $< > $@
> >>
> >>  perfbook-mstx.tex: perfbook.tex
> >> -	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' < $< > $@
> >> +	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' \
> >> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
> >>
> >>  perfbook-msr.tex: perfbook.tex
> >>  	sed -e 's/\[scaled=\.94\]{couriers}/[scaled=.94]{nimbusmono}/' < $< > $@
> >> @@ -121,8 +122,10 @@ perfbook-msn.tex: perfbook.tex
> >>  	@echo "## This target requires font package nimbus15. ##"
> >>
> >>  perfbook-msnt.tex: perfbook.tex
> >> -	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' < $< > $@
> >> +	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' \
> >> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
> >>  	@echo "## This target requires font package newtxtt. ##"
> >> +	@echo "## If build fails, try target 'mstx' instead. ##"
> >>
> >>  perfbook-mslm.tex: perfbook.tex
> >>  	sed -e 's/%\\usepackage{lmodern}/\\usepackage{lmodern}/' \
> >> @@ -181,17 +184,19 @@ help:
> >>  	@echo
> >>  	@echo "Experimental targets:"
> >>  	@echo "  Full,              Abbr."
> >> -	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
> >> -	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
> >> -	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
> >>  	@echo "  perfbook-msnt.pdf, msnt: 2c with newtxtt as monospace (non-slashed 0)"
> >> +	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
> >>  	@echo "  perfbook-mslm.pdf, mslm: 2c with lmtt (Latin Modern Typewriter) as monospace"
> >>  	@echo "       (Latin Modern is a clone of Computer Modern with additional type faces)"
> >> +	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
> >> +	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
> >> +
> >>  	@echo "  perfbook-1csf.pdf, 1csf: 1c with sans serif font"
> >>  	@echo "  perfbook-msns.pdf, msns: 2c with non-scaled courier"
> >> +	@echo "  \"msnt\" requires \"newtxtt\". \"mstx\" is fallback target for older TeX env."
> >> +	@echo "  \"msnt\" and \"mstx\" use \"cmtt\" font for code snippet."
> >>  	@echo "  \"msr\" and \"msn\" require \"nimbus15\"."
> >>  	@echo "  \"msn\" doesn't cover bold face for monospace."
> >> -	@echo "  \"msnt\" requires \"newtxtt\"."
> >>  	@echo "  \"1csf\" requires recent version (>=1.3i) of \"mathastext\"."
> >>
> >>  clean:
> >> diff --git a/perfbook.tex b/perfbook.tex
> >> index e8234c4..94f2f4b 100644
> >> --- a/perfbook.tex
> >> +++ b/perfbook.tex
> >> @@ -15,6 +15,7 @@
> >>  % Improves the text layout
> >>  \usepackage{microtype}
> >>  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
> >> +\usepackage{etoolbox}
> >>
> >>  \usepackage{lscape}
> >>  \usepackage{epsfig}
> >> @@ -64,6 +65,9 @@
> >>  \newboolean{sansserif}
> >>  \setboolean{sansserif}{false}
> >>  \newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}}
> >> +\newboolean{cmttforcode}
> >> +\setboolean{cmttforcode}{false}
> >> +\newcommand{\IfCmttForCode}[2]{\ifthenelse{\boolean{cmttforcode}}{#1}{#2}}
> >>
> >>  \newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}}
> >>
> >> @@ -74,6 +78,15 @@
> >>  \renewcommand{\path}[1]{\nolinkurl{#1}} % workaround of interference with mathastext
> >>  }{}
> >>
> >> +\IfCmttForCode{
> >> +\AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{cmtt}}
> >> +\AtBeginEnvironment{verbbox}{\renewcommand{\ttdefault}{cmtt}}
> >> +\AtBeginEnvironment{table}{\renewcommand{\ttdefault}{cmtt}}
> >> +\AtBeginEnvironment{tabular}{\renewcommand{\ttdefault}{cmtt}}
> >> +\AtBeginEnvironment{tabulary}{\renewcommand{\ttdefault}{cmtt}}
> >> +\AtBeginEnvironment{minipage}{\renewcommand{\ttdefault}{cmtt}}
> >> +}{}
> >> +                   
> >>  \begin{document}
> >>
> >>  %%HTMLSKIP
> >> -- 
> >> 2.7.4
> >>
> > 
> > 
> 


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

* Re: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
  2017-03-21 22:41     ` Paul E. McKenney
@ 2017-03-21 22:54       ` Akira Yokosawa
  2017-03-22 11:05         ` Akira Yokosawa
  0 siblings, 1 reply; 9+ messages in thread
From: Akira Yokosawa @ 2017-03-21 22:54 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook

On 2017/03/21 15:41:20 -0700, Paul E. McKenney wrote:
> On Wed, Mar 22, 2017 at 07:04:45AM +0900, Akira Yokosawa wrote:
>> On 2017/03/22 3:35, Paul E. McKenney wrote:
>>> On Mon, Mar 20, 2017 at 01:58:15PM +0900, Akira Yokosawa wrote:
>>>> >From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
>>>> From: Akira Yokosawa <akiyks@gmail.com>
>>>> Date: Mon, 20 Mar 2017 13:10:38 +0900
>>>> Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
>>>>
>>>> By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
>>>> in verbatim, verbbox, table, tabular, tabulary, and minipage
>>>> environments, we can improve consistency of looks independent of
>>>> monospace font choice for main text. cmtt font is more than suitable
>>>> for listing of code snippet and program output.
>>>>
>>>> However, when mixed used with Times Roman (clone) font, cmtt's
>>>> slightly lower x-height than Times Roman, and its similar thickness
>>>> as Times Roman, it is not distinctive enough as can be seen in
>>>> "mslm" target.
>>>>
>>>> In this respect, "txtt" and its enhanced version "newtxtt" fonts
>>>> are more suitable as is described in [1].
>>>>
>>>> This commit enables the font choice of cmtt for code snippets in
>>>> targets "msnt" and "mstx".
>>>>
>>>> Help messages in Makefile are updated accordingly.
>>>>
>>>> Any feedback on the font choice is welcome.
>>>>
>>>> [1] Excerpt from newtxtt documentation:
>>>>
>>>>     This package provides an interface to another alternative---the
>>>>     typewriter fonts provided with txfonts, with some enhancements.
>>>>     They have the same widths as cmtt, but are taller, heavier,
>>>>     more geometric and less shapely, with very low contrast, and
>>>>     are more suited to match Roman fonts of height and weight
>>>>     approximating that of Times.
>>>>
>>>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
>>>
>>> Queued and pushed, thank you!
>>>
>>> I did remove some trailing whitespace that this patch added to
>>> perfbook.tex.  Please let me know if this whitespace was needed for
>>> some reason.
>>
>> My bad. And thanks for the fix.
>>
>> Is there any config option to flag trailing whitespaces at "git add"?
> 
> There is!
> 
> You can create a pre-commit hook, which is a script that lives in your
> .git/hooks/pre-commit file.  I believe that the default hook checks for
> trailing whitespace.  You need to make the script executable.  To make
> the commit fail, make the script exit non-zero.  If you want to force the
> commit despite the script complaining, give "git commit" the "-n" flag.
> 
> It has been years since I set mine up, so I am probably forgetting
> something, but there is always:
> 
> 	https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

Thanks! I'll try it.

> 
>> And please try the modified targets and see if you really want to promote
>> "msnt" as the default font choice.
> 
> Now that you mention it, I get this:
> 
> 	! LaTeX Error: File `newtxtt.sty' not found.
> 
> I downloaded this file from:
> 
> 	ftp://ftp.dante.de/tex-archive/fonts/newtxtt/tex/newtxtt.sty
> 
> and it was much happier.  But I bet that I should put it somewhere
> other than in the main perfbook directory, given that I don't want
> "git status" to gripe about it forever.  Any advice on location?

I thought you are already on Ubuntu 16.04. TeX Live 2015/Debian package
should have this package. But let me check later.

> 
> One thing I am not all that happy with is that it is hard for me
> to distinguish the inline fixed-width font from the normal font.
> Or is that the fault of my setup?

You might be accustomed to the thinner courier font.
newtxtt font looks thiker than Times Roman, doesn't it?

                                        Thanks, Akira
> 
> 						Thanx, Paul
> 
> 							Thanx, Paul
> 
>>>> ---
>>>>  Makefile     | 17 +++++++++++------
>>>>  perfbook.tex | 13 +++++++++++++
>>>>  2 files changed, 24 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/Makefile b/Makefile
>>>> index 2c88e6c..e5f620c 100644
>>>> --- a/Makefile
>>>> +++ b/Makefile
>>>> @@ -110,7 +110,8 @@ perfbook-msns.tex: perfbook.tex
>>>>  	sed -e 's/\[scaled=\.94\]{couriers}/{courier}/' < $< > $@
>>>>
>>>>  perfbook-mstx.tex: perfbook.tex
>>>> -	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' < $< > $@
>>>> +	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' \
>>>> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
>>>>
>>>>  perfbook-msr.tex: perfbook.tex
>>>>  	sed -e 's/\[scaled=\.94\]{couriers}/[scaled=.94]{nimbusmono}/' < $< > $@
>>>> @@ -121,8 +122,10 @@ perfbook-msn.tex: perfbook.tex
>>>>  	@echo "## This target requires font package nimbus15. ##"
>>>>
>>>>  perfbook-msnt.tex: perfbook.tex
>>>> -	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' < $< > $@
>>>> +	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' \
>>>> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
>>>>  	@echo "## This target requires font package newtxtt. ##"
>>>> +	@echo "## If build fails, try target 'mstx' instead. ##"
>>>>
>>>>  perfbook-mslm.tex: perfbook.tex
>>>>  	sed -e 's/%\\usepackage{lmodern}/\\usepackage{lmodern}/' \
>>>> @@ -181,17 +184,19 @@ help:
>>>>  	@echo
>>>>  	@echo "Experimental targets:"
>>>>  	@echo "  Full,              Abbr."
>>>> -	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
>>>> -	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
>>>> -	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
>>>>  	@echo "  perfbook-msnt.pdf, msnt: 2c with newtxtt as monospace (non-slashed 0)"
>>>> +	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
>>>>  	@echo "  perfbook-mslm.pdf, mslm: 2c with lmtt (Latin Modern Typewriter) as monospace"
>>>>  	@echo "       (Latin Modern is a clone of Computer Modern with additional type faces)"
>>>> +	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
>>>> +	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
>>>> +
>>>>  	@echo "  perfbook-1csf.pdf, 1csf: 1c with sans serif font"
>>>>  	@echo "  perfbook-msns.pdf, msns: 2c with non-scaled courier"
>>>> +	@echo "  \"msnt\" requires \"newtxtt\". \"mstx\" is fallback target for older TeX env."
>>>> +	@echo "  \"msnt\" and \"mstx\" use \"cmtt\" font for code snippet."
>>>>  	@echo "  \"msr\" and \"msn\" require \"nimbus15\"."
>>>>  	@echo "  \"msn\" doesn't cover bold face for monospace."
>>>> -	@echo "  \"msnt\" requires \"newtxtt\"."
>>>>  	@echo "  \"1csf\" requires recent version (>=1.3i) of \"mathastext\"."
>>>>
>>>>  clean:
>>>> diff --git a/perfbook.tex b/perfbook.tex
>>>> index e8234c4..94f2f4b 100644
>>>> --- a/perfbook.tex
>>>> +++ b/perfbook.tex
>>>> @@ -15,6 +15,7 @@
>>>>  % Improves the text layout
>>>>  \usepackage{microtype}
>>>>  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
>>>> +\usepackage{etoolbox}
>>>>
>>>>  \usepackage{lscape}
>>>>  \usepackage{epsfig}
>>>> @@ -64,6 +65,9 @@
>>>>  \newboolean{sansserif}
>>>>  \setboolean{sansserif}{false}
>>>>  \newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}}
>>>> +\newboolean{cmttforcode}
>>>> +\setboolean{cmttforcode}{false}
>>>> +\newcommand{\IfCmttForCode}[2]{\ifthenelse{\boolean{cmttforcode}}{#1}{#2}}
>>>>
>>>>  \newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}}
>>>>
>>>> @@ -74,6 +78,15 @@
>>>>  \renewcommand{\path}[1]{\nolinkurl{#1}} % workaround of interference with mathastext
>>>>  }{}
>>>>
>>>> +\IfCmttForCode{
>>>> +\AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{cmtt}}
>>>> +\AtBeginEnvironment{verbbox}{\renewcommand{\ttdefault}{cmtt}}
>>>> +\AtBeginEnvironment{table}{\renewcommand{\ttdefault}{cmtt}}
>>>> +\AtBeginEnvironment{tabular}{\renewcommand{\ttdefault}{cmtt}}
>>>> +\AtBeginEnvironment{tabulary}{\renewcommand{\ttdefault}{cmtt}}
>>>> +\AtBeginEnvironment{minipage}{\renewcommand{\ttdefault}{cmtt}}
>>>> +}{}
>>>> +                   
>>>>  \begin{document}
>>>>
>>>>  %%HTMLSKIP
>>>> -- 
>>>> 2.7.4
>>>>
>>>
>>>
>>
> 
> 


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

* Re: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
  2017-03-21 22:54       ` Akira Yokosawa
@ 2017-03-22 11:05         ` Akira Yokosawa
  2017-03-23 12:00           ` Akira Yokosawa
  0 siblings, 1 reply; 9+ messages in thread
From: Akira Yokosawa @ 2017-03-22 11:05 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook, Akira Yokosawa

On 2017/03/22 07:54:24 +0900, Akira Yokosawa wrote:
> On 2017/03/21 15:41:20 -0700, Paul E. McKenney wrote:
>> On Wed, Mar 22, 2017 at 07:04:45AM +0900, Akira Yokosawa wrote:
>>> On 2017/03/22 3:35, Paul E. McKenney wrote:
>>>> On Mon, Mar 20, 2017 at 01:58:15PM +0900, Akira Yokosawa wrote:
>>>>> >From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
>>>>> From: Akira Yokosawa <akiyks@gmail.com>
>>>>> Date: Mon, 20 Mar 2017 13:10:38 +0900
>>>>> Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
>>>>>
>>>>> By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
>>>>> in verbatim, verbbox, table, tabular, tabulary, and minipage
>>>>> environments, we can improve consistency of looks independent of
>>>>> monospace font choice for main text. cmtt font is more than suitable
>>>>> for listing of code snippet and program output.
>>>>>
>>>>> However, when mixed used with Times Roman (clone) font, cmtt's
>>>>> slightly lower x-height than Times Roman, and its similar thickness
>>>>> as Times Roman, it is not distinctive enough as can be seen in
>>>>> "mslm" target.
>>>>>
>>>>> In this respect, "txtt" and its enhanced version "newtxtt" fonts
>>>>> are more suitable as is described in [1].
>>>>>
>>>>> This commit enables the font choice of cmtt for code snippets in
>>>>> targets "msnt" and "mstx".
>>>>>
>>>>> Help messages in Makefile are updated accordingly.
>>>>>
>>>>> Any feedback on the font choice is welcome.
>>>>>
>>>>> [1] Excerpt from newtxtt documentation:
>>>>>
>>>>>     This package provides an interface to another alternative---the
>>>>>     typewriter fonts provided with txfonts, with some enhancements.
>>>>>     They have the same widths as cmtt, but are taller, heavier,
>>>>>     more geometric and less shapely, with very low contrast, and
>>>>>     are more suited to match Roman fonts of height and weight
>>>>>     approximating that of Times.
>>>>>
>>>>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
>>>>
>>>> Queued and pushed, thank you!
>>>>
>>>> I did remove some trailing whitespace that this patch added to
>>>> perfbook.tex.  Please let me know if this whitespace was needed for
>>>> some reason.
>>>
>>> My bad. And thanks for the fix.
>>>
>>> Is there any config option to flag trailing whitespaces at "git add"?
>>
>> There is!
>>
>> You can create a pre-commit hook, which is a script that lives in your
>> .git/hooks/pre-commit file.  I believe that the default hook checks for
>> trailing whitespace.  You need to make the script executable.  To make
>> the commit fail, make the script exit non-zero.  If you want to force the
>> commit despite the script complaining, give "git commit" the "-n" flag.
>>
>> It has been years since I set mine up, so I am probably forgetting
>> something, but there is always:
>>
>> 	https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
> 
> Thanks! I'll try it.
> 
>>
>>> And please try the modified targets and see if you really want to promote
>>> "msnt" as the default font choice.
>>
>> Now that you mention it, I get this:
>>
>> 	! LaTeX Error: File `newtxtt.sty' not found.
>>
>> I downloaded this file from:
>>
>> 	ftp://ftp.dante.de/tex-archive/fonts/newtxtt/tex/newtxtt.sty
>>
>> and it was much happier.

Well, font packages do not work properly by placing just .sty files.
You need to get the whole font package if you need to manually install
it on older TeX distribution.

"newtxtt" font package can be downloaded from:

     http://mirrors.ctan.org/install/fonts/newtxtt.tds.zip

The way to manually install a package can be found at:

     http://tex.stackexchange.com/questions/73016/

Method 3 in the answer is your option. (If you really want to do so.)

But you can just try "make mstx" instead. This gives mostly the same
result give or take the shape of "0" (hashed in mstx).

>>                           But I bet that I should put it somewhere
>> other than in the main perfbook directory, given that I don't want
>> "git status" to gripe about it forever.  Any advice on location?
> 
> I thought you are already on Ubuntu 16.04. TeX Live 2015/Debian package
> should have this package. But let me check later.

On Ubuntu 16.04, installing texlive-fonts-extra should be enough.

Hope this helps.

                                        Thanks, Akira

> 
>>
>> One thing I am not all that happy with is that it is hard for me
>> to distinguish the inline fixed-width font from the normal font.
>> Or is that the fault of my setup?
> 
> You might be accustomed to the thinner courier font.
> newtxtt font looks thiker than Times Roman, doesn't it?
> 
>                                         Thanks, Akira
>>
>> 						Thanx, Paul
>>
>> 							Thanx, Paul
>>
>>>>> ---
>>>>>  Makefile     | 17 +++++++++++------
>>>>>  perfbook.tex | 13 +++++++++++++
>>>>>  2 files changed, 24 insertions(+), 6 deletions(-)
>>>>>
>>>>> diff --git a/Makefile b/Makefile
>>>>> index 2c88e6c..e5f620c 100644
>>>>> --- a/Makefile
>>>>> +++ b/Makefile
>>>>> @@ -110,7 +110,8 @@ perfbook-msns.tex: perfbook.tex
>>>>>  	sed -e 's/\[scaled=\.94\]{couriers}/{courier}/' < $< > $@
>>>>>
>>>>>  perfbook-mstx.tex: perfbook.tex
>>>>> -	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' < $< > $@
>>>>> +	sed -e 's/usepackage\[scaled=\.94\]{couriers}/renewcommand*\\ttdefault{txtt}/' \
>>>>> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
>>>>>
>>>>>  perfbook-msr.tex: perfbook.tex
>>>>>  	sed -e 's/\[scaled=\.94\]{couriers}/[scaled=.94]{nimbusmono}/' < $< > $@
>>>>> @@ -121,8 +122,10 @@ perfbook-msn.tex: perfbook.tex
>>>>>  	@echo "## This target requires font package nimbus15. ##"
>>>>>
>>>>>  perfbook-msnt.tex: perfbook.tex
>>>>> -	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' < $< > $@
>>>>> +	sed -e 's/\[scaled=\.94\]{couriers}/[zerostyle=a]{newtxtt}/' \
>>>>> +	    -e 's/setboolean{cmttforcode}{false}/setboolean{cmttforcode}{true}/' < $< > $@
>>>>>  	@echo "## This target requires font package newtxtt. ##"
>>>>> +	@echo "## If build fails, try target 'mstx' instead. ##"
>>>>>
>>>>>  perfbook-mslm.tex: perfbook.tex
>>>>>  	sed -e 's/%\\usepackage{lmodern}/\\usepackage{lmodern}/' \
>>>>> @@ -181,17 +184,19 @@ help:
>>>>>  	@echo
>>>>>  	@echo "Experimental targets:"
>>>>>  	@echo "  Full,              Abbr."
>>>>> -	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
>>>>> -	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
>>>>> -	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
>>>>>  	@echo "  perfbook-msnt.pdf, msnt: 2c with newtxtt as monospace (non-slashed 0)"
>>>>> +	@echo "  perfbook-mstx.pdf, mstx: 2c with txtt as monospace"
>>>>>  	@echo "  perfbook-mslm.pdf, mslm: 2c with lmtt (Latin Modern Typewriter) as monospace"
>>>>>  	@echo "       (Latin Modern is a clone of Computer Modern with additional type faces)"
>>>>> +	@echo "  perfbook-msr.pdf,  msr:  2c with regular thickness courier clone"
>>>>> +	@echo "  perfbook-msn.pdf,  msn:  2c with narrow courier clone"
>>>>> +
>>>>>  	@echo "  perfbook-1csf.pdf, 1csf: 1c with sans serif font"
>>>>>  	@echo "  perfbook-msns.pdf, msns: 2c with non-scaled courier"
>>>>> +	@echo "  \"msnt\" requires \"newtxtt\". \"mstx\" is fallback target for older TeX env."
>>>>> +	@echo "  \"msnt\" and \"mstx\" use \"cmtt\" font for code snippet."
>>>>>  	@echo "  \"msr\" and \"msn\" require \"nimbus15\"."
>>>>>  	@echo "  \"msn\" doesn't cover bold face for monospace."
>>>>> -	@echo "  \"msnt\" requires \"newtxtt\"."
>>>>>  	@echo "  \"1csf\" requires recent version (>=1.3i) of \"mathastext\"."
>>>>>
>>>>>  clean:
>>>>> diff --git a/perfbook.tex b/perfbook.tex
>>>>> index e8234c4..94f2f4b 100644
>>>>> --- a/perfbook.tex
>>>>> +++ b/perfbook.tex
>>>>> @@ -15,6 +15,7 @@
>>>>>  % Improves the text layout
>>>>>  \usepackage{microtype}
>>>>>  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
>>>>> +\usepackage{etoolbox}
>>>>>
>>>>>  \usepackage{lscape}
>>>>>  \usepackage{epsfig}
>>>>> @@ -64,6 +65,9 @@
>>>>>  \newboolean{sansserif}
>>>>>  \setboolean{sansserif}{false}
>>>>>  \newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}}
>>>>> +\newboolean{cmttforcode}
>>>>> +\setboolean{cmttforcode}{false}
>>>>> +\newcommand{\IfCmttForCode}[2]{\ifthenelse{\boolean{cmttforcode}}{#1}{#2}}
>>>>>
>>>>>  \newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}}
>>>>>
>>>>> @@ -74,6 +78,15 @@
>>>>>  \renewcommand{\path}[1]{\nolinkurl{#1}} % workaround of interference with mathastext
>>>>>  }{}
>>>>>
>>>>> +\IfCmttForCode{
>>>>> +\AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{cmtt}}
>>>>> +\AtBeginEnvironment{verbbox}{\renewcommand{\ttdefault}{cmtt}}
>>>>> +\AtBeginEnvironment{table}{\renewcommand{\ttdefault}{cmtt}}
>>>>> +\AtBeginEnvironment{tabular}{\renewcommand{\ttdefault}{cmtt}}
>>>>> +\AtBeginEnvironment{tabulary}{\renewcommand{\ttdefault}{cmtt}}
>>>>> +\AtBeginEnvironment{minipage}{\renewcommand{\ttdefault}{cmtt}}
>>>>> +}{}
>>>>> +                   
>>>>>  \begin{document}
>>>>>
>>>>>  %%HTMLSKIP
>>>>> -- 
>>>>> 2.7.4
>>>>>
>>>>
>>>>
>>>
>>
>>


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

* Re: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
  2017-03-22 11:05         ` Akira Yokosawa
@ 2017-03-23 12:00           ` Akira Yokosawa
  2017-03-23 12:50             ` Paul E. McKenney
  0 siblings, 1 reply; 9+ messages in thread
From: Akira Yokosawa @ 2017-03-23 12:00 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook, Akira Yokosawa

On 2017/03/22 20:05:36 +0900, Akira Yokosawa wrote:
> On 2017/03/22 07:54:24 +0900, Akira Yokosawa wrote:
>> On 2017/03/21 15:41:20 -0700, Paul E. McKenney wrote:
>>> On Wed, Mar 22, 2017 at 07:04:45AM +0900, Akira Yokosawa wrote:
>>>> On 2017/03/22 3:35, Paul E. McKenney wrote:
>>>>> On Mon, Mar 20, 2017 at 01:58:15PM +0900, Akira Yokosawa wrote:
>>>>>> >From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
>>>>>> From: Akira Yokosawa <akiyks@gmail.com>
>>>>>> Date: Mon, 20 Mar 2017 13:10:38 +0900
>>>>>> Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
>>>>>>
>>>>>> By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
>>>>>> in verbatim, verbbox, table, tabular, tabulary, and minipage
>>>>>> environments, we can improve consistency of looks independent of
>>>>>> monospace font choice for main text. cmtt font is more than suitable
>>>>>> for listing of code snippet and program output.
>>>>>>
>>>>>> However, when mixed used with Times Roman (clone) font, cmtt's
>>>>>> slightly lower x-height than Times Roman, and its similar thickness
>>>>>> as Times Roman, it is not distinctive enough as can be seen in
>>>>>> "mslm" target.
>>>>>>
>>>>>> In this respect, "txtt" and its enhanced version "newtxtt" fonts
>>>>>> are more suitable as is described in [1].
>>>>>>
>>>>>> This commit enables the font choice of cmtt for code snippets in
>>>>>> targets "msnt" and "mstx".
>>>>>>
>>>>>> Help messages in Makefile are updated accordingly.
>>>>>>
>>>>>> Any feedback on the font choice is welcome.
>>>>>>
>>>>>> [1] Excerpt from newtxtt documentation:
>>>>>>
>>>>>>     This package provides an interface to another alternative---the
>>>>>>     typewriter fonts provided with txfonts, with some enhancements.
>>>>>>     They have the same widths as cmtt, but are taller, heavier,
>>>>>>     more geometric and less shapely, with very low contrast, and
>>>>>>     are more suited to match Roman fonts of height and weight
>>>>>>     approximating that of Times.
>>>>>>
>>>>>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
>>>>>
>>>>> Queued and pushed, thank you!
>>>>>
>>>>> I did remove some trailing whitespace that this patch added to
>>>>> perfbook.tex.  Please let me know if this whitespace was needed for
>>>>> some reason.
>>>>
>>>> My bad. And thanks for the fix.
>>>>
>>>> Is there any config option to flag trailing whitespaces at "git add"?
>>>
>>> There is!
>>>
>>> You can create a pre-commit hook, which is a script that lives in your
>>> .git/hooks/pre-commit file.  I believe that the default hook checks for
>>> trailing whitespace.  You need to make the script executable.  To make
>>> the commit fail, make the script exit non-zero.  If you want to force the
>>> commit despite the script complaining, give "git commit" the "-n" flag.
>>>
>>> It has been years since I set mine up, so I am probably forgetting
>>> something, but there is always:
>>>
>>> 	https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
>>
>> Thanks! I'll try it.
>>
>>>
>>>> And please try the modified targets and see if you really want to promote
>>>> "msnt" as the default font choice.
>>>
>>> Now that you mention it, I get this:
>>>
>>> 	! LaTeX Error: File `newtxtt.sty' not found.
>>>
>>> I downloaded this file from:
>>>
>>> 	ftp://ftp.dante.de/tex-archive/fonts/newtxtt/tex/newtxtt.sty
>>>
>>> and it was much happier.
> 
> Well, font packages do not work properly by placing just .sty files.
> You need to get the whole font package if you need to manually install
> it on older TeX distribution.
> 
> "newtxtt" font package can be downloaded from:
> 
>      http://mirrors.ctan.org/install/fonts/newtxtt.tds.zip
> 
> The way to manually install a package can be found at:
> 
>      http://tex.stackexchange.com/questions/73016/
> 
> Method 3 in the answer is your option. (If you really want to do so.)

Oops, for font packages, you also need to update font-map database. See:

      http://tex.stackexchange.com/questions/88423/

I'll prepare a patch to update FAQ-BUILD.txt regarding this issue.

But "msnt" as default seems premature.
"mslm" would be a moderate option for default. Thoughts?

                                    Thanks, Akira

> 
> But you can just try "make mstx" instead. This gives mostly the same
> result give or take the shape of "0" (hashed in mstx).
> 
>>>                           But I bet that I should put it somewhere
>>> other than in the main perfbook directory, given that I don't want
>>> "git status" to gripe about it forever.  Any advice on location?
>>
>> I thought you are already on Ubuntu 16.04. TeX Live 2015/Debian package
>> should have this package. But let me check later.
> 
> On Ubuntu 16.04, installing texlive-fonts-extra should be enough.
> 
> Hope this helps.
> 
>                                         Thanks, Akira
> 
>>
>>>
>>> One thing I am not all that happy with is that it is hard for me
>>> to distinguish the inline fixed-width font from the normal font.
>>> Or is that the fault of my setup?
>>
>> You might be accustomed to the thinner courier font.
>> newtxtt font looks thiker than Times Roman, doesn't it?
>>
>>                                         Thanks, Akira
>>>
>>> 						Thanx, Paul
>>>
>>> 							Thanx, Paul
>>>
[snip]


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

* Re: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
  2017-03-23 12:00           ` Akira Yokosawa
@ 2017-03-23 12:50             ` Paul E. McKenney
  2017-03-23 13:57               ` Akira Yokosawa
  0 siblings, 1 reply; 9+ messages in thread
From: Paul E. McKenney @ 2017-03-23 12:50 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Thu, Mar 23, 2017 at 09:00:00PM +0900, Akira Yokosawa wrote:
> On 2017/03/22 20:05:36 +0900, Akira Yokosawa wrote:
> > On 2017/03/22 07:54:24 +0900, Akira Yokosawa wrote:
> >> On 2017/03/21 15:41:20 -0700, Paul E. McKenney wrote:
> >>> On Wed, Mar 22, 2017 at 07:04:45AM +0900, Akira Yokosawa wrote:
> >>>> On 2017/03/22 3:35, Paul E. McKenney wrote:
> >>>>> On Mon, Mar 20, 2017 at 01:58:15PM +0900, Akira Yokosawa wrote:
> >>>>>> >From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
> >>>>>> From: Akira Yokosawa <akiyks@gmail.com>
> >>>>>> Date: Mon, 20 Mar 2017 13:10:38 +0900
> >>>>>> Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
> >>>>>>
> >>>>>> By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
> >>>>>> in verbatim, verbbox, table, tabular, tabulary, and minipage
> >>>>>> environments, we can improve consistency of looks independent of
> >>>>>> monospace font choice for main text. cmtt font is more than suitable
> >>>>>> for listing of code snippet and program output.
> >>>>>>
> >>>>>> However, when mixed used with Times Roman (clone) font, cmtt's
> >>>>>> slightly lower x-height than Times Roman, and its similar thickness
> >>>>>> as Times Roman, it is not distinctive enough as can be seen in
> >>>>>> "mslm" target.
> >>>>>>
> >>>>>> In this respect, "txtt" and its enhanced version "newtxtt" fonts
> >>>>>> are more suitable as is described in [1].
> >>>>>>
> >>>>>> This commit enables the font choice of cmtt for code snippets in
> >>>>>> targets "msnt" and "mstx".
> >>>>>>
> >>>>>> Help messages in Makefile are updated accordingly.
> >>>>>>
> >>>>>> Any feedback on the font choice is welcome.
> >>>>>>
> >>>>>> [1] Excerpt from newtxtt documentation:
> >>>>>>
> >>>>>>     This package provides an interface to another alternative---the
> >>>>>>     typewriter fonts provided with txfonts, with some enhancements.
> >>>>>>     They have the same widths as cmtt, but are taller, heavier,
> >>>>>>     more geometric and less shapely, with very low contrast, and
> >>>>>>     are more suited to match Roman fonts of height and weight
> >>>>>>     approximating that of Times.
> >>>>>>
> >>>>>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> >>>>>
> >>>>> Queued and pushed, thank you!
> >>>>>
> >>>>> I did remove some trailing whitespace that this patch added to
> >>>>> perfbook.tex.  Please let me know if this whitespace was needed for
> >>>>> some reason.
> >>>>
> >>>> My bad. And thanks for the fix.
> >>>>
> >>>> Is there any config option to flag trailing whitespaces at "git add"?
> >>>
> >>> There is!
> >>>
> >>> You can create a pre-commit hook, which is a script that lives in your
> >>> .git/hooks/pre-commit file.  I believe that the default hook checks for
> >>> trailing whitespace.  You need to make the script executable.  To make
> >>> the commit fail, make the script exit non-zero.  If you want to force the
> >>> commit despite the script complaining, give "git commit" the "-n" flag.
> >>>
> >>> It has been years since I set mine up, so I am probably forgetting
> >>> something, but there is always:
> >>>
> >>> 	https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
> >>
> >> Thanks! I'll try it.
> >>
> >>>
> >>>> And please try the modified targets and see if you really want to promote
> >>>> "msnt" as the default font choice.
> >>>
> >>> Now that you mention it, I get this:
> >>>
> >>> 	! LaTeX Error: File `newtxtt.sty' not found.
> >>>
> >>> I downloaded this file from:
> >>>
> >>> 	ftp://ftp.dante.de/tex-archive/fonts/newtxtt/tex/newtxtt.sty
> >>>
> >>> and it was much happier.
> > 
> > Well, font packages do not work properly by placing just .sty files.
> > You need to get the whole font package if you need to manually install
> > it on older TeX distribution.
> > 
> > "newtxtt" font package can be downloaded from:
> > 
> >      http://mirrors.ctan.org/install/fonts/newtxtt.tds.zip
> > 
> > The way to manually install a package can be found at:
> > 
> >      http://tex.stackexchange.com/questions/73016/
> > 
> > Method 3 in the answer is your option. (If you really want to do so.)
> 
> Oops, for font packages, you also need to update font-map database. See:
> 
>       http://tex.stackexchange.com/questions/88423/
> 
> I'll prepare a patch to update FAQ-BUILD.txt regarding this issue.
> 
> But "msnt" as default seems premature.
> "mslm" would be a moderate option for default. Thoughts?

Agreed -- I cannot be the only one still on 14.04.  And you are right,
I have been intending to move to 16.04 for the better part of a year
now.  :-/

							Thanx, Paul

>                                     Thanks, Akira
> 
> > 
> > But you can just try "make mstx" instead. This gives mostly the same
> > result give or take the shape of "0" (hashed in mstx).
> > 
> >>>                           But I bet that I should put it somewhere
> >>> other than in the main perfbook directory, given that I don't want
> >>> "git status" to gripe about it forever.  Any advice on location?
> >>
> >> I thought you are already on Ubuntu 16.04. TeX Live 2015/Debian package
> >> should have this package. But let me check later.
> > 
> > On Ubuntu 16.04, installing texlive-fonts-extra should be enough.
> > 
> > Hope this helps.
> > 
> >                                         Thanks, Akira
> > 
> >>
> >>>
> >>> One thing I am not all that happy with is that it is hard for me
> >>> to distinguish the inline fixed-width font from the normal font.
> >>> Or is that the fault of my setup?
> >>
> >> You might be accustomed to the thinner courier font.
> >> newtxtt font looks thiker than Times Roman, doesn't it?
> >>
> >>                                         Thanks, Akira
> >>>
> >>> 						Thanx, Paul
> >>>
> >>> 							Thanx, Paul
> >>>
> [snip]
> 


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

* Re: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
  2017-03-23 12:50             ` Paul E. McKenney
@ 2017-03-23 13:57               ` Akira Yokosawa
  0 siblings, 0 replies; 9+ messages in thread
From: Akira Yokosawa @ 2017-03-23 13:57 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook, Akira Yokosawa

On 2017/03/23 05:50:13 -0700, Paul E. McKenney wrote:
> On Thu, Mar 23, 2017 at 09:00:00PM +0900, Akira Yokosawa wrote:
>> On 2017/03/22 20:05:36 +0900, Akira Yokosawa wrote:
>>> On 2017/03/22 07:54:24 +0900, Akira Yokosawa wrote:
>>>> On 2017/03/21 15:41:20 -0700, Paul E. McKenney wrote:
>>>>> On Wed, Mar 22, 2017 at 07:04:45AM +0900, Akira Yokosawa wrote:
>>>>>> On 2017/03/22 3:35, Paul E. McKenney wrote:
>>>>>>> On Mon, Mar 20, 2017 at 01:58:15PM +0900, Akira Yokosawa wrote:
>>>>>>>> >From 25fb5aea63049454a5df2c923dac59285fe40720 Mon Sep 17 00:00:00 2001
>>>>>>>> From: Akira Yokosawa <akiyks@gmail.com>
>>>>>>>> Date: Mon, 20 Mar 2017 13:10:38 +0900
>>>>>>>> Subject: [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx'
>>>>>>>>
>>>>>>>> By specifying "cmtt" (Computer Modern Teletype) font as \ttdefault
>>>>>>>> in verbatim, verbbox, table, tabular, tabulary, and minipage
>>>>>>>> environments, we can improve consistency of looks independent of
>>>>>>>> monospace font choice for main text. cmtt font is more than suitable
>>>>>>>> for listing of code snippet and program output.
>>>>>>>>
>>>>>>>> However, when mixed used with Times Roman (clone) font, cmtt's
>>>>>>>> slightly lower x-height than Times Roman, and its similar thickness
>>>>>>>> as Times Roman, it is not distinctive enough as can be seen in
>>>>>>>> "mslm" target.
>>>>>>>>
>>>>>>>> In this respect, "txtt" and its enhanced version "newtxtt" fonts
>>>>>>>> are more suitable as is described in [1].
>>>>>>>>
>>>>>>>> This commit enables the font choice of cmtt for code snippets in
>>>>>>>> targets "msnt" and "mstx".
>>>>>>>>
>>>>>>>> Help messages in Makefile are updated accordingly.
>>>>>>>>
>>>>>>>> Any feedback on the font choice is welcome.
>>>>>>>>
>>>>>>>> [1] Excerpt from newtxtt documentation:
>>>>>>>>
>>>>>>>>     This package provides an interface to another alternative---the
>>>>>>>>     typewriter fonts provided with txfonts, with some enhancements.
>>>>>>>>     They have the same widths as cmtt, but are taller, heavier,
>>>>>>>>     more geometric and less shapely, with very low contrast, and
>>>>>>>>     are more suited to match Roman fonts of height and weight
>>>>>>>>     approximating that of Times.
>>>>>>>>
>>>>>>>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
>>>>>>>
>>>>>>> Queued and pushed, thank you!
>>>>>>>
>>>>>>> I did remove some trailing whitespace that this patch added to
>>>>>>> perfbook.tex.  Please let me know if this whitespace was needed for
>>>>>>> some reason.
>>>>>>
>>>>>> My bad. And thanks for the fix.
>>>>>>
>>>>>> Is there any config option to flag trailing whitespaces at "git add"?
>>>>>
>>>>> There is!
>>>>>
>>>>> You can create a pre-commit hook, which is a script that lives in your
>>>>> .git/hooks/pre-commit file.  I believe that the default hook checks for
>>>>> trailing whitespace.  You need to make the script executable.  To make
>>>>> the commit fail, make the script exit non-zero.  If you want to force the
>>>>> commit despite the script complaining, give "git commit" the "-n" flag.
>>>>>
>>>>> It has been years since I set mine up, so I am probably forgetting
>>>>> something, but there is always:
>>>>>
>>>>> 	https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
>>>>
>>>> Thanks! I'll try it.
>>>>
>>>>>
>>>>>> And please try the modified targets and see if you really want to promote
>>>>>> "msnt" as the default font choice.
>>>>>
>>>>> Now that you mention it, I get this:
>>>>>
>>>>> 	! LaTeX Error: File `newtxtt.sty' not found.
>>>>>
>>>>> I downloaded this file from:
>>>>>
>>>>> 	ftp://ftp.dante.de/tex-archive/fonts/newtxtt/tex/newtxtt.sty
>>>>>
>>>>> and it was much happier.
>>>
>>> Well, font packages do not work properly by placing just .sty files.
>>> You need to get the whole font package if you need to manually install
>>> it on older TeX distribution.
>>>
>>> "newtxtt" font package can be downloaded from:
>>>
>>>      http://mirrors.ctan.org/install/fonts/newtxtt.tds.zip
>>>
>>> The way to manually install a package can be found at:
>>>
>>>      http://tex.stackexchange.com/questions/73016/
>>>
>>> Method 3 in the answer is your option. (If you really want to do so.)
>>
>> Oops, for font packages, you also need to update font-map database. See:
>>
>>       http://tex.stackexchange.com/questions/88423/
>>
>> I'll prepare a patch to update FAQ-BUILD.txt regarding this issue.
>>
>> But "msnt" as default seems premature.
>> "mslm" would be a moderate option for default. Thoughts?
> 
> Agreed -- I cannot be the only one still on 14.04.  And you are right,
> I have been intending to move to 16.04 for the better part of a year
> now.  :-/

So, I'll prepare a patch to promote "mslm" for official targets (2c, 1c, hb).
For other targets, "cmtt" font will be used for code snippets.
Current default will be kept as target "mss" (as before), and
it will still use "couriers" for code snippets.

                                     Thanks, Akira

> 
> 							Thanx, Paul
> 
>>                                     Thanks, Akira
>>
>>>
>>> But you can just try "make mstx" instead. This gives mostly the same
>>> result give or take the shape of "0" (hashed in mstx).
>>>
>>>>>                           But I bet that I should put it somewhere
>>>>> other than in the main perfbook directory, given that I don't want
>>>>> "git status" to gripe about it forever.  Any advice on location?
>>>>
>>>> I thought you are already on Ubuntu 16.04. TeX Live 2015/Debian package
>>>> should have this package. But let me check later.
>>>
>>> On Ubuntu 16.04, installing texlive-fonts-extra should be enough.
>>>
>>> Hope this helps.
>>>
>>>                                         Thanks, Akira
>>>
>>>>
>>>>>
>>>>> One thing I am not all that happy with is that it is hard for me
>>>>> to distinguish the inline fixed-width font from the normal font.
>>>>> Or is that the fault of my setup?
>>>>
>>>> You might be accustomed to the thinner courier font.
>>>> newtxtt font looks thiker than Times Roman, doesn't it?
>>>>
>>>>                                         Thanks, Akira
>>>>>
>>>>> 						Thanx, Paul
>>>>>
>>>>> 							Thanx, Paul
>>>>>
>> [snip]
>>
> 
> 


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

end of thread, other threads:[~2017-03-23 13:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20  4:58 [PATCH] Choose 'cmtt' font for code snippets in targets 'msnt' and 'mstx' Akira Yokosawa
2017-03-21 18:35 ` Paul E. McKenney
2017-03-21 22:04   ` Akira Yokosawa
2017-03-21 22:41     ` Paul E. McKenney
2017-03-21 22:54       ` Akira Yokosawa
2017-03-22 11:05         ` Akira Yokosawa
2017-03-23 12:00           ` Akira Yokosawa
2017-03-23 12:50             ` Paul E. McKenney
2017-03-23 13:57               ` Akira Yokosawa

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.