summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2023-10-13 18:09:01 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2023-10-13 18:09:01 +0000
commit3b3c4cc236c628e76f9d93e04e6e06cdcc2f9034 (patch)
tree1df53158d19c26ca1e164f63fda4d3610b4ef5f5
parentfddfc48f52711fa2625336d838652c6edcd59ef8 (diff)
[WEB] Add option '-p' to '\input pwebmac'.
Invoke 'weave -p' and the first line in the TeX output file will be '\input pwebmac'. These alternative macros are more suited for the creation of PDF output with 'tex "\let\pdf+ \input cob.tex' followed by 'dvipdfm cob' or with modern TeX engines like pdfTeX, LuaTeX, or XeTeX. git-svn-id: svn://tug.org/texlive/trunk@68528 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/ChangeLog6
-rw-r--r--Build/source/texk/web2c/help.h1
-rw-r--r--Build/source/texk/web2c/man/ChangeLog4
-rw-r--r--Build/source/texk/web2c/man/weave.man12
-rw-r--r--Build/source/texk/web2c/weav-twill.ch36
-rw-r--r--Build/source/texk/web2c/weave.ch36
6 files changed, 90 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 2c90f901fa0..055f2f7f255 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,9 @@
+2023-10-13 Andreas Scherer <https://ascherer.github.io>
+
+ * help.h,
+ * weav-twill.ch,
+ * weave.ch: Add option '-p' to '\input pwebmac'.
+
2023-10-09 Karl Berry <karl@freefriends.org>
* lib/texmfmp.c (parse_options): if --output-directory was
diff --git a/Build/source/texk/web2c/help.h b/Build/source/texk/web2c/help.h
index df52bf7679b..d402b363a9b 100644
--- a/Build/source/texk/web2c/help.h
+++ b/Build/source/texk/web2c/help.h
@@ -639,6 +639,7 @@ const_string WEAVEHELP[] = {
" unless otherwise specified by OUTFILE;",
" in this case, '-' specifies a null CHANGEFILE.",
"",
+ "-p use alternative macros for PDF output",
"-x omit cross-reference information",
"-help display this help and exit",
"-version output version information and exit",
diff --git a/Build/source/texk/web2c/man/ChangeLog b/Build/source/texk/web2c/man/ChangeLog
index d28619d6d28..b2bc27bd053 100644
--- a/Build/source/texk/web2c/man/ChangeLog
+++ b/Build/source/texk/web2c/man/ChangeLog
@@ -1,3 +1,7 @@
+2023-10-13 Andreas Scherer <https://ascherer.github.io>
+
+ * weave.man: Add option '-p' to '\input pwebmac'.
+
2023-09-22 Andreas Scherer <https://ascherer.github.io>
* cweb.man,
diff --git a/Build/source/texk/web2c/man/weave.man b/Build/source/texk/web2c/man/weave.man
index 2680ff9515f..3d85c6b53f8 100644
--- a/Build/source/texk/web2c/man/weave.man
+++ b/Build/source/texk/web2c/man/weave.man
@@ -1,4 +1,4 @@
-.TH WEAVE 1 "02 March 2022" "Web2C @VERSION@"
+.TH WEAVE 1 "13 October 2023" "Web2C @VERSION@"
.\"=====================================================================
.if n .ds MF Metafont
.if t .ds MF Metafont
@@ -19,7 +19,7 @@
weave \- translate WEB to TeX
.SH SYNOPSIS
.PP
-\f[B]weave\f[R] [\f[B]-x\f[R]]
+\f[B]weave\f[R] [\f[B]-p\f[R]] [\f[B]-x\f[R]]
\f[I]webfile\f[R][\f[B].web\f[R]]
[{\f[I]changefile\f[R][\f[B].ch\f[R]]|\f[B]-\f[R]}
[\f[I]outfile\f[R][\f[B].tex\f[R]]]]
@@ -38,7 +38,9 @@ layout and the use of indentation, italics, boldface, etc., and it supplies
extensive cross-index information that it gathers automatically.
The command line arguments are the same as for
.B tangle
-except for the option:
+except for the options:
+.B \-p
+says to use alternative macros more suited for PDF output.
.B \-x
says to omit the index, module name list, and table of contents pages.
(A
@@ -74,6 +76,10 @@ for the details of the searching.
\*(TX macros used by
.B weave
output.
+.TP \w'@@'u+2n
+.I $TEXMFMAIN/tex/plain/pwebmac/pwebmac.tex
+alternative
+\*(TX macros used for PDF output.
.\"=====================================================================
.SH "SEE ALSO"
.BR tangle (1)
diff --git a/Build/source/texk/web2c/weav-twill.ch b/Build/source/texk/web2c/weav-twill.ch
index 21e492fd42d..06ef08f1dc5 100644
--- a/Build/source/texk/web2c/weav-twill.ch
+++ b/Build/source/texk/web2c/weav-twill.ch
@@ -428,6 +428,11 @@ Section 124.
`\.{\\input webmac}'.
@.\\input webmac@>
@.webmac@>
+
+If the user has sent the |pdf_output| flag (the -p option of the command
+line), then we use alternative \TeX\ macros from `\.{\\input pwebmac}'.
+@.\\input pwebmac@>
+@.pwebmac@>
@y
`\.{\\input twimac-web}'.
@.\\input twimac-web@>
@@ -435,7 +440,9 @@ Section 124.
@z
@x 2204c2367
-out_ptr:=1; out_line:=1; out_buf[1]:="c"; write(tex_file,'\input webma');
+out_ptr:=1; out_line:=1; out_buf[1]:="c";
+if pdf_output then write(tex_file,'\input pwebma')
+else write(tex_file,'\input webma');
@y
out_ptr:=1; out_line:=1; out_buf[1]:="b"; write(tex_file,'\input twimac-we');
@z
@@ -685,11 +692,38 @@ var lhs:integer;
Section 264.
@x WEAVE.CH
+const n_options = 5; {Pascal won't count array lengths for us.}
+@y
+const n_options = 4; {Pascal won't count array lengths for us.}
+@z
+
+@x WEAVE.CH
usage_help (WEAVE_HELP, nil);
@y
usage_help (TWILL_HELP, nil);
@z
+Section 268.
+
+@x WEAVE.CH
+@ Use alternative \TeX\ macros more suited for {\mc PDF} output?
+@.-p@>
+
+@<Define the option...@> =
+long_options[current_option].name := char_to_string ('p');
+long_options[current_option].has_arg := 0;
+long_options[current_option].flag := address_of (pdf_output);
+long_options[current_option].val := 1;
+incr (current_option);
+
+@y
+@z
+
+@x
+@!pdf_output:c_int_type;
+@y
+@z
+
@x
@!web_name,@!chg_name,@!tex_name:const_c_string;
@y
diff --git a/Build/source/texk/web2c/weave.ch b/Build/source/texk/web2c/weave.ch
index 136fc89d27f..1458f584071 100644
--- a/Build/source/texk/web2c/weave.ch
+++ b/Build/source/texk/web2c/weave.ch
@@ -325,6 +325,29 @@ begin if no_xref then return;
if (reserved(p)or(byte_start[p]+1=byte_start[p+ww]))and
@z
+@x [124]
+`\.{\\input webmac}'.
+@.\\input webmac@>
+@.webmac@>
+@y
+`\.{\\input webmac}'.
+@.\\input webmac@>
+@.webmac@>
+
+If the user has sent the |pdf_output| flag (the -p option of the command
+line), then we use alternative \TeX\ macros from `\.{\\input pwebmac}'.
+@.\\input pwebmac@>
+@.pwebmac@>
+@z
+
+@x
+out_ptr:=1; out_line:=1; out_buf[1]:="c"; write(tex_file,'\input webma');
+@y
+out_ptr:=1; out_line:=1; out_buf[1]:="c";
+if pdf_output then write(tex_file,'\input pwebma')
+else write(tex_file,'\input webma');
+@z
+
@x [127] see https://tug.org/pipermail/tex-live/2023-July/049306.htm
preceded by another backslash. In the latter case, a |"%"| is output at
the break.
@@ -540,7 +563,7 @@ Parse a Unix-style command line.
@<Define |parse_arguments|@> =
procedure parse_arguments;
-const n_options = 4; {Pascal won't count array lengths for us.}
+const n_options = 5; {Pascal won't count array lengths for us.}
var @!long_options: array[0..n_options] of getopt_struct;
@!getopt_return_val: integer;
@!option_index: c_int_type;
@@ -606,6 +629,16 @@ long_options[current_option].flag := 0;
long_options[current_option].val := 0;
incr (current_option);
+@ Use alternative \TeX\ macros more suited for {\mc PDF} output?
+@.-p@>
+
+@<Define the option...@> =
+long_options[current_option].name := char_to_string ('p');
+long_options[current_option].has_arg := 0;
+long_options[current_option].flag := address_of (pdf_output);
+long_options[current_option].val := 1;
+incr (current_option);
+
@ Omit cross-referencing?
@.-x@>
@@ -618,6 +651,7 @@ incr (current_option);
@ @<Global...@> =
@!no_xref:c_int_type;
+@!pdf_output:c_int_type;
@ An element with all zeros always ends the list.