Re: Fix pdflatex ToC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 16, 2019 at 7:33 PM Akira Yokosawa <akiyks@xxxxxxxxx> wrote:
>
> (CC to Paul's current address)
> Hi Balbir,
>
> On Mon, 16 Sep 2019 08:21:54 +1000, Balbir Singh wrote:
> > From df15e226d96614ffbdedfd517f8a6d7afc1c0fee Mon Sep 17 00:00:00 2001
> > From: Balbir singh <bsingharora@xxxxxxxxx>
> > 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.
>
> 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)

> 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.

> 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

> >
> > 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?
>

Yep that work!

Balbir Singh.

>         Thanks, Akira
>
> >
> > Signed-off-by: Balbir singh <bsingharora@xxxxxxxxx>
> > ---
>
> -----8<-------------------------------
> From 6a509df0aef50309d8ec1ae5e709b7cee29df3ad Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@xxxxxxxxx>
> 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
>
> Reported-by: Balbir Singh <bsingharora@xxxxxxxxx>
> Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
> ---
>  .gitignore                 | 1 +
>  Makefile                   | 1 +
>  utilities/runfirstlatex.sh | 2 +-
>  utilities/runlatex.sh      | 2 +-
>  4 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/.gitignore b/.gitignore
> index ebd5e98c..dfeb9e1b 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -20,6 +20,7 @@
>  *.ltms
>  *.pdfp
>  *.pdfq
> +*.synctex*
>  perfbook_flat.tex
>  qqz.tex
>  contrib.tex
> diff --git a/Makefile b/Makefile
> index 13eddfc8..236b0bb2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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
> diff --git a/utilities/runfirstlatex.sh b/utilities/runfirstlatex.sh
> index 1a2a7a58..2b25b9f1 100644
> --- a/utilities/runfirstlatex.sh
> +++ b/utilities/runfirstlatex.sh
> @@ -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
> diff --git a/utilities/runlatex.sh b/utilities/runlatex.sh
> index 289364d7..18dd7fd6 100644
> --- a/utilities/runlatex.sh
> +++ b/utilities/runlatex.sh
> @@ -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
>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux