texlive[68528] Build/source/texk/web2c: [WEB] Add option '-p' to
commits+ascherer at tug.org
commits+ascherer at tug.org
Fri Oct 13 20:09:01 CEST 2023
Revision: 68528
https://tug.org/svn/texlive?view=revision&revision=68528
Author: ascherer
Date: 2023-10-13 20:09:01 +0200 (Fri, 13 Oct 2023)
Log Message:
-----------
[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.
Modified Paths:
--------------
trunk/Build/source/texk/web2c/ChangeLog
trunk/Build/source/texk/web2c/help.h
trunk/Build/source/texk/web2c/man/ChangeLog
trunk/Build/source/texk/web2c/man/weave.man
trunk/Build/source/texk/web2c/weav-twill.ch
trunk/Build/source/texk/web2c/weave.ch
Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog 2023-10-12 23:43:54 UTC (rev 68527)
+++ trunk/Build/source/texk/web2c/ChangeLog 2023-10-13 18:09:01 UTC (rev 68528)
@@ -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 at freefriends.org>
* lib/texmfmp.c (parse_options): if --output-directory was
Modified: trunk/Build/source/texk/web2c/help.h
===================================================================
--- trunk/Build/source/texk/web2c/help.h 2023-10-12 23:43:54 UTC (rev 68527)
+++ trunk/Build/source/texk/web2c/help.h 2023-10-13 18:09:01 UTC (rev 68528)
@@ -639,6 +639,7 @@
" 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",
Modified: trunk/Build/source/texk/web2c/man/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/man/ChangeLog 2023-10-12 23:43:54 UTC (rev 68527)
+++ trunk/Build/source/texk/web2c/man/ChangeLog 2023-10-13 18:09:01 UTC (rev 68528)
@@ -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,
Modified: trunk/Build/source/texk/web2c/man/weave.man
===================================================================
--- trunk/Build/source/texk/web2c/man/weave.man 2023-10-12 23:43:54 UTC (rev 68527)
+++ trunk/Build/source/texk/web2c/man/weave.man 2023-10-13 18:09:01 UTC (rev 68528)
@@ -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 @@
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 @@
\*(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)
Modified: trunk/Build/source/texk/web2c/weav-twill.ch
===================================================================
--- trunk/Build/source/texk/web2c/weav-twill.ch 2023-10-12 23:43:54 UTC (rev 68527)
+++ trunk/Build/source/texk/web2c/weav-twill.ch 2023-10-13 18:09:01 UTC (rev 68528)
@@ -428,6 +428,11 @@
`\.{\\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}'.
+ at .\\input pwebmac@>
+ at .pwebmac@>
@y
`\.{\\input twimac-web}'.
@.\\input twimac-web@>
@@ -435,7 +440,9 @@
@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,12 +692,39 @@
Section 264.
@x WEAVE.CH
+const n_options = 5; {Pascal won't count array lengths for us.}
+ at y
+const n_options = 4; {Pascal won't count array lengths for us.}
+ at z
+
+ at x WEAVE.CH
usage_help (WEAVE_HELP, nil);
@y
usage_help (TWILL_HELP, nil);
@z
+Section 268.
+
+ at x WEAVE.CH
+@ Use alternative \TeX\ macros more suited for {\mc PDF} output?
+ at .-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);
+
+ at y
+ at z
+
@x
+@!pdf_output:c_int_type;
+ at y
+ at z
+
+ at x
@!web_name,@!chg_name,@!tex_name:const_c_string;
@y
@!web_name,@!chg_name,@!tex_name:const_c_string;
Modified: trunk/Build/source/texk/web2c/weave.ch
===================================================================
--- trunk/Build/source/texk/web2c/weave.ch 2023-10-12 23:43:54 UTC (rev 68527)
+++ trunk/Build/source/texk/web2c/weave.ch 2023-10-13 18:09:01 UTC (rev 68528)
@@ -325,6 +325,29 @@
if (reserved(p)or(byte_start[p]+1=byte_start[p+ww]))and
@z
+ at x [124]
+`\.{\\input webmac}'.
+ at .\\input webmac@>
+ at .webmac@>
+ at y
+`\.{\\input webmac}'.
+ at .\\input webmac@>
+ at .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}'.
+ at .\\input pwebmac@>
+ at .pwebmac@>
+ at z
+
+ at x
+out_ptr:=1; out_line:=1; out_buf[1]:="c"; write(tex_file,'\input webma');
+ at 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');
+ at 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 @@
@<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].val := 0;
incr (current_option);
+@ Use alternative \TeX\ macros more suited for {\mc PDF} output?
+ at .-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 @@
@ @<Global...@> =
@!no_xref:c_int_type;
+@!pdf_output:c_int_type;
@ An element with all zeros always ends the list.
More information about the tex-live-commits
mailing list.