Fix pdflatex ToC
From df15e226d96614ffbdedfd517f8a6d7afc1c0fee Mon Sep 17 00:00:00 2001
From: Balbir singh <[email protected]>
Date: Sun, 15 Sep 2019 21:14:53 +1000
Subject: [PATCH] Make hyperlinks colorful and a browsable pdf TOC
Without these changes the the PDF does not provide a browsable TOC to choose for navigation, also add a bit of color to the links to make them screen friendly.
Also add synctex=-1 to prevent pdf readers like
evince from complaining to the pdflatex command
line
--- perfbook.tex | 1 + utilities/runfirstlatex.sh | 2 +- utilities/runlatex.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
perfbook.tex +1 -0
@@ -70,6 +70,7 @@ \usepackage{multirow} \usepackage{noindentafter} \NoIndentAfterCmd{\epigraph} +\hypersetup{pdftex, colorlinks=true, allcolors=blue} % custom packages
utilities/runfirstlatex.sh +1 -1
@@ -40,7 +40,7 @@ fi basename=`echo $1 | sed -e 's/\.tex$//'` echo "pdflatex 1 for $basename.pdf" -pdflatex $basename > /dev/null 2>&1 < /dev/null || : +pdflatex --synctex=-1 $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.log
utilities/runlatex.sh +1 -1
@@ -51,7 +51,7 @@ identical_warnings () { } iterate_latex () { - pdflatex $basename > /dev/null 2>&1 < /dev/null || : + pdflatex --synctex=-1 $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.log
Signature · 1 line
2.20.1
(CC to Paul's current address)
Hi Balbir,
Quoted 9 lines · Balbir Singh
From
df15e226d96614ffbdedfd517f8a6d7afc1c0feeMon Sep 17 00:00:00 2001
From: Balbir singh <[email protected]>
Date: Sun, 15 Sep 2019 21:14:53 +1000
Subject: [PATCH] Make hyperlinks colorful and a browsable pdf TOCWithout these changes the the PDF does not provide a browsable TOC to choose for navigation, also add a bit of color to the links to make them screen friendly.
Well, it may not be obvious, but hyperlinks have been there in the TOC. You mean you want them colored blue?
For TOC, they may be OK.
But I'm afraid that to color all the hyperlinks in the whole textbook could be too aggressive, as can be seen for example in Section 5.2.4 (below Listing 5.5). Frequent colored line numbers can look too fancy/noisy for some people.
Does adding an experimental target to make hyperlinks colored work with you (similar to -1csf, -msnt, and the like)? If so, which layout do you prefer, 1c or 2c?
Quoted 4 lines
Also add synctex=-1 to prevent pdf readers like
evince from complaining to the pdflatex command
line
As for SyncTeX support, how about the approach in the patch below?
Thanks, Akira
Quoted 3 lines
Signed-off-by Balbir singh <[email protected]>---
-----8<-------------------------------
From 6a509df0aef50309d8ec1ae5e709b7cee29df3ad Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 16 Sep 2019 18:20:05 +0900
Subject: [PATCH] Add optional flag 'LATEX_OPT' in run{first}latex.sh
Balbir reported that SyncTeX-aware viewers complain in opening perfbook.pdf [1].
Instead of always generating .synctex{.gz} files, add an optional flag to pdflatex commands in run{first}latex.sh scripts.
.synctex files can be generated by defining an environment variable "LATEX_OPT", e.g.:
$ export LATEX_OPT="--synctex=-1"
, and run "make".
Update .gitignore and "claen" in Makefile as well to ignore/remove SyncTeX files.
[1]: https://www.spinics.net/lists/perfbook/msg02350.html
--- .gitignore | 1 + Makefile | 1 + utilities/runfirstlatex.sh | 2 +- utilities/runlatex.sh | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-)
.gitignore +1 -0
@@ -20,6 +20,7 @@ *.ltms *.pdfp *.pdfq +*.synctex* perfbook_flat.tex qqz.tex contrib.tex
Makefile +1 -0
@@ -350,6 +350,7 @@ clean: rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex rm -f $(LATEXGENERATED) rm -f CodeSamples/snippets.d + rm -f *.synctex* @rm -f $(OBSOLETE_FILES) distclean: clean
utilities/runfirstlatex.sh +1 -1
@@ -40,7 +40,7 @@ fi basename=`echo $1 | sed -e 's/\.tex$//'` echo "pdflatex 1 for $basename.pdf" -pdflatex $basename > /dev/null 2>&1 < /dev/null || : +pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.log
utilities/runlatex.sh +1 -1
@@ -51,7 +51,7 @@ identical_warnings () { } iterate_latex () { - pdflatex $basename > /dev/null 2>&1 < /dev/null || : + pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.log
Signature · 1 line
2.17.1
Quoted 10 lines · Akira Yokosawa
(CC to Paul's current address)
Hi Balbir,Quoted 5 lines · Balbir Singh
From
df15e226d96614ffbdedfd517f8a6d7afc1c0feeMon Sep 17 00:00:00 2001
From: Balbir singh <[email protected]>
Date: Sun, 15 Sep 2019 21:14:53 +1000
Subject: [PATCH] Make hyperlinks colorful and a browsable pdf TOC
Quoted 8 lines
Quoted 4 lines
Without these changes the the PDF does not provide a browsable TOC to choose for navigation, also add a bit of color to the links to make them screen friendly.
Well, it may not be obvious, but hyperlinks have been there in the TOC. You mean you want them colored blue?
Yes, but they've been a bit hidden (largely bold text between section headings and references, I have to move my mouse to get know if it is a hyperlink)
Quoted 7 lines
For TOC, they may be OK.
But I'm afraid that to color all the hyperlinks in the whole textbook could be too aggressive, as can be seen for example in Section 5.2.4 (below Listing 5.5). Frequent colored line numbers can look too fancy/noisy for some people.
I see what you mean, how about a gentler color like gray, but I am not 100% sure how that would look in print.
Quoted 4 lines
Does adding an experimental target to make hyperlinks colored work with you (similar to -1csf, -msnt, and the like)? If so, which layout do you prefer, 1c or 2c?
I prefer 1c, but I think the print will always be 2c for saving paper. But please
bear in mind, adding too many targets makes it confusing when Paul tries to release this to the world, no? I am OK skipping colors to keep the PDF uniform
Quoted 8 lines
Quoted 4 lines
Also add synctex=-1 to prevent pdf readers like
evince from complaining to the pdflatex command
lineAs for SyncTeX support, how about the approach in the patch below?
Yep that work!
Balbir Singh.
Quoted 92 lines
Thanks, Akira
Quoted 3 lines
Signed-off-by Balbir singh <[email protected]>---
-----8<-------------------------------
From6a509df0aef50309d8ec1ae5e709b7cee29df3adMon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 16 Sep 2019 18:20:05 +0900
Subject: [PATCH] Add optional flag 'LATEX_OPT' in run{first}latex.shBalbir reported that SyncTeX-aware viewers complain in opening perfbook.pdf [1].
Instead of always generating .synctex{.gz} files, add an optional flag to pdflatex commands in run{first}latex.sh scripts.
.synctex files can be generated by defining an environment variable "
LATEX_OPT", e.g.:$ export LATEX_OPT="--synctex=-1", and run "make".
Update .gitignore and "claen" in
Makefileas well to ignore/remove SyncTeX files.[1]: https://www.spinics.net/lists/perfbook/msg02350.html
Reported-by Balbir Singh <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- .gitignore | 1 + Makefile | 1 + utilities/runfirstlatex.sh | 2 +- utilities/runlatex.sh | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-).gitignore +1
-0@@ -20,6 +20,7 @@ *.ltms *.pdfp *.pdfq +*.synctex* perfbook_flat.tex qqz.tex contrib.texMakefile +1
-0@@ -350,6 +350,7 @@ clean: rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex rm -f $(LATEXGENERATED) rm -f CodeSamples/snippets.d + rm -f *.synctex* @rm -f $(OBSOLETE_FILES) distclean: cleanutilities/runfirstlatex.sh +1
-1@@ -40,7 +40,7 @@ fi basename=`echo $1 | sed -e 's/\.tex$//'` echo "pdflatex 1 for $basename.pdf" -pdflatex $basename > /dev/null 2>&1 < /dev/null || : +pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.logutilities/runlatex.sh +1
-2@@ -51,7 +51,7 @@ identical_warnings () { } iterate_latex () { - pdflatex $basename > /dev/null 2>&1 < /dev/null || : + pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.log --2.17.1
Quoted 25 lines · Balbir Singh
Quoted 10 lines · Akira Yokosawa
(CC to Paul's current address)
Hi Balbir,Quoted 5 lines · Balbir Singh
From
df15e226d96614ffbdedfd517f8a6d7afc1c0feeMon Sep 17 00:00:00 2001
From: Balbir singh <[email protected]>
Date: Sun, 15 Sep 2019 21:14:53 +1000
Subject: [PATCH] Make hyperlinks colorful and a browsable pdf TOCQuoted 8 lines
Quoted 4 lines
Without these changes the the PDF does not provide a browsable TOC to choose for navigation, also add a bit of color to the links to make them screen friendly.
Well, it may not be obvious, but hyperlinks have been there in the TOC. You mean you want them colored blue?
Yes, but they've been a bit hidden (largely bold text between section headings and references, I have to move my mouse to get know if it is a hyperlink)
Quoted 2 lines
For TOC, they may be OK.
Quoted 8 lines
Quoted 5 lines
But I'm afraid that to color all the hyperlinks in the whole textbook could be too aggressive, as can be seen for example in Section 5.2.4 (below Listing 5.5). Frequent colored line numbers can look too fancy/noisy for some people.
I see what you mean, how about a gentler color like gray, but I am not 100% sure how that would look in print.
"DarkBlue" via svgnames option looks less fancy.
How it looks depends on the display/printer setting and individual color sense, though.
Quoted 9 lines
Quoted 5 lines
Does adding an experimental target to make hyperlinks colored work with you (similar to -1csf, -msnt, and the like)? If so, which layout do you prefer, 1c or 2c?
I prefer 1c, but I think the print will always be 2c for saving paper. But please
bear in mind, adding too many targets makes it confusing when Paul tries to release this to the world, no?
Actually speaking, I was the one who added all those experimental targets.
As 1c is mainly for PDF viewers, I think coloring hyperlinks in 1c layout should be acceptable. It should also help those who view on tablets (without mice). 2c layouts won't be affected by the change.
So, I'll prepare a patch to do it. Please give me a short while.
Quoted 8 lines
I am OK skipping colors to keep the PDF
uniformQuoted 5 lines
Quoted 4 lines
Also add synctex=-1 to prevent pdf readers like
evince from complaining to the pdflatex command
line
Quoted 5 lines
Quoted 3 lines
As for SyncTeX support, how about the approach in the patch below?
Yep that work!
Nice!
I'll submit a v2 of the patch with a proper change log to clarify that you are the original author. I don't think the" Reported-by:" tag is good enough. To be honest, I had no idea of the -synctex option before.
Thanks, Akira
Quoted 8 lines
Balbir Singh.
Quoted 5 lines
Thanks, Akira
Quoted 3 lines
Signed-off-by Balbir singh <[email protected]>---
[...]
PATCH v2 1/1 Add optional flag 'LATEX_OPT' in run{first}latex.sh
From: Balbir Singh <[email protected]>
Add synctex=-1 to prevent pdf readers like
evince from complaining to the pdflatex command
line.
[akiyks: Split from the original patch [1].
Instead of always generating .synctex{.gz} files, add an optional flag to pdflatex commands in run{first}latex.sh scripts.
.synctex files can be generated by defining the environment variable "LATEX_OPT", e.g.:
$ export LATEX_OPT="--synctex=-1"
, and run "make".
Update .gitignore and "claen" in Makefile as well to ignore/remove SyncTeX files.
[1]: https://www.spinics.net/lists/perfbook/msg02350.html
]
--- .gitignore | 1 + Makefile | 1 + utilities/runfirstlatex.sh | 2 +- utilities/runlatex.sh | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-)
.gitignore +1 -0
@@ -20,6 +20,7 @@ *.ltms *.pdfp *.pdfq +*.synctex* perfbook_flat.tex qqz.tex contrib.tex
Makefile +1 -0
@@ -350,6 +350,7 @@ clean: rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex rm -f $(LATEXGENERATED) rm -f CodeSamples/snippets.d + rm -f *.synctex* @rm -f $(OBSOLETE_FILES) distclean: clean
utilities/runfirstlatex.sh +1 -1
@@ -40,7 +40,7 @@ fi basename=`echo $1 | sed -e 's/\.tex$//'` echo "pdflatex 1 for $basename.pdf" -pdflatex $basename > /dev/null 2>&1 < /dev/null || : +pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.log
utilities/runlatex.sh +1 -1
@@ -51,7 +51,7 @@ identical_warnings () { } iterate_latex () { - pdflatex $basename > /dev/null 2>&1 < /dev/null || : + pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.log
Signature · 1 line
2.17.1
Paul E. McKenney
AppliedRe: [PATCH v2] Add optional flag 'LATEX_OPT' in run{first}latex.sh
Quoted 17 lines · Akira Yokosawa
From: Balbir Singh <[email protected]>
Add synctex=-1 to prevent pdf readers like
evince from complaining to the pdflatex command
line.[akiyks: Split from the original patch [1].
Instead of always generating .synctex{.gz} files, add an optional flag to pdflatex commands in run{first}latex.sh scripts..synctex files can be generated by defining the environment variable "
LATEX_OPT", e.g.:$ export LATEX_OPT="--synctex=-1"
, and run "make".
Quoted 8 lines
Update .gitignore and "claen" in
Makefileas well to ignore/remove SyncTeX files.[1]: https://www.spinics.net/lists/perfbook/msg02350.html
]Signed-off-by Balbir Singh <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>
Queued and pushed, thank you both!
Thanx, Paul
Quoted 61 lines
--- .gitignore | 1 + Makefile | 1 + utilities/runfirstlatex.sh | 2 +- utilities/runlatex.sh | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-).gitignore +1
-0@@ -20,6 +20,7 @@ *.ltms *.pdfp *.pdfq +*.synctex* perfbook_flat.tex qqz.tex contrib.texMakefile +1
-0@@ -350,6 +350,7 @@ clean: rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex rm -f $(LATEXGENERATED) rm -f CodeSamples/snippets.d + rm -f *.synctex* @rm -f $(OBSOLETE_FILES) distclean: cleanutilities/runfirstlatex.sh +1
-1@@ -40,7 +40,7 @@ fi basename=`echo $1 | sed -e 's/\.tex$//'` echo "pdflatex 1 for $basename.pdf" -pdflatex $basename > /dev/null 2>&1 < /dev/null || : +pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.logutilities/runlatex.sh +1
-1@@ -51,7 +51,7 @@ identical_warnings () { } iterate_latex () { - pdflatex $basename > /dev/null 2>&1 < /dev/null || : + pdflatex $LATEX_OPT $basename > /dev/null 2>&1 < /dev/null || : if grep -q '! Emergency stop.' $basename.log then grep -B 15 -A 5 '! Emergency stop.' $basename.logSignature · 1 line
2.17.1
PATCH 1/1 Make hyperlinks colorful and browsable in PDF viewer
In reply to Akira YokosawaFrom: Balbir Singh <[email protected]>
Without these changes the PDF does not provide a browsable TOC to choose for navigation, also add a bit of color to the links to make them screen friendly.
[akiyks: Split from patch [1].
As 2c layouts are supposed to be for printing, enable coloring of hyperlinks only in 1c layout. To do this, add a boolean variable "colorlinks" and set it true for 1c layout. This would make it easy to change the condition to enable "colorlinks".
Select "DarkBlue" via xcolor's "svgnames" option as it looks less distracting than the pure "blue".
Redundant framing of links in bibliography is disabled when "colorlinks" is effective.
Also make the page numbers in TOC hyperlinks as well.
[1]: https://www.spinics.net/lists/perfbook/msg02350.html
]
---
Hi Paul and Balbir,
This is an experimental patch.
Does the links in "DarkBlue" acceptable (in 1c layout) to you? Any suggestion of color choice is welcome!
Thanks, Akira
--
appendix/appendix.tex | 8 ++++++-- perfbook.tex | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-)
appendix/appendix.tex +6 -2
@@ -14,9 +14,13 @@ }{ \bibliographystyle{alphapf} % Use alpha style customized by urlbst with --inlinelinks option } -\hypersetup{pdfborder=0 0 1,urlbordercolor=0.4 1 1} +\IfColorLinks{}{ + \hypersetup{pdfborder=0 0 1,urlbordercolor=0.4 1 1} +} \bibliography{bib/RCU,bib/WFS,bib/hw,bib/os,bib/parallelsys,bib/patterns,bib/perfmeas,bib/refs,bib/syncrefs,bib/search,bib/swtools,bib/realtime,bib/TM,bib/standards,bib/OSS,bib/maze,bib/energy,bib/QC,bib/NP} -\hypersetup{pdfborder=0 0 0} +\IfColorLinks{}{ + \hypersetup{pdfborder=0 0 0} +} \IfTwoColumn{ \end{adjustwidth*}\twocolumn }{
perfbook.tex +14 -2
@@ -42,7 +42,7 @@ \setlist[description]{style=unboxed} %\usepackage{enumerate} \usepackage{ifthen} -\usepackage[table]{xcolor} +\usepackage[table,svgnames]{xcolor} \usepackage[shortcuts]{extdash} \usepackage{changepage} \usepackage{listings}
@@ -58,7 +58,7 @@ \usepackage{tabularx} \usepackage[hyphens]{url} \usepackage{threeparttable} -\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0}]{hyperref} +\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0},linktoc=all]{hyperref} \usepackage{footnotebackref} % to enable cross-ref of footnote \usepackage[all]{hypcap} % for going to the top of figure and table \usepackage{epigraph}
@@ -100,6 +100,18 @@ \setboolean{nimbusavail}{false} \newcommand{\IfNimbusAvail}[2]{\ifthenelse{\boolean{nimbusavail}}{#1}{#2}} +\newboolean{colorlinks} +\setboolean{colorlinks}{false} +\newcommand{\IfColorLinks}[2]{\ifthenelse{\boolean{colorlinks}}{#1}{#2}} + +\IfTwoColumn{}{ +\setboolean{colorlinks}{true} +} + +\IfColorLinks{ +\hypersetup{colorlinks=true,allcolors=DarkBlue} +}{} + \IfNimbusAvail{ \usepackage{nimbusmononarrow} }{}
Signature · 1 line
2.17.1
Re: [EXP PATCH] Make hyperlinks colorful and browsable in PDF viewer
Quoted 23 lines · Akira Yokosawa
From: Balbir Singh <[email protected]>
Without these changes the PDF does not provide a browsable TOC to choose for navigation, also add a bit of color to the links to make them screen friendly.
[akiyks: Split from patch [1].
As 2c layouts are supposed to be for printing, enable coloring of hyperlinks only in 1c layout. To do this, add a boolean variable "colorlinks" and set it true for 1c layout. This would make it easy to change the condition to enable "colorlinks".Select "DarkBlue" via xcolor's "svgnames" option as it looks less distracting than the pure "blue".
Redundant framing of links in bibliography is disabled when "colorlinks" is effective.
Also make the page numbers in TOC hyperlinks as well.
Quoted 7 lines
Signed-off-by Balbir Singh <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>---
Hi Paul and Balbir,This is an experimental patch.
Does the links in "DarkBlue" acceptable (in 1c layout) to you?
Oops, obviously I meant "Do the links ...".
Quoted 4 lines
Any suggestion of color choice is welcome!
Thanks, Akira
--
[...]
Re: [EXP PATCH] Make hyperlinks colorful and browsable in PDF viewer
In reply to Akira YokosawaQuoted 23 lines · Akira Yokosawa
From: Balbir Singh <[email protected]>
Without these changes the PDF does not provide a browsable TOC to choose for navigation, also add a bit of color to the links to make them screen friendly.
[akiyks: Split from patch [1].
As 2c layouts are supposed to be for printing, enable coloring of hyperlinks only in 1c layout. To do this, add a boolean variable "colorlinks" and set it true for 1c layout. This would make it easy to change the condition to enable "colorlinks".Select "DarkBlue" via xcolor's "svgnames" option as it looks less distracting than the pure "blue".
Redundant framing of links in bibliography is disabled when "colorlinks" is effective.
Also make the page numbers in TOC hyperlinks as well.
Quoted 8 lines
Signed-off-by Balbir Singh <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>---
Hi Paul and Balbir,This is an experimental patch.
Does the links in "DarkBlue" acceptable (in 1c layout) to you? Any suggestion of color choice is welcome!
Being as I am red-green colorblind, I must defer to the two of you on color choices. Looks just fine to me, but... ;-)
Thanx, Paul
Quoted 71 lines
Thanks, Akira
--appendix/appendix.tex | 8 ++++++-- perfbook.tex | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-)appendix/appendix.tex +6
-2@@ -14,9 +14,13 @@ }{ \bibliographystyle{alphapf} % Use alpha style customized by urlbst with --inlinelinks option } -\hypersetup{pdfborder=0 0 1,urlbordercolor=0.4 1 1} +\IfColorLinks{}{ + \hypersetup{pdfborder=0 0 1,urlbordercolor=0.4 1 1} +} \bibliography{bib/RCU,bib/WFS,bib/hw,bib/os,bib/parallelsys,bib/patterns,bib/perfmeas,bib/refs,bib/syncrefs,bib/search,bib/swtools,bib/realtime,bib/TM,bib/standards,bib/OSS,bib/maze,bib/energy,bib/QC,bib/NP} -\hypersetup{pdfborder=0 0 0} +\IfColorLinks{}{ + \hypersetup{pdfborder=0 0 0} +} \IfTwoColumn{ \end{adjustwidth*}\twocolumn }{perfbook.tex +14
-2@@ -42,7 +42,7 @@ \setlist[description]{style=unboxed} %\usepackage{enumerate} \usepackage{ifthen} -\usepackage[table]{xcolor} +\usepackage[table,svgnames]{xcolor} \usepackage[shortcuts]{extdash} \usepackage{changepage} \usepackage{listings}@@ -58,7 +58,7 @@ \usepackage{tabularx} \usepackage[hyphens]{url} \usepackage{threeparttable} -\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0}]{hyperref} +\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0},linktoc=all]{hyperref} \usepackage{footnotebackref} % to enable cross-ref of footnote \usepackage[all]{hypcap} % for going to the top of figure and table \usepackage{epigraph}@@ -100,6 +100,18 @@ \setboolean{nimbusavail}{false} \newcommand{\IfNimbusAvail}[2]{\ifthenelse{\boolean{nimbusavail}}{#1}{#2}} +\newboolean{colorlinks} +\setboolean{colorlinks}{false} +\newcommand{\IfColorLinks}[2]{\ifthenelse{\boolean{colorlinks}}{#1}{#2}} + +\IfTwoColumn{}{ +\setboolean{colorlinks}{true} +} + +\IfColorLinks{ +\hypersetup{colorlinks=true,allcolors=DarkBlue} +}{} + \IfNimbusAvail{ \usepackage{nimbusmononarrow} }{}Signature · 1 line
2.17.1
Re: [EXP PATCH] Make hyperlinks colorful and browsable in PDF viewer
Quoted 29 lines · Paul E. McKenney
Quoted 28 lines · Akira Yokosawa
From: Balbir Singh <[email protected]>
Without these changes the PDF does not provide a browsable TOC to choose for navigation, also add a bit of color to the links to make them screen friendly.
[akiyks: Split from patch [1].
As 2c layouts are supposed to be for printing, enable coloring of hyperlinks only in 1c layout. To do this, add a boolean variable "colorlinks" and set it true for 1c layout. This would make it easy to change the condition to enable "colorlinks".Select "DarkBlue" via xcolor's "svgnames" option as it looks less distracting than the pure "blue".
Redundant framing of links in bibliography is disabled when "colorlinks" is effective.
Also make the page numbers in TOC hyperlinks as well.
[1]: https://www.spinics.net/lists/perfbook/msg02350.html
]Signed-off-by Balbir Singh <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>---
Hi Paul and Balbir,
Quoted 6 lines
Quoted 3 lines
This is an experimental patch.
Does the links in "DarkBlue" acceptable (in 1c layout) to you? Any suggestion of color choice is welcome!Being as I am red-green colorblind, I must defer to the two of you on color choices. Looks just fine to me, but... ;-)
Hi Balbir,
Have you tried this patch and seen the resulting PDF (-1c)? If it looks good enough to you, I'd like this patch applied.
Looking forward to hearing from you.
Thanks, Akira
Quoted 74 lines
Thanx, Paul
Quoted 71 lines
Thanks, Akira
--appendix/appendix.tex | 8 ++++++-- perfbook.tex | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-)appendix/appendix.tex +6
-2@@ -14,9 +14,13 @@ }{ \bibliographystyle{alphapf} % Use alpha style customized by urlbst with --inlinelinks option } -\hypersetup{pdfborder=0 0 1,urlbordercolor=0.4 1 1} +\IfColorLinks{}{ + \hypersetup{pdfborder=0 0 1,urlbordercolor=0.4 1 1} +} \bibliography{bib/RCU,bib/WFS,bib/hw,bib/os,bib/parallelsys,bib/patterns,bib/perfmeas,bib/refs,bib/syncrefs,bib/search,bib/swtools,bib/realtime,bib/TM,bib/standards,bib/OSS,bib/maze,bib/energy,bib/QC,bib/NP} -\hypersetup{pdfborder=0 0 0} +\IfColorLinks{}{ + \hypersetup{pdfborder=0 0 0} +} \IfTwoColumn{ \end{adjustwidth*}\twocolumn }{perfbook.tex +14
-2@@ -42,7 +42,7 @@ \setlist[description]{style=unboxed} %\usepackage{enumerate} \usepackage{ifthen} -\usepackage[table]{xcolor} +\usepackage[table,svgnames]{xcolor} \usepackage[shortcuts]{extdash} \usepackage{changepage} \usepackage{listings}@@ -58,7 +58,7 @@ \usepackage{tabularx} \usepackage[hyphens]{url} \usepackage{threeparttable} -\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0}]{hyperref} +\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0},linktoc=all]{hyperref} \usepackage{footnotebackref} % to enable cross-ref of footnote \usepackage[all]{hypcap} % for going to the top of figure and table \usepackage{epigraph}@@ -100,6 +100,18 @@ \setboolean{nimbusavail}{false} \newcommand{\IfNimbusAvail}[2]{\ifthenelse{\boolean{nimbusavail}}{#1}{#2}} +\newboolean{colorlinks} +\setboolean{colorlinks}{false} +\newcommand{\IfColorLinks}[2]{\ifthenelse{\boolean{colorlinks}}{#1}{#2}} + +\IfTwoColumn{}{ +\setboolean{colorlinks}{true} +} + +\IfColorLinks{ +\hypersetup{colorlinks=true,allcolors=DarkBlue} +}{} + \IfNimbusAvail{ \usepackage{nimbusmononarrow} }{}Signature · 1 line
2.17.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Paul E. McKenney
AppliedRe: [PATCH RESEND] Make hyperlinks colorful and browsable in PDF viewer
Quoted 19 lines · Akira Yokosawa
Quoted 1 line
From
8b1a3e2402b12c99a36844c642f1ce2bafdd7277Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Wed, 18 Sep 2019 19:40:14 +0900
Subject: [PATCH v2] Make hyperlinks colorful and browsable in PDF viewerBalbir suggested coloring hyperlinks to make them easier to recognize [1].
As 2c layouts are supposed to be for printing, enable coloring of hyperlinks only in 1c layout. To do this, add a boolean variable "colorlinks" and set it true for 1c layout. This would make it easy to change the condition to enable "colorlinks".
Select "MediumBlue" via xcolor's "svgnames" option as it looks less distracting than the pure "blue", but still distinguishable.
Redundant framing of links in bibliography is disabled when "colorlinks" is effective.
Quoted 6 lines
Also make the page numbers in TOC hyperlinks as well.
[1]: https://www.spinics.net/lists/perfbook/msg02350.html
Suggested-by Balbir Singh <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>
Queued and pushed, thank you both!
Thanx, Paul
Quoted 89 lines
---
Hi Paul,As I couldn't get Balbir's ack for a week or so, I'm resending this patch as the author.
Changes from EXP PATCH:
o Color of links is changed to MediumBlue. Depending on display settings/resolution, DaukBlue is sometimes hard to distinguish especially with serif font. For bold "Quick Quiz", DarkBlue could be a better choice. Such an optimization can be done in the future.
o Substitute Balbir's Suggested-by: for his Signed-of-by:.
o Edit change log to reflect the circumstances.
Thanks, Akira
--appendix/appendix.tex | 8 ++++++-- perfbook.tex | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-)appendix/appendix.tex +6
-2@@ -14,9 +14,13 @@ }{ \bibliographystyle{alphapf} % Use alpha style customized by urlbst with --inlinelinks option } -\hypersetup{pdfborder=0 0 1,urlbordercolor=0.4 1 1} +\IfColorLinks{}{ + \hypersetup{pdfborder=0 0 1,urlbordercolor=0.4 1 1} +} \bibliography{bib/RCU,bib/WFS,bib/hw,bib/os,bib/parallelsys,bib/patterns,bib/perfmeas,bib/refs,bib/syncrefs,bib/search,bib/swtools,bib/realtime,bib/TM,bib/standards,bib/OSS,bib/maze,bib/energy,bib/QC,bib/NP} -\hypersetup{pdfborder=0 0 0} +\IfColorLinks{}{ + \hypersetup{pdfborder=0 0 0} +} \IfTwoColumn{ \end{adjustwidth*}\twocolumn }{perfbook.tex +14
-2@@ -42,7 +42,7 @@ \setlist[description]{style=unboxed} %\usepackage{enumerate} \usepackage{ifthen} -\usepackage[table]{xcolor} +\usepackage[table,svgnames]{xcolor} \usepackage[shortcuts]{extdash} \usepackage{changepage} \usepackage{listings}@@ -58,7 +58,7 @@ \usepackage{tabularx} \usepackage[hyphens]{url} \usepackage{threeparttable} -\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0}]{hyperref} +\usepackage[bookmarks=true,bookmarksnumbered=true,pdfborder={0 0 0},linktoc=all]{hyperref} \usepackage{footnotebackref} % to enable cross-ref of footnote \usepackage[all]{hypcap} % for going to the top of figure and table \usepackage{epigraph}@@ -100,6 +100,18 @@ \setboolean{nimbusavail}{false} \newcommand{\IfNimbusAvail}[2]{\ifthenelse{\boolean{nimbusavail}}{#1}{#2}} +\newboolean{colorlinks} +\setboolean{colorlinks}{false} +\newcommand{\IfColorLinks}[2]{\ifthenelse{\boolean{colorlinks}}{#1}{#2}} + +\IfTwoColumn{}{ +\setboolean{colorlinks}{true} +} + +\IfColorLinks{ +\hypersetup{colorlinks=true,allcolors=MediumBlue} +}{} + \IfNimbusAvail{ \usepackage{nimbusmononarrow} }{}Signature · 1 line
2.17.1