From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: zsh manual - missing bookmarks in pdf file?
Date: Fri, 4 Mar 2016 23:25:40 +0900 [thread overview]
Message-ID: <DD8312A1-802E-40AB-BDCB-DB13CDAF2ED1@kba.biglobe.ne.jp> (raw)
In-Reply-To: <CAHYJk3Tp0i4xFYrM0OsTNGE8vBEbFgPAaS9J9q6EpW7obSkq-Q@mail.gmail.com>
On 2016/03/04, at 13:16, Mikael Magnusson <mikachu@gmail.com> wrote:
>
> We could somehow use LC_PAPER to determine which to build, and allow
> overriding/building both with a configure option?
In the revised patch below, configure uses LC_PAPER to determine
PAPERSIZE, and it is used as the paper size for both zsh.pdf and
intro.pdf. A user can always use (without re-configure)
% cd Doc
% make zsh_a4.pdf # or zsh_us.pdf, intro.a4.pdf, intro.us.pdf
to create a pdf with specific paper size. And
% make everything
will create both a4 and us pdf files (and two dvi files).
# If LC_PAPER is not available (OS X, for example), then
# paper size is set to a4.
There is another minor problem:
If pdfetex is not found, the original code sets PDFETEX to
': pdfetex', but this may not work because PDFETEX is used as
PDFTEX=$(PDFETEX) $(TEXI2DVI) --pdf $(sdir)/zsh.texi;
The patch includes a possible fix for this, but is it really
necessary to check for pdfetex? Since texi2dvi checks for
pdfetex by itself, probably PDFTEX=$(PDFETEX) is not necessary.
Or it may be there for a (very) old texi2dvi?
diff --git a/Config/defs.mk.in b/Config/defs.mk.in
index 3c84610..2bc1748 100644
--- a/Config/defs.mk.in
+++ b/Config/defs.mk.in
@@ -79,8 +79,6 @@ ANSI2KNR = @ANSI2KNR@
YODL = @YODL@ @YODL_OPTIONS@
YODL2TXT = @YODL@2txt
YODL2HTML = @YODL@2html
-PDFETEX = @PDFETEX@
-TEXI2PDF = @TEXI2PDF@
# install utility
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/Doc/Makefile.in b/Doc/Makefile.in
index d589991..08dfd5d 100644
--- a/Doc/Makefile.in
+++ b/Doc/Makefile.in
@@ -39,9 +39,11 @@ LN_S = @LN_S@
@DEFS_MK@
MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
+TEXI2DVI = @TEXI2DVI@
DVIPS = dvips
+TEXI2PDF = @TEXI2PDF@
TEXI2HTML = @TEXI2HTML@
+PAPERSIZE = @PAPERSIZE@
.SUFFIXES: .yo .1
@@ -86,33 +88,41 @@ Zsh/seealso.yo Zsh/tcpsys.yo Zsh/zftpsys.yo Zsh/zle.yo
all: man $(runhelp) texi ../META-FAQ
.PHONY: all
-everything: all dvi html pdf info
+everything: all html info zsh_a4.dvi zsh_us.dvi zsh_a4.pdf zsh_us.pdf \
+ intro.a4.pdf intro.us.pdf
.PHONY: everything
dvi: zsh.dvi
.PHONY: dvi
-zsh.dvi: $(sdir)/zsh.texi
- $(TEXI2DVI) $(sdir)/zsh.texi
+zsh.dvi zsh_a4.dvi zsh_us.dvi: $(sdir)/zsh.texi
+ if test $@ = zsh_us.dvi || \
+ { test $@ = zsh.dvi && test "$(PAPERSIZE)" = us; }; then \
+ $(TEXI2DVI) -o $@ $(sdir)/zsh.texi; \
+ else \
+ $(TEXI2DVI) -o $@ -t @afourpaper $(sdir)/zsh.texi; \
+ fi
-pdf: zsh.pdf intro.a4.pdf intro.us.pdf
+pdf: zsh.pdf intro.pdf
.PHONY: pdf
-zsh.pdf: $(sdir)/zsh.texi
- if [ x$(TEXI2PDF) != x ]; then \
- $(TEXI2PDF) $(sdir)/zsh.texi; \
+zsh.pdf zsh_a4.pdf zsh_us.pdf: $(sdir)/zsh.texi
+ if test $@ = zsh_us.pdf || \
+ { test $@ = zsh.pdf && test "$(PAPERSIZE)" = us; }; then \
+ $(TEXI2PDF) -o $@ $(sdir)/zsh.texi; \
else \
- PDFTEX=$(PDFETEX) $(TEXI2DVI) --pdf $(sdir)/zsh.texi; \
+ $(TEXI2PDF) -o $@ -t @afourpaper $(sdir)/zsh.texi; \
fi
# Use roff2ps / ps2pdf because pdfroff produces doubled output.
-intro.a4.pdf: $(sdir)/intro.ms
- roff2ps -ms -P-pa4 < $(sdir)/intro.ms > intro.a4.ps
- ps2pdf intro.a4.ps
-
-intro.us.pdf: $(sdir)/intro.ms
- roff2ps -ms -P-pletter < $(sdir)/intro.ms > intro.us.ps
- ps2pdf intro.us.ps
+intro.pdf intro.a4.pdf intro.us.pdf: $(sdir)/intro.ms
+ if test $@ = intro.us.pdf || \
+ { test $@ = intro.pdf && test "$(PAPERSIZE)" = us; }; then \
+ roff2ps -ms -P-pletter < $(sdir)/intro.ms > intro.ps; \
+ else \
+ roff2ps -ms -P-pa4 < $(sdir)/intro.ms > intro.ps; \
+ fi; \
+ ps2pdf -sOutputFile=$@ intro.ps
texi: $(sdir)/zsh.texi
.PHONY: texi
diff --git a/Doc/ztexi.yo b/Doc/ztexi.yo
index e878345..7d52e6e 100644
--- a/Doc/ztexi.yo
+++ b/Doc/ztexi.yo
@@ -53,7 +53,6 @@ def(texinfo)(2)(\
NOTRANS(\input texinfo.tex)+NL()\
NOTRANS(@c %**start of header)+NL()\
NOTRANS(@iftex)+NL()\
- NOTRANS(@afourpaper)+NL()\
NOTRANS(@setchapternewpage off)+NL()\
NOTRANS(@end iftex)+NL()\
NOTRANS(@setfilename )ARG1+NL()\
diff --git a/configure.ac b/configure.ac
index c3bd713..c5be36b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -632,14 +632,33 @@ if test "x$ac_cv_prog_YODL" = xyodl; then
fi
AC_SUBST(YODL_OPTIONS)
-AC_CHECK_PROGS([PDFETEX], [pdfetex], [: pdfetex])
-AC_CHECK_PROGS([TEXI2PDF], [texi2pdf], [])
+AC_CHECK_PROGS([PDFETEX], [pdfetex], [])
+AC_CHECK_PROGS([TEXI2DVI], [texi2dvi], [: texi2dvi])
+AC_CHECK_PROGS([TEXI2PDF], [texi2pdf], [: texi2pdf])
AC_CHECK_PROGS([TEXI2HTML], [texi2any texi2html], [: texi2html])
+if test x"$TEXI2PDF" != xtexi2pdf && test x"$TEXI2DVI" = xtexi2dvi; then
+ if test x"$PDFETEX" != x; then
+ TEXI2PDF="PDFTEX=$PDFETEX texi2dvi --pdf"
+ else
+ TEXI2PDF='texi2dvi --pdf'
+ fi
+fi
+
if test x"$TEXI2HTML" = xtexi2any; then
TEXI2HTML='texi2any -c TEXI2HTML=1'
fi
+case "$LC_PAPER" in
+ ??_US*)
+ PAPERSIZE=us
+ ;;
+ *)
+ PAPERSIZE=a4
+ ;;
+esac
+AC_SUBST(PAPERSIZE)
+
AC_CHECK_PROGS([ANSI2KNR], [ansi2knr], [: ansi2knr])
if test x"$ansi2knr" = xyes && test x"$ANSI2KNR" = x": ansi2knr"; then
next prev parent reply other threads:[~2016-03-04 15:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 14:26 Greg Klanderman
[not found] ` <DE24867B-712C-46A4-85B4-BDD290E91154@kba.biglobe.ne.jp>
2016-03-02 3:52 ` Greg Klanderman
2016-03-02 5:20 ` Jun T.
2016-03-02 15:40 ` Greg Klanderman
2016-03-03 5:03 ` Jun T.
2016-03-03 14:39 ` Greg Klanderman
2016-03-04 3:33 ` Jun T.
2016-03-04 4:16 ` Mikael Magnusson
2016-03-04 14:25 ` Jun T. [this message]
2016-03-04 15:08 ` Peter Stephenson
2016-03-07 3:15 ` Jun T.
2016-03-04 18:45 ` Greg Klanderman
2016-03-04 19:23 ` Jun T.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DD8312A1-802E-40AB-BDCB-DB13CDAF2ED1@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).