aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xChangeLog28
-rw-r--r--ChangeLog.02
-rw-r--r--NEWS10
-rw-r--r--awk.h12
-rw-r--r--awkgram.c31
-rw-r--r--awkgram.y31
-rw-r--r--configh.in12
-rwxr-xr-xconfigure54
-rw-r--r--configure.ac22
-rw-r--r--custom.h5
-rw-r--r--doc/ChangeLog7
-rw-r--r--doc/gawk.info114
-rw-r--r--doc/gawk.texi5
-rw-r--r--doc/gawktexi.in5
-rw-r--r--doc/it/ChangeLog53
-rw-r--r--doc/it/gawktexi.in883
-rwxr-xr-x[-rw-r--r--]doc/it/texinfo.tex3993
-rw-r--r--extension/ChangeLog11
-rw-r--r--extension/filefuncs.3am7
-rw-r--r--extension/filefuncs.c12
-rw-r--r--missing_d/ChangeLog4
-rw-r--r--missing_d/gawkbool.h40
-rw-r--r--pc/config.h6
-rw-r--r--support/ChangeLog2
-rw-r--r--support/dfa.h4
-rw-r--r--support/regex.c3
26 files changed, 3136 insertions, 2220 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e4c56ba..fa267d5b 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -428,6 +428,25 @@
* field.c (do_split): Simplify the lint warnings.
Based on suggested code by Eric Pruitt <eric.pruitt@gmail.com>.
+ Unrelated:
+
+ * awkgram.y (check_funcs): Remove the REALLYMEAN ifdef and
+ simplify the lint checking code for function defined but not
+ called or called but not defined.
+
+2017-10-13 Arnold D. Robbins <arnold@skeeve.com>
+
+ Assume a more C99 environment:
+
+ * awk.h: Assume we have limits.h, stdarg.h and stdbool.h.
+ * configure.ac: Remove checks for limits.h and stdarg.h.
+
+2017-10-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Remove --with-whiny-user-strftime option.
+ * NEWS: Updated.
+ * ChangeLog.0: Fix a typo. :-)
+
2017-10-08 Arnold D. Robbins <arnold@skeeve.com>
* command.y: Fix the FSF's address.
@@ -447,6 +466,14 @@
2017-10-02 Arnold D. Robbins <arnold@skeeve.com>
+ Undo change of 2014-09-07:
+
+ * configure.ac: Remove the undocumented option to enable locale
+ letters in identifiers.
+ * awkgram.y (is_alpha): Remove related code.
+
+2017-10-02 Arnold D. Robbins <arnold@skeeve.com>
+
* config.guess, config.sub: Updated.
2017-09-28 Arnold D. Robbins <arnold@skeeve.com>
@@ -4135,6 +4162,7 @@
* configure.ac: Add an option to enable locale letters in identifiers.
Undocumented and subject to being rescinded at any time in the future.
+ * awkgram.y (is_alpha): Actual code is here.
* NEWS: Mention to look at configure --help.
Unrelated:
diff --git a/ChangeLog.0 b/ChangeLog.0
index 794e0351..d8a13ce5 100644
--- a/ChangeLog.0
+++ b/ChangeLog.0
@@ -7020,7 +7020,7 @@ Tue Dec 4 17:54:30 2001 Arnold D. Robbins <arnold@skeeve.com>
* configure.in (AC_ARG_WITH): Add appropriate code for autoconf.
* accondig.h (USE_INCLUDED_STRFTIME): Add #undef for it.
- * custom.h (USE_INCLUDED_STRFTIME): Set things up write.
+ * custom.h (USE_INCLUDED_STRFTIME): Set things up right.
Tue Dec 4 16:44:07 2001 Andreas Buening <andreas.buening@nexgo.de>
diff --git a/NEWS b/NEWS
index 2a9806e2..765bd960 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,16 @@
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
+Changes from 4.2.x to 5.0.0
+---------------------------
+
+1. The undocumented configure option and code that enabled the use of
+ non-English "letters" in identifiers is now gone.
+
+2. The `--with-whiny-user-strftime' configuration option is now gone.
+
+3. The code now makes some stronger assumptions about a C99 environment.
+
Changes from 4.2.1 to 4.2.2
---------------------------
diff --git a/awk.h b/awk.h
index a848e39e..cfcce86c 100644
--- a/awk.h
+++ b/awk.h
@@ -53,9 +53,7 @@
#include <stdio.h>
#include <assert.h>
-#ifdef HAVE_LIMITS_H
#include <limits.h>
-#endif /* HAVE_LIMITS_H */
#include <ctype.h>
#include <setjmp.h>
@@ -73,11 +71,8 @@
#error "gawk no longer supports non-C89 environments (no __STDC__ or __STDC__ < 1)"
#endif
-#if defined(HAVE_STDARG_H)
#include <stdarg.h>
-#else
-#error "gawk no longer supports <varargs.h>. Please update your compiler and runtime"
-#endif
+#include <stdbool.h>
#include <signal.h>
#include <time.h>
#include <errno.h>
@@ -89,11 +84,6 @@ extern int errno;
#include <stdlib.h>
#endif /* not STDC_HEADERS */
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#else
-#include "missing_d/gawkbool.h"
-#endif
/* We can handle multibyte strings. */
#include <wchar.h>
diff --git a/awkgram.c b/awkgram.c
index 3abb2e16..85544b84 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -7342,22 +7342,19 @@ check_funcs()
for (i = 0; i < HASHSIZE; i++) {
for (fp = ftable[i]; fp != NULL; fp = fp->next) {
-#ifdef REALLYMEAN
- /* making this the default breaks old code. sigh. */
- if (fp->defined == 0 && ! fp->extension) {
- error(
- _("function `%s' called but never defined"), fp->name);
- errcount++;
- }
-#else
- if (do_lint && fp->defined == 0 && ! fp->extension)
- lintwarn(
- _("function `%s' called but never defined"), fp->name);
-#endif
+ if (do_lint && ! fp->extension) {
+ /*
+ * Making this not a lint check and
+ * incrementing * errcount breaks old code.
+ * Sigh.
+ */
+ if (fp->defined == 0)
+ lintwarn(_("function `%s' called but never defined"),
+ fp->name);
- if (do_lint && fp->used == 0 && ! fp->extension) {
- lintwarn(_("function `%s' defined but never called directly"),
- fp->name);
+ if (fp->used == 0)
+ lintwarn(_("function `%s' defined but never called directly"),
+ fp->name);
}
}
}
@@ -8687,9 +8684,6 @@ install_builtins(void)
bool
is_alpha(int c)
{
-#ifdef I_DONT_KNOW_WHAT_IM_DOING
- return isalpha(c);
-#else /* ! I_DONT_KNOW_WHAT_IM_DOING */
switch (c) {
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
@@ -8704,7 +8698,6 @@ is_alpha(int c)
return true;
}
return false;
-#endif /* ! I_DONT_KNOW_WHAT_IM_DOING */
}
/* is_alnum --- return true for alphanumeric, English only letters */
diff --git a/awkgram.y b/awkgram.y
index 995b8bda..a3a51abd 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -4922,22 +4922,19 @@ check_funcs()
for (i = 0; i < HASHSIZE; i++) {
for (fp = ftable[i]; fp != NULL; fp = fp->next) {
-#ifdef REALLYMEAN
- /* making this the default breaks old code. sigh. */
- if (fp->defined == 0 && ! fp->extension) {
- error(
- _("function `%s' called but never defined"), fp->name);
- errcount++;
- }
-#else
- if (do_lint && fp->defined == 0 && ! fp->extension)
- lintwarn(
- _("function `%s' called but never defined"), fp->name);
-#endif
+ if (do_lint && ! fp->extension) {
+ /*
+ * Making this not a lint check and
+ * incrementing * errcount breaks old code.
+ * Sigh.
+ */
+ if (fp->defined == 0)
+ lintwarn(_("function `%s' called but never defined"),
+ fp->name);
- if (do_lint && fp->used == 0 && ! fp->extension) {
- lintwarn(_("function `%s' defined but never called directly"),
- fp->name);
+ if (fp->used == 0)
+ lintwarn(_("function `%s' defined but never called directly"),
+ fp->name);
}
}
}
@@ -6267,9 +6264,6 @@ install_builtins(void)
bool
is_alpha(int c)
{
-#ifdef I_DONT_KNOW_WHAT_IM_DOING
- return isalpha(c);
-#else /* ! I_DONT_KNOW_WHAT_IM_DOING */
switch (c) {
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
@@ -6284,7 +6278,6 @@ is_alpha(int c)
return true;
}
return false;
-#endif /* ! I_DONT_KNOW_WHAT_IM_DOING */
}
/* is_alnum --- return true for alphanumeric, English only letters */
diff --git a/configh.in b/configh.in
index 8c4d94d1..269b9aa6 100644
--- a/configh.in
+++ b/configh.in
@@ -108,9 +108,6 @@
/* Define if you have the libsigsegv library. */
#undef HAVE_LIBSIGSEGV
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
@@ -186,9 +183,6 @@
/* we have sockets on this system */
#undef HAVE_SOCKETS
-/* Define to 1 if you have the <stdarg.h> header file. */
-#undef HAVE_STDARG_H
-
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
@@ -341,9 +335,6 @@
/* Define to 1 if you have the `__etoa_l' function. */
#undef HAVE___ETOA_L
-/* enable severe portability problems */
-#undef I_DONT_KNOW_WHAT_IM_DOING
-
/* disable lint checks */
#undef NO_LINT
@@ -398,9 +389,6 @@
/* Define to 1 if the character set is EBCDIC */
#undef USE_EBCDIC
-/* force use of our version of strftime */
-#undef USE_INCLUDED_STRFTIME
-
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
diff --git a/configure b/configure
index c3246f84..36bf8ed7 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GNU Awk 4.2.1a.
+# Generated by GNU Autoconf 2.69 for GNU Awk 4.2.60.
#
# Report bugs to <bug-gawk@gnu.org>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='GNU Awk'
PACKAGE_TARNAME='gawk'
-PACKAGE_VERSION='4.2.1a'
-PACKAGE_STRING='GNU Awk 4.2.1a'
+PACKAGE_VERSION='4.2.60'
+PACKAGE_STRING='GNU Awk 4.2.60'
PACKAGE_BUGREPORT='bug-gawk@gnu.org'
PACKAGE_URL='http://www.gnu.org/software/gawk/'
@@ -763,9 +763,7 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_silent_rules
-with_whiny_user_strftime
enable_lint
-enable_severe_portability_problems
enable_builtin_intdiv0
enable_mpfr
enable_versioned_extension_dir
@@ -1332,7 +1330,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures GNU Awk 4.2.1a to adapt to many kinds of systems.
+\`configure' configures GNU Awk 4.2.60 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1402,7 +1400,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of GNU Awk 4.2.1a:";;
+ short | recursive ) echo "Configuration of GNU Awk 4.2.60:";;
esac
cat <<\_ACEOF
@@ -1413,8 +1411,6 @@ Optional Features:
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
--disable-lint do not compile in gawk lint checking
- --enable-severe-portability-problems
- allow really nasty portability problems
--enable-builtin-intdiv0
enable built-in intdiv0 function
--disable-mpfr do not check for MPFR
@@ -1432,9 +1428,6 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-whiny-user-strftime
- force use of included version of strftime for
- deficient systems
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
--without-libiconv-prefix don't search for libiconv in includedir and libdir
@@ -1529,7 +1522,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-GNU Awk configure 4.2.1a
+GNU Awk configure 4.2.60
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2238,7 +2231,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by GNU Awk $as_me 4.2.1a, which was
+It was created by GNU Awk $as_me 4.2.60, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3121,7 +3114,7 @@ fi
# Define the identity of the package.
PACKAGE='gawk'
- VERSION='4.2.1a'
+ VERSION='4.2.60'
cat >>confdefs.h <<_ACEOF
@@ -3217,18 +3210,6 @@ fi
-
-# Check whether --with-whiny-user-strftime was given.
-if test "${with_whiny_user_strftime+set}" = set; then :
- withval=$with_whiny_user_strftime; if test "$withval" = yes
- then
-
-$as_echo "#define USE_INCLUDED_STRFTIME 1" >>confdefs.h
-
- fi
-
-fi
-
# Check whether --enable-lint was given.
if test "${enable_lint+set}" = set; then :
enableval=$enable_lint; if test "$enableval" = no
@@ -3240,17 +3221,6 @@ $as_echo "#define NO_LINT 1" >>confdefs.h
fi
-# Check whether --enable-severe-portability-problems was given.
-if test "${enable_severe_portability_problems+set}" = set; then :
- enableval=$enable_severe_portability_problems; if test "$enableval" = yes
- then
-
-$as_echo "#define I_DONT_KNOW_WHAT_IM_DOING 1" >>confdefs.h
-
- fi
-
-fi
-
# Check whether --enable-builtin-intdiv0 was given.
if test "${enable_builtin_intdiv0+set}" = set; then :
enableval=$enable_builtin_intdiv0; if test "$enableval" = yes
@@ -8048,8 +8018,8 @@ $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
fi
-for ac_header in arpa/inet.h fcntl.h limits.h locale.h libintl.h mcheck.h \
- netdb.h netinet/in.h stdarg.h stddef.h string.h \
+for ac_header in arpa/inet.h fcntl.h locale.h libintl.h mcheck.h \
+ netdb.h netinet/in.h stddef.h string.h \
sys/ioctl.h sys/param.h sys/select.h sys/socket.h sys/time.h unistd.h \
termios.h stropts.h wchar.h wctype.h
do :
@@ -11615,7 +11585,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by GNU Awk $as_me 4.2.1a, which was
+This file was extended by GNU Awk $as_me 4.2.60, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -11683,7 +11653,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-GNU Awk config.status 4.2.1a
+GNU Awk config.status 4.2.60
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index e01513a1..792e7462 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ dnl
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([GNU Awk],[4.2.1a],[bug-gawk@gnu.org],[gawk])
+AC_INIT([GNU Awk],[4.2.60],[bug-gawk@gnu.org],[gawk])
# This is a hack. Different versions of install on different systems
# are just too different. Chuck it and use install-sh.
@@ -44,15 +44,6 @@ AM_INIT_AUTOMAKE([1.15 dist-xz dist-lzip])
AC_CONFIG_MACRO_DIR([m4])
-dnl Additional argument stuff
-AC_ARG_WITH(whiny-user-strftime,
- [AS_HELP_STRING([--with-whiny-user-strftime], [force use of included version of strftime for deficient systems])],
- if test "$withval" = yes
- then
- AC_DEFINE(USE_INCLUDED_STRFTIME, 1,
- [force use of our version of strftime])
- fi
-)
AC_ARG_ENABLE([lint],
[AS_HELP_STRING([--disable-lint],[do not compile in gawk lint checking])],
if test "$enableval" = no
@@ -60,13 +51,6 @@ AC_ARG_ENABLE([lint],
AC_DEFINE(NO_LINT, 1, [disable lint checks])
fi
)
-AC_ARG_ENABLE([severe-portability-problems],
- [AS_HELP_STRING([--enable-severe-portability-problems],[allow really nasty portability problems])],
- if test "$enableval" = yes
- then
- AC_DEFINE(I_DONT_KNOW_WHAT_IM_DOING, 1, [enable severe portability problems])
- fi
-)
AC_ARG_ENABLE([builtin-intdiv0],
[AS_HELP_STRING([--enable-builtin-intdiv0],[enable built-in intdiv0 function])],
if test "$enableval" = yes
@@ -172,8 +156,8 @@ AM_LANGINFO_CODESET
gt_LC_MESSAGES
dnl checks for header files
-AC_CHECK_HEADERS(arpa/inet.h fcntl.h limits.h locale.h libintl.h mcheck.h \
- netdb.h netinet/in.h stdarg.h stddef.h string.h \
+AC_CHECK_HEADERS(arpa/inet.h fcntl.h locale.h libintl.h mcheck.h \
+ netdb.h netinet/in.h stddef.h string.h \
sys/ioctl.h sys/param.h sys/select.h sys/socket.h sys/time.h unistd.h \
termios.h stropts.h wchar.h wctype.h)
AC_HEADER_STDC
diff --git a/custom.h b/custom.h
index 774659a6..468c1a50 100644
--- a/custom.h
+++ b/custom.h
@@ -63,11 +63,6 @@
#define HAVE_MKTIME 1
#endif
-/* For whiny users */
-#ifdef USE_INCLUDED_STRFTIME
-#undef HAVE_STRFTIME
-#endif
-
/* For HP/UX with gcc */
#if defined(hpux) || defined(_HPUX_SOURCE)
#undef HAVE_TZSET
diff --git a/doc/ChangeLog b/doc/ChangeLog
index b2e08a70..bfb58005 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -282,7 +282,12 @@
function to be syntactically and semantically correct. Thanks to
Jaromir Obr <jaromir.obr@gmail.com> for the report.
(POSIX String Comparison): Add some URL references in @ignore.
-
+
+ Unrelated:
+
+ * gawktexi.in: Remove description of --with-whiny-user-strftime
+ configuration option.
+
2017-10-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawktexi.in: Fix discussion of AWKPATH in section on @include.
diff --git a/doc/gawk.info b/doc/gawk.info
index 4ec14c92..2dcf8e64 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -29164,10 +29164,6 @@ command line when compiling 'gawk' from scratch, including:
possible to keep extensions for different API versions on the same
system without their conflicting with one another.
-'--with-whiny-user-strftime'
- Force use of the included version of the C 'strftime()' function
- for deficient systems.
-
Use the command './configure --help' to see the full list of options
supplied by 'configure'.
@@ -33120,8 +33116,6 @@ Index
* --traditional option, --posix option and: Options. (line 285)
* --use-lc-numeric option: Options. (line 232)
* --version option: Options. (line 317)
-* --with-whiny-user-strftime configuration option: Additional Configuration Options.
- (line 48)
* -b option: Options. (line 69)
* -c option: Options. (line 82)
* -C option: Options. (line 89)
@@ -33828,8 +33822,6 @@ Index
(line 37)
* configuration option, --enable-versioned-extension-dir: Additional Configuration Options.
(line 42)
-* configuration option, --with-whiny-user-strftime: Additional Configuration Options.
- (line 48)
* configuration options, gawk: Additional Configuration Options.
(line 6)
* constant regexps: Regexp Usage. (line 57)
@@ -36676,58 +36668,58 @@ Node: Unix Installation1171072
Node: Quick Installation1171754
Node: Shell Startup Files1174168
Node: Additional Configuration Options1175257
-Node: Configuration Philosophy1177550
-Node: Non-Unix Installation1179919
-Node: PC Installation1180379
-Node: PC Binary Installation1181217
-Node: PC Compiling1181652
-Node: PC Using1182769
-Node: Cygwin1185984
-Node: MSYS1187083
-Node: VMS Installation1187584
-Node: VMS Compilation1188375
-Ref: VMS Compilation-Footnote-11189604
-Node: VMS Dynamic Extensions1189662
-Node: VMS Installation Details1191347
-Node: VMS Running1193600
-Node: VMS GNV1197879
-Node: VMS Old Gawk1198614
-Node: Bugs1199085
-Node: Bug address1199748
-Node: Usenet1202540
-Node: Maintainers1203317
-Node: Other Versions1204578
-Node: Installation summary1211340
-Node: Notes1212542
-Node: Compatibility Mode1213407
-Node: Additions1214189
-Node: Accessing The Source1215114
-Node: Adding Code1216551
-Node: New Ports1222770
-Node: Derived Files1227258
-Ref: Derived Files-Footnote-11232904
-Ref: Derived Files-Footnote-21232939
-Ref: Derived Files-Footnote-31233537
-Node: Future Extensions1233651
-Node: Implementation Limitations1234309
-Node: Extension Design1235492
-Node: Old Extension Problems1236646
-Ref: Old Extension Problems-Footnote-11238164
-Node: Extension New Mechanism Goals1238221
-Ref: Extension New Mechanism Goals-Footnote-11241585
-Node: Extension Other Design Decisions1241774
-Node: Extension Future Growth1243887
-Node: Old Extension Mechanism1244723
-Node: Notes summary1246486
-Node: Basic Concepts1247668
-Node: Basic High Level1248349
-Ref: figure-general-flow1248631
-Ref: figure-process-flow1249316
-Ref: Basic High Level-Footnote-11252617
-Node: Basic Data Typing1252802
-Node: Glossary1256130
-Node: Copying1287968
-Node: GNU Free Documentation License1325511
-Node: Index1350631
+Node: Configuration Philosophy1177422
+Node: Non-Unix Installation1179791
+Node: PC Installation1180251
+Node: PC Binary Installation1181089
+Node: PC Compiling1181524
+Node: PC Using1182641
+Node: Cygwin1185856
+Node: MSYS1186955
+Node: VMS Installation1187456
+Node: VMS Compilation1188247
+Ref: VMS Compilation-Footnote-11189476
+Node: VMS Dynamic Extensions1189534
+Node: VMS Installation Details1191219
+Node: VMS Running1193472
+Node: VMS GNV1197751
+Node: VMS Old Gawk1198486
+Node: Bugs1198957
+Node: Bug address1199620
+Node: Usenet1202412
+Node: Maintainers1203189
+Node: Other Versions1204450
+Node: Installation summary1211212
+Node: Notes1212414
+Node: Compatibility Mode1213279
+Node: Additions1214061
+Node: Accessing The Source1214986
+Node: Adding Code1216423
+Node: New Ports1222642
+Node: Derived Files1227130
+Ref: Derived Files-Footnote-11232776
+Ref: Derived Files-Footnote-21232811
+Ref: Derived Files-Footnote-31233409
+Node: Future Extensions1233523
+Node: Implementation Limitations1234181
+Node: Extension Design1235364
+Node: Old Extension Problems1236518
+Ref: Old Extension Problems-Footnote-11238036
+Node: Extension New Mechanism Goals1238093
+Ref: Extension New Mechanism Goals-Footnote-11241457
+Node: Extension Other Design Decisions1241646
+Node: Extension Future Growth1243759
+Node: Old Extension Mechanism1244595
+Node: Notes summary1246358
+Node: Basic Concepts1247540
+Node: Basic High Level1248221
+Ref: figure-general-flow1248503
+Ref: figure-process-flow1249188
+Ref: Basic High Level-Footnote-11252489
+Node: Basic Data Typing1252674
+Node: Glossary1256002
+Node: Copying1287840
+Node: GNU Free Documentation License1325383
+Node: Index1350503

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index ce3be473..1ad59242 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -39808,11 +39808,6 @@ include the major and minor API versions in it. This makes it possible
to keep extensions for different API versions on the same system
without their conflicting with one another.
-@cindex @option{--with-whiny-user-strftime} configuration option
-@cindex configuration option, @code{--with-whiny-user-strftime}
-@item --with-whiny-user-strftime
-Force use of the included version of the C @code{strftime()}
-function for deficient systems.
@end table
Use the command @samp{./configure --help} to see the full list of
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index ee2870cc..b56a8364 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -38782,11 +38782,6 @@ include the major and minor API versions in it. This makes it possible
to keep extensions for different API versions on the same system
without their conflicting with one another.
-@cindex @option{--with-whiny-user-strftime} configuration option
-@cindex configuration option, @code{--with-whiny-user-strftime}
-@item --with-whiny-user-strftime
-Force use of the included version of the C @code{strftime()}
-function for deficient systems.
@end table
Use the command @samp{./configure --help} to see the full list of
diff --git a/doc/it/ChangeLog b/doc/it/ChangeLog
index ff39c948..121967e6 100644
--- a/doc/it/ChangeLog
+++ b/doc/it/ChangeLog
@@ -1,11 +1,60 @@
+2018-06-15 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Updates.
+
+2018-06-06 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Updates.
+
+2018-05-25 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Updates.
+
+2018-05-14 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Updates.
+ * texinfo.tex: Updated to current version.
+
+2018-05-12 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Updates.
+
+2018-03-30 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Updates.
+
+2018-03-11 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Updates modified month.
+
2018-02-25 Arnold D. Robbins <arnold@skeeve.com>
* 4.2.1: Release tar ball made.
+2018-02-17 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: More updates.
+
2017-02-17 Antonio Giovanni Colombo <azc100@gmail.com>
* gawk.1: Synchronized with English version.
+2018-02-10 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: More updates.
+
+2018-01-26 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: More updates.
+
+2018-01-18 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: More updates.
+
+2017-12-07 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Synchronize with English original.
+
2018-01-12 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Remove incorrect '*' on some declarations of
@@ -17,6 +66,10 @@
* gawk.1: New file. (Italian translation of the man page.)
+2017-12-05 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Italian translation updated.
+
2017-10-19 Arnold D. Robbins <arnold@skeeve.com>
* 4.2.0: Release tar ball made.
diff --git a/doc/it/gawktexi.in b/doc/it/gawktexi.in
index d29cdf03..01e3bca8 100644
--- a/doc/it/gawktexi.in
+++ b/doc/it/gawktexi.in
@@ -61,9 +61,9 @@
@c applies to and all the info about who's publishing this edition
@c These apply across the board.
-@set UPDATE-MONTH Ottobre 2017
+@set UPDATE-MONTH Maggio 2018
@set VERSION 4.2
-@set PATCHLEVEL 0
+@set PATCHLEVEL 1
@c added Italian hyphenation stuff
@hyphenation{ven-go-no o-met-te-re o-met-ten-do}
@@ -308,7 +308,7 @@ Some comments on the layout for TeX.
Tel.: +1-617-542-5942 Fax: +1-617-542-2652 Email: <email>gnu@@gnu.org</email>
URL: <ulink url="https://www.gnu.org">https://www.gnu.org/</ulink></literallayout>
-<literallayout class="normal">Copyright &copy; 1989, 1991, 1992, 1993, 1996&ndash;2005, 2007, 2009&ndash;2017
+<literallayout class="normal">Copyright &copy; 1989, 1991, 1992, 1993, 1996&ndash;2005, 2007, 2009&ndash;2018
Free Software Foundation, Inc.
All Rights Reserved.
</literallayout>
@@ -338,7 +338,8 @@ All Rights Reserved.
@ifnotdocbook
@iftex
-Copyright @copyright{} 2017 -- Free Software Foundation, Inc.
+Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2018 @*
+Free Software Foundation, Inc.
@end iftex
@end ifnotdocbook
@sp 2
@@ -422,7 +423,7 @@ URL: @uref{https://www.gnu.org/}
@c This one is correct for gawk 3.1.0 from the FSF
ISBN 1-882114-28-0
@sp 0
-Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2017 @*
+Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2018 @*
Free Software Foundation, Inc.
@sp 1
Traduzione e revisione:@*
@@ -508,7 +509,7 @@ Questo file documenta @command{awk}, un programma che si pu@`o usare per
selezionare dei record determinati in un file ed eseguire azioni su di essi.
@noindent
-Copyright dell'edizione originale @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2017 @*
+Copyright dell'edizione originale @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2018 @*
Free Software Foundation, Inc.
@noindent
@@ -1689,8 +1690,10 @@ del tipo:
@example
$ @kbd{awk 1 /dev/null}
+@group
@error{} awk: syntax error near line 1
@error{} awk: bailing out near line 1
+@end group
@end example
@noindent
@@ -2260,39 +2263,21 @@ di gestire una raccolta di programmi @command{awk} pubblicamente disponibili e
avevo anche esortato a collaborare. Rendere disponibili le cose su Internet
aiuta a contenere la distribuzione @command{gawk} entro dimensioni gestibili.
-L'iniziale raccolta di materiale, come questo, @`e tuttora disponibile
+L'iniziale raccolta di materiale, cos@`{@dotless{i}} com'@`e, @`e tuttora disponibile
su @uref{ftp://ftp.freefriends.org/arnold/Awkstuff}.
-Chi fosse @emph{seriamente} interessato a contribuire nell'implementazione
-di un sito Internet dedicato ad argomenti riguardanti il
-linguaggio @command{awk}, @`e pregato di contattarmi.
-
-@ignore
-Nella speranza di
-fare qualcosa di pi@`u esteso, acquisii il dominio @code{awk.info}.
-
-Tuttavia, mi accorsi che non potevo dedicare abbastanza tempo per la gestione
-del codice inviato dai collaboratori: l'archivio non cresceva e il dominio
-rimase in disuso per diversi anni.
+Nella speranza di fare qualcosa di pi@`u generale, ho acuisito il dominio
+@code{awklang.org}. A fine anno 2017 un volontario si @`e assunto il compito
+di gestirlo.
-Alla fine del 2008, un volontario si assunse il compito di mettere a punto
-un sito web collegato ad @command{awk}---@uref{http://awk.info}---e fece un
-lavoro molto ben fatto.
+Se qualcuno ha scritto un programma @command{awk} interessante, o
+un'estensione a @command{gawk} che vuole condividere col resto del mondo,
+@`e invitato a consultare la pagina @uref{http://www.awklang.org} e a usare
+il puntatore ``Contact''.
-Se qualcuno ha scritto un programma @command{awk} interessante, o un'estensione
-a @command{gawk} che vuole condividere col resto del mondo, @`e invitato a
-consultare la pagina @uref{http://awk.info/?contribute} per sapere come
-inviarlo per contribuire al sito web.
+Se qualcuno ha scritto un'estensione a @command{gawk}, si veda
+@ref{gawkextlib}.
-Mentre scrivo, questo sito @`e in cerca di un responsabile; se qualcuno @`e
-interessato mi contatti.
-@end ignore
-
-@ignore
-Altri collegamenti:
-
-https://www.reddit.com/r/linux/comments/dtect/composing_music_in_awk/
-@end ignore
@end ifclear
@node Ringraziamenti
@@ -2914,6 +2899,8 @@ messaggio di errore di qualche tipo da @command{awk}.
@cindex variabili @code{ARGC}/@code{ARGV}, portabilit@`a e
@cindex portabilit@`a, variabile @code{ARGV}
Infine, il valore di @code{ARGV[0]}
+@cindex angolo buio, @code{ARGV}, valore della variabile
+@cindex angolo buio, variabile @code{ARGV}, valore
(@pxref{Variabili predefinite})
pu@`o variare a seconda del sistema operativo.
Alcuni sistemi ci mettono @samp{awk}, altri il nome completo del percorso
@@ -3180,10 +3167,12 @@ per i caratteri
apice singolo e doppio, cos@`{@dotless{i}}:
@example
+@group
$ @kbd{awk 'BEGIN @{ print "Questo @`e un apice singolo <\47>" @}'}
@print{} Questo @`e un apice singolo <'>
$ @kbd{awk 'BEGIN @{ print "Questo @`e un doppio apice <\42>" @}'}
@print{} Questo @`e un doppio apice <">
+@end group
@end example
@noindent
@@ -3470,8 +3459,10 @@ e non ha azione---quindi applica l'azione di default, stampando il record.
Stampare la lunghezza della riga in input pi@`u lunga:
@example
+@group
awk '@{ if (length($0) > max) max = length($0) @}
END @{ print max @}' data
+@end group
@end example
Il codice associato a @code{END} viene eseguito dopo che tutto
@@ -3802,11 +3793,13 @@ un @samp{#} che inizia un commento, ignora @emph{tutto} il resto della riga.
Per esempio:
@example
+@group
$ @kbd{gawk 'BEGIN @{ print "Non allarmarti" # una amichevole \}
> @kbd{ regola BEGIN}
> @kbd{@}'}
@error{} gawk: riga com.:2: regola BEGIN
@error{} gawk: riga com.:2: ^ syntax error
+@end group
@end example
@noindent
@@ -4027,6 +4020,7 @@ awk '' file_dati_1 file_dati_2
@end example
@cindex @option{--lint}, opzione
+@cindex angolo buio, programmi vuoti
@noindent
Fare cos@`{@dotless{i}} ha comunque poco senso; @command{awk} termina
silenziosamente quando viene fornito un programma vuoto.
@@ -4269,7 +4263,7 @@ Quest'opzione @`e particolarmente necessaria per le applicazioni World Wide Web
CGI che passano argomenti attraverso le URL; l'uso di quest'opzione impedisce
a un utente malintenzionato (o ad altri) di passare opzioni, assegnamenti o
codice sorgente @command{awk} (con @option{-e}) all'applicazione
-CGI.@footnote{per maggiori dettagli,
+CGI.@footnote{Per maggiori dettagli,
si veda la Sezione 4.4 di @uref{http://www.ietf.org/rfc/rfc3875,
RFC 3875}. Si veda anche
@uref{https://lists.gnu.org/archive/html/bug-gawk/2014-11/msg00022.html,
@@ -4424,12 +4418,10 @@ Ora non @`e pi@`u cos@`{@dotless{i}}.
@cindex @option{--optimize}, opzione
@cindex @option{-O}, opzione
Abilita le ottimizzazioni di default nella rappresentazione interna del
-programma. Attualmente, questo comprende delle semplificazioni nell'uso
-di costanti e l'eliminazione delle code di chiamata nelle funzioni
-ricorsive [sostituzione della chiamata di funzione con dei salti
-diretti alla funzione].
+programma. Attualmente, questo comprende solo delle semplificazioni nell'uso
+di costanti.
-Queste ottimizzazioni sono abilitate per default.
+Quest'ottimizzazione @`e abilitata per default.
Quest'opzione rimane disponibile per compatibilit@`a all'indietro.
Tuttavia pu@`o essere usata per annullare l'effetto di una precedente
opzione @option{-s} (si veda pi@`u sotto in questa lista).
@@ -4893,6 +4885,16 @@ essere di aiuto per gestire la variabile @env{AWKPATH}.
@code{ENVIRON["AWKLIBPATH"]}. Questo consente di aver accesso al valore del
percorso di ricerca in uso all'interno di un programma @command{awk}.
+Sebbene sia possibile modificare la variabile @code{ENVIRON["AWKLIBPATH"]}
+all'interno di un programma @command{awk}, la modifica non ha effetto
+sul comportamento del programma in esecuzione.
+Il motivo @`e chiaro: la variabile d'ambiente
+@env{AWKLIBPATH} @`e usata per trovare eventuali estensioni richieste, e
+queste sono caricate prima che il programma inizi l'esecuzione. Dopo che
+il programma ha iniziato l'esecuzione, tutte le estensioni sono gi@`a state
+caricate, e @command{gawk} non ha pi@`u bisogno di usare la variabile d'ambiente
+@env{AWKLIBPATH}.
+
@node Altre variabili d'ambiente
@subsection Le variabili d'ambiente.
@@ -5086,10 +5088,12 @@ I file da includere possono essere nidificati; p.es., dato un terzo
@dfn{script}, che chiameremo @file{test3}:
@example
+@group
@@include "test2"
BEGIN @{
print "Questo @`e lo script test3."
@}
+@end group
@end example
@noindent
@@ -5187,8 +5191,10 @@ $ @kbd{gawk '@@load "ordchr"; BEGIN @{print chr(65)@}'}
Questo equivale all'esempio seguente:
@example
+@group
$ @kbd{gawk -lordchr 'BEGIN @{print chr(65)@}'}
@print{} A
+@end group
@end example
@noindent
@@ -5572,12 +5578,12 @@ Nuova pagina, @kbd{Ctrl-l}, codice ASCII 12 (FF).
@cindex @code{\} (barra inversa), @code{\n}, sequenza di protezione
@cindex barra inversa (@code{\}), @code{\n}, sequenza di protezione
@item \n
-A capo, @kbd{Ctrl-j}, codice ASCII 10 (LF).
+A-capo, @kbd{Ctrl-j}, codice ASCII 10 (LF).
@cindex @code{\} (barra inversa), @code{\r}, sequenza di protezione
@cindex barra inversa (@code{\}), @code{\r}, sequenza di protezione
@item \r
-Ritorno del carrello, @kbd{Ctrl-m}, codice ASCII 13 (CR).
+Ritorno-del-carrello, @kbd{Ctrl-m}, codice ASCII 13 (CR).
@cindex @code{\} (barra inversa), @code{\t}, sequenza di protezione
@cindex barra inversa (@code{\}), @code{\t}, sequenza di protezione
@@ -6088,8 +6094,7 @@ l'altro.)
caratteri di controllo).
@item @code{[:punct:]} @tab Caratteri di punteggiatura (caratteri che non
sono lettere, cifre, caratteri di controllo, o caratteri di spazio).
-@item @code{[:space:]} @tab Caratteri di spazio (come @dfn{spazio}, TAB, e
-@dfn{formfeed}, per citarne alcuni).
+@item @code{[:space:]} @tab Caratteri di spazio (ovvero: @dfn{spazio}, TAB, avanzamento riga (@dfn{newline}), ritorno a capo (@dfn{carriage return}), avanzamento pagina (@dfn{formfeed}) e tabulazione verticale)
@item @code{[:upper:]} @tab Caratteri alfabetici maiuscoli.
@item @code{[:xdigit:]} @tab Caratteri che sono cifre esadecimali.
@end multitable
@@ -6116,6 +6121,13 @@ dell'insieme di caratteri ASCII. Usando una lista di caratteri che esclude
(@samp{[^\x00-\x7F]}) si individuano tutti i caratteri mono-byte che non
sono nell'intervallo ASCII.
+@quotation NOTA
+Al momento (Maggio 2018), l'@command{awk} di Brian Kernighan
+tratta @code{[:blank:]} come @code{[:space:]}, individuando quindi
+pi@`u caratteri del dovuto. Gli @`e stata inviata una correzione,
+si spera che il problema verr@`a risolto.
+@end quotation
+
@cindex espressioni tra parentesi quadre, elementi di collazione
@cindex espressioni tra parentesi quadre, non-ASCII
@cindex elementi di collazione
@@ -6733,6 +6745,14 @@ numero totale di record in input gi@`a letti da tutti i @value{DF}.
Il suo valore iniziale @`e zero ma non viene mai reimpostata a zero
automaticamente.
+I record sono normalmente separati dal carattere di avanzamento riga
+(@dfn{newline}). @`E possibile specificare come vanno separati i record
+assegnando un valore alla variabile predefinita @code{RS}.
+Se il valore di @code{RS} @`e costituto da un solo carattere, @`e quello
+il carattere che fa da separatore fra i record.
+Altrimenti (in @command{gawk}), @code{RS} @`e valutata come espressione
+regolare. Questo meccanismo @`e spiegato pi@`u in dettaglio qui sotto.
+
@menu
* awk divisione record:: Come @command{awk} standard divide i record.
* gawk divisione record:: Come @command{gawk} divide i record.
@@ -6782,8 +6802,10 @@ a capo. Qui vediamo il risultato dell'esecuzione del programma sul file
@file{mail-list}:
@example
+@group
$ @kbd{awk 'BEGIN @{ RS = "u" @}}
> @kbd{@{ print $0 @}' mail-list}
+@end group
@print{} Amelia 555-5553 amelia.zodiac
@print{} sq
@print{} e@@gmail.com F
@@ -6860,6 +6882,14 @@ Usando un carattere insolito come @samp{/} @`e pi@`u probabile
che si ottenga un comportamento corretto nella maggioranza dei casi, ma non
c'@`e nessuna garanzia. La morale @`e: conosci i tuoi dati!
+@command{gawk} consente di usare per @code{RS} un'espressione regolare
+normale (descritta pi@`u avanti; @pxref{gawk divisione record}).
+Tuttavia, se l'espressione regolare @`e costituita da un singolo metacarattere,
+come p.es. @samp{.} che assegni il valore di @code{RS}, il metacarattere
+in questione non viene trattato come tale, ma viene usato letteralmente.
+Ci@`o viene fatto per compatibilit@`a all'indietro sia con il comando
+Unix @command{awk} che con lo standard POSIX.
+
Quando si usano caratteri normali come separatore di record,
c'@`e un caso insolito che capita quando @command{gawk}
@`e reso completamente conforme a POSIX (@pxref{Opzioni}).
@@ -6914,7 +6944,8 @@ imposta la variabile @code{RT} al testo nell'input che corrisponde a
@cindex comuni, estensioni@comma{} @code{RS} come espressione regolare
Quando si usa @command{gawk},
il valore di @code{RS} non @`e limitato a una stringa costituita da un solo
-carattere, ma pu@`o essere qualsiasi espressione regolare
+carattere. Se contiene pi@`u di un carattere, @`e considerato essere
+un'espressione regolare
@iftex
(@pxrefil{Espressioni regolari}). @value{COMMONEXT}
@end iftex
@@ -6945,9 +6976,11 @@ cerca sia un ritorno a capo che una serie di una o pi@`u lettere
maiuscole con uno spazio vuoto opzionale iniziale e/o finale:
@example
+@group
$ @kbd{echo record 1 AAAA record 2 BBBB record 3 |}
> @kbd{gawk 'BEGIN @{ RS = "\n|( *[[:upper:]]+ *)" @}}
> @kbd{@{ print "Record =", $0,"e RT = [" RT "]" @}'}
+@end group
@print{} Record = record 1 e RT = [ AAAA ]
@print{} Record = record 2 e RT = [ BBBB ]
@print{} Record = record 3 e RT = [
@@ -7333,8 +7366,10 @@ dei campi e @code{OFS}. Per far ci@`o, si usa
l'apparentemente innocuo assegnamento:
@example
+@group
$1 = $1 # forza la ricostruzione del record
print $0 # o qualsiasi altra cosa con $0
+@end group
@end example
@noindent
@@ -8197,16 +8232,20 @@ e divide i dati:
@example
@c file eg/misc/simple-csv.awk
+@group
BEGIN @{
FPAT = "([^,]+)|(\"[^\"]+\")"
@}
+@end group
+@group
@{
print "NF = ", NF
for (i = 1; i <= NF; i++) @{
printf("$%d = <%s>\n", i, $i)
@}
@}
+@end group
@c endfile
@end example
@@ -8673,6 +8712,7 @@ e controlla ogni regola" non la veda affatto.
L'esempio seguente inverte tra loro a due a due le righe in input:
@example
+@group
@{
if ((getline tmp) > 0) @{
print tmp
@@ -8680,6 +8720,7 @@ L'esempio seguente inverte tra loro a due a due le righe in input:
@} else
print $0
@}
+@end group
@end example
@noindent
@@ -8825,6 +8866,7 @@ sostituite dall'output prodotto dall'esecuzione del resto della riga
costituito da un comando di shell.
@example
+@group
@{
if ($1 == "@@execute") @{
tmp = substr($0, 10) # Rimuove "@@execute"
@@ -8834,6 +8876,7 @@ costituito da un comando di shell.
@} else
print
@}
+@end group
@end example
@noindent
@@ -9162,12 +9205,14 @@ specificato. Per esempio, un cliente TCP pu@`o decidere di abbandonare se
non riceve alcuna risposta dal server dopo un certo periodo di tempo:
@example
+@group
Service = "/inet/tcp/0/localhost/daytime"
PROCINFO[Service, "READ_TIMEOUT"] = 100
if ((Service |& getline) > 0)
print $0
else if (ERRNO != "")
print ERRNO
+@end group
@end example
Qui vediamo come ottenere dati interattivamente dall'utente@footnote{Questo
@@ -9542,10 +9587,12 @@ ritorni a capo:
@end ifnotinfo
@example
+@group
$ @kbd{awk 'BEGIN @{ print "riga uno\nriga due\nriga tre" @}'}
@print{} riga uno
@print{} riga due
@print{} riga tre
+@end group
@end example
@cindex campi, stampare
@@ -9751,7 +9798,7 @@ $ @kbd{awk 'BEGIN @{}
@cindex variabile @code{OFMT}, POSIX @command{awk} e
Per lo standard POSIX, il comportamento di @command{awk} @`e indefinito
se @code{OFMT} contiene qualcosa di diverso da una specifica di conversione
-di un numero a virgola mobile.
+di un numero in virgola mobile.
@value{DARKCORNER}
@node Printf
@@ -9819,12 +9866,14 @@ effetto sulle istruzioni @code{printf}.
Per esempio:
@example
+@group
$ @kbd{awk 'BEGIN @{}
> @kbd{ORS = "\nAHI!\n"; OFS = "+"}
> @kbd{msg = "Non v\47allarmate!"}
> @kbd{printf "%s\n", msg}
> @kbd{@}'}
@print{} Non v'allarmate!
+@end group
@end example
@noindent
@@ -9848,6 +9897,27 @@ lettere di controllo del formato:
@c @asis for docbook to come out right
@table @asis
+@item @code{%a}, @code{%A}
+Un numero in virgola mobile scritto nella forma
+[@code{-}]@code{0x@var{h}.@var{hhhh}p+-@var{dd}}
+(formato esadecimale virgola mobile nel compilatore C99).
+Per @code{%A},
+si usano lettere maiuscole invece che lettere minuscole.
+
+@quotation NOTA
+Anche se lo standard POSIX in vigore richiede il supporto di @code{%a}
+e @code{%A} in @command{awk}, per quanto ci consta, nessun'altra versione
+di @command{awk} supporta questo formato. Se lo si usa, il programma
+in questione @`e quindi estremamente non-portabile!
+
+Inoltre, questi formati non sono disponibili su alcun sistema in cui
+la funzione di libreria C @code{printf()} utilizzata da @command{gawk}
+non li supporta.
+Al momento in cui questo libro @`e stato scritto, fra i sistemi su cui
+@`e stato portato @command{gawk}, il solo sistema noto che
+non li supporta @`e OpenVMS.
+@end quotation
+
@item @code{%c}
Stampa un numero come un carattere; quindi, @samp{printf "%c",
65} stampa la lettera @samp{A}. L'output per un valore costituito da una
@@ -9870,6 +9940,7 @@ carattere da stampare.
Altre versioni di @command{awk} generalmente si limitano a stampare
il primo byte di una stringa o i valori numerici che possono essere
rappresentati in un singolo byte (0--255).
+@value{DARKCORNER}
@end quotation
@@ -9896,7 +9967,7 @@ introdotti nella prossima @value{SUBSECTION}).
@samp{%E} usa @samp{E} invece di @samp{e} nell'output.
@item @code{%f}
-Stampa un numero in notazione a virgola mobile.
+Stampa un numero in notazione in virgola mobile.
Per esempio:
@example
@@ -9909,7 +9980,7 @@ delle quali vengono dopo il punto decimale.
(L'espressione @samp{4.3} rappresenta due modificatori,
introdotti nella prossima @value{SUBSECTION}).
-In sistemi che implementano il formato a virgola mobile, come specificato
+In sistemi che implementano il formato in virgola mobile, come specificato
dallo standard IEEE 754, il valore infinito negativo @`e rappresentato come
@samp{-inf} o @samp{-infinity},
e l'infinito positivo come
@@ -9927,7 +9998,7 @@ i sistemi lo prevedono. In tali casi,
@command{gawk} usa il formato @samp{%f}.
@item @code{%g}, @code{%G}
-Stampa un numero usando o la notazione scientifica o quella a virgola
+Stampa un numero usando o la notazione scientifica o quella in virgola
mobile, scegliendo la forma pi@`u concisa; se il risultato @`e stampato usando la
notazione scientifica, @samp{%G} usa @samp{E} invece di @samp{e}.
@@ -9941,7 +10012,7 @@ Stampa una stringa.
@item @code{%u}
Stampa un numero intero decimale, senza segno.
(Questo formato @`e poco usato, perch@'e tutti i numeri in @command{awk}
-sono a virgola mobile; @`e disponibile principalmente per compatibilit@`a col
+sono in virgola mobile; @`e disponibile principalmente per compatibilit@`a col
linguaggio C.)
@item @code{%x}, @code{%X}
@@ -10061,7 +10132,7 @@ di quella del valore da stampare.
@item @code{'}
Un carattere di apice singolo o un apostrofo @`e un'estensione POSIX allo
standard ISO C.
-Indica che la parte intera di un valore a virgola mobile, o la parte intera
+Indica che la parte intera di un valore in virgola mobile, o la parte intera
di un valore decimale intero, ha un carattere di separazione delle migliaia.
Ci@`o @`e applicabile solo alle localizzazioni che prevedono un tale carattere.
Per esempio:
@@ -10386,9 +10457,11 @@ alone for now and let's hope no-one notices.
@end ignore
@example
+@group
awk '@{ print $1 > "nomi.non.ordinati"
comando = "sort -r > nomi.ordinati"
print $1 | comando @}' mail-list
+@end group
@end example
La lista non ordinata @`e scritta usando una ridirezione normale, mentre
@@ -10703,12 +10776,12 @@ Questo avviene usando uno speciale @value{FN} della forma:
@file{/@var{tipo-rete}/@var{protocollo}/@var{porta-locale}/@var{host-remoto}/@var{porta-remota}}
@end example
-il @var{tipo-rete} pu@`o essere @samp{inet}, @samp{inet4} o @samp{inet6}.
+Il @var{tipo-rete} pu@`o essere @samp{inet}, @samp{inet4} o @samp{inet6}.
Il @var{protocollo} pu@`o essere @samp{tcp} o @samp{udp},
e gli altri campi rappresentano gli altri dati essenziali
necessari per realizzare una connessione di rete.
Questi @value{FNS} sono usati con l'operatore @samp{|&} per comunicare
-con un coprocesso
+con @w{un coprocesso}
(@pxref{I/O bidirezionale}).
Questa @`e una funzionalit@`a avanzata, qui riferita solo per completezza.
Una spiegazione esauriente sar@`a fornita nella
@@ -10811,10 +10884,14 @@ essere uguale all'espressione usata per aprire il file o eseguire il comando,
Il precedente esempio cambia come segue:
@example
+@group
sortcom = "sort -r nomi"
sortcom | getline pippo
+@end group
+@group
@dots{}
close(sortcom)
+@end group
@end example
@noindent
@@ -11486,6 +11563,7 @@ argomenti di funzioni definite dall'utente
(@pxref{Funzioni definite dall'utente}). Per esempio:
@example
+@group
function mysub(modello, sostituzione, stringa, globale)
@{
if (globale)
@@ -11494,13 +11572,16 @@ function mysub(modello, sostituzione, stringa, globale)
sub(modello, sostituzione, stringa)
return stringa
@}
+@end group
+@group
@{
@dots{}
text = "salve! salve a te!"
mysub(/salve/, "ciao", text, 1)
@dots{}
@}
+@end group
@end example
@c @cindex automatic warnings
@@ -11786,8 +11867,10 @@ Se in una concatenazione di stringhe ci sono valori numerici, questi sono
convertiti in stringhe. Si consideri il seguente esempio:
@example
+@group
due = 2; tre = 3
print (due tre) + 4
+@end group
@end example
@noindent
@@ -12288,10 +12371,14 @@ assegnato per ultimo. Nel seguente frammento di programma, la variabile
@code{pippo} ha dapprima un valore numerico, e in seguito un valore di stringa:
@example
+@group
pippo = 1
print pippo
+@end group
+@group
pippo = "pluto"
print pippo
+@end group
@end example
@noindent
@@ -12364,16 +12451,20 @@ di sinistra nell'espressione di destra. Per esempio:
@cindex Rankin, Pat
@example
+@group
# Grazie a Pat Rankin per quest'esempio
BEGIN @{
pippo[rand()] += 5
for (x in pippo)
print x, pippo[x]
-
+@end group
+
+@group
pluto[rand()] = pluto[rand()] + 5
for (x in pluto)
print x, pluto[x]
@}
+@end group
@end example
@cindex operatori di assegnamento, ordine di valutazione
@@ -13073,10 +13164,12 @@ omettendo uno dei due caratteri @samp{=}. Il risultato @`e sempre un codice
@command{awk} valido, ma il programma non fa quel che si voleva:
@example
+@group
if (a = b) # oops! dovrebbe essere == b
@dots{}
else
@dots{}
+@end group
@end example
@noindent
@@ -14079,8 +14172,10 @@ $ @kbd{awk '! /li/' mail-list}
@print{} Bill 555-1675 bill.drowning@@hotmail.com A
@print{} Camilla 555-2912 camilla.infusarum@@skynet.be R
@print{} Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+@group
@print{} Martin 555-6480 martin.codicibus@@hotmail.com A
@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
+@end group
@end example
@cindex @code{BEGIN}, criterio di ricerca, criteri di ricerca booleani e
@@ -14200,6 +14295,7 @@ $ @kbd{echo Yes | gawk '(/1/,/2/) || /Yes/'}
@end example
@cindex intervalli di ricerca, continuazione di riga e
+@cindex angolo buio, intervalli di ricerca, continuazione di riga e
Come punto di secondaria importanza, nonostante sia stilisticamente poco elegante,
lo standard POSIX consente di andare a capo dopo la virgola
in un intervallo di ricerca. @value{DARKCORNER}
@@ -14515,10 +14611,12 @@ variabile nel progamma @command{awk} contenuto nello @dfn{script}:
Per esempio, si consideri il programma seguente:
@example
+@group
printf "Immettere il criterio di ricerca: "
read criterio_di_ricerca
awk "/$criterio_di_ricerca/ "'@{ num_trov++ @}
END @{ print num_trov, "occorrenze trovate" @}' /nome/file/dati
+@end group
@end example
@noindent
@@ -14734,10 +14832,12 @@ la stringa nulla; altrimenti, la condizione @`e vera.
Si consideri quanto segue:
@example
+@group
if (x % 2 == 0)
print "x @`e pari"
else
print "x @`e dispari"
+@end group
@end example
In questo esempio, se l'espressione @samp{x % 2 == 0} @`e vera (cio@`e,
@@ -14916,8 +15016,8 @@ awk '
@end example
@noindent
-Questo programma stampa i primi tre campi di ogni record in input, mettendo
-un campo su ogni riga.
+Questo programma stampa i primi tre campi di ogni record in input,
+mettendo un unico campo in una riga in output.
Non @`e possibile impostare
pi@`u di una variabile nella parte di
@@ -15089,6 +15189,7 @@ trova, se esiste, il divisore pi@`u piccolo di un dato numero intero, oppure
dichiara che si tratta di un numero primo:
@example
+@group
# trova il divisore pi@`u piccolo di num
@{
num = $1
@@ -15096,11 +15197,14 @@ dichiara che si tratta di un numero primo:
if (num % divisore == 0)
break
@}
+@end group
+@group
if (num % divisore == 0)
printf "Il pi@`u piccolo divisore di %d @`e %d\n", num, divisore
else
printf "%d @`e un numero primo\n", num
@}
+@end group
@end example
Quando il resto della divisione @`e zero nella prima istruzione @code{if},
@@ -15436,14 +15540,18 @@ segnalano terminando con un codice di ritorno diverso da zero. Un programma
diverso da zero, come mostrato nell'esempio seguente:
@example
+@group
BEGIN @{
if (("date" | getline data_corrente) <= 0) @{
print "Non riesco a ottenere la data dal sistema" > "/dev/stderr"
exit 1
@}
+@end group
+@group
print "la data corrente @`e", data_corrente
close("date")
@}
+@end group
@end example
@quotation NOTA
@@ -15705,7 +15813,7 @@ il carattere di ritorno a capo.
@cindex @code{PREC}, variabile
@cindex variabile @code{PREC}
@item PREC #
-La precisione disponibile nei numeri a virgola mobile a precisione arbitraria,
+La precisione disponibile nei numeri in virgola mobile a precisione arbitraria,
per default 53 bit (@pxref{Impostare la precisione}).
@cindex @code{ROUNDMODE}, variabile
@@ -15798,6 +15906,7 @@ A differenza di quasi tutti i vettori di @command{awk},
Lo si pu@`o vedere nell'esempio seguente:
@example
+@group
$ @kbd{awk 'BEGIN @{}
> @kbd{for (i = 0; i < ARGC; i++)}
> @kbd{print ARGV[i]}
@@ -15805,6 +15914,7 @@ $ @kbd{awk 'BEGIN @{}
@print{} awk
@print{} inventory-shipped
@print{} mail-list
+@end group
@end example
@noindent
@@ -16165,17 +16275,17 @@ gruppi supplementari che il processo [Unix] possiede. Si usi l'operatore
I seguenti elementi consentono di modificare il comportamento di
@command{gawk}:
+@table @code
@item PROCINFO["NONFATAL"]
Se questo elemento esiste, gli errori di I/O per tutte le ridirezioni
-consentono la prosecuzizone del programma.
+consentono la prosecuzione del programma.
@xref{Continuazione dopo errori}.
-@item PROCINFO["@var{nome_output}", "NONFATAL"]
-Gli errori in output per il file @var{nome_output}
-consentono la prosecuzizone del programma.
+@item PROCINFO["@var{nome}", "NONFATAL"]
+Gli errori di I/O per il file @var{nome}
+consentono la prosecuzione del programma.
@xref{Continuazione dopo errori}.
-@table @code
@item PROCINFO["@var{comando}", "pty"]
Per una comunicazione bidirezionale con @var{comando}, si usi una pseudo-tty
invece di impostare una @dfn{pipe} bidirezionale.
@@ -16186,7 +16296,7 @@ Imposta un tempo limite per leggere dalla ridirezione di input @var{input_name}.
@xref{Timeout in lettura} per ulteriori informazioni.
@item PROCINFO["@var{input_name}", "RETRY"]
-Se durante la lettura del file @var{input_name}si verifica un errore di I/O
+Se durante la lettura del file @var{input_name} si verifica un errore di I/O
per il quale si pu@`o ritentare una lettura, e questo elemento di vettore
esiste, @code{getline} d@`a come codice di ritorno @minus{}2 invece di
seguire il comportamento di default, che consiste nel restituire @minus{}1
@@ -16205,7 +16315,7 @@ l'ordine in cui gli indici dei vettori saranno elaborati nei cicli
@samp{for (@var{indice} in @var{vettore})}.
Questa @`e una funzionalit@`a avanzata, la cui descrizione completa sar@`a vista
pi@`u avanti; si veda
-@ref{Visitare un intero vettore}.
+@ref{Controllare visita}.
@end table
@cindex @code{RLENGTH}, variabile
@@ -16284,6 +16394,7 @@ Schorr fa notare che effettivamente consente di ottenere dei puntatori ai dati
in @command{awk}. Si consideri quest'esempio:
@example
+@group
# Moltiplicazione indiretta di una qualsiasi variabile per un
# numero a piacere e restituzione del risultato
@@ -16291,6 +16402,7 @@ function multiply(variabile, numero)
@{
return SYMTAB[variabile] *= numero
@}
+@end group
@end example
@noindent
@@ -16369,6 +16481,7 @@ conteneva il programma seguente che visualizzava le informazioni contenute
in @code{ARGC} e @code{ARGV}:
@example
+@group
$ @kbd{awk 'BEGIN @{}
> @kbd{for (i = 0; i < ARGC; i++)}
> @kbd{print ARGV[i]}
@@ -16376,6 +16489,7 @@ $ @kbd{awk 'BEGIN @{}
@print{} awk
@print{} inventory-shipped
@print{} mail-list
+@end group
@end example
@noindent
@@ -17001,8 +17115,10 @@ Per esempio, quest'istruzione verifica se il vettore @code{frequenze}
contiene l'indice @samp{2}:
@example
+@group
if (2 in frequenze)
print "L'indice 2 @`e presente."
+@end group
@end example
Si noti che questo @emph{non} verifica se il vettore
@@ -17012,8 +17128,10 @@ elementi. Inoltre, questo @emph{non} crea @code{frequenze[2]}, mentre la
seguente alternativa (non corretta) lo fa:
@example
+@group
if (frequenze[2] != "")
print "L'indice 2 @`e presente."
+@end group
@end example
@node Impostare elementi
@@ -17071,6 +17189,7 @@ stampare tutte le righe.
Quando questo programma viene eseguito col seguente input:
@example
+@group
@c file eg/misc/arraymax.data
5 Io sono l'uomo Cinque
2 Chi sei? Il nuovo numero due!
@@ -17078,17 +17197,20 @@ Quando questo programma viene eseguito col seguente input:
1 Chi @`e il numero uno?
3 Sei il tre.
@c endfile
+@end group
@end example
@noindent
Il suo output @`e:
@example
+@group
1 Chi @`e il numero uno?
2 Chi sei? Il nuovo numero due!
3 Sei il tre.
4 . . . E quattro a terra
5 Io sono l'uomo Cinque
+@end group
@end example
Se un numero di riga appare pi@`u di una volta, l'ultima riga con quel dato
@@ -17098,11 +17220,13 @@ si possono saltare con un semplice perfezionamento della
regola @code{END} del programma, in questo modo:
@example
+@group
END @{
for (x = 1; x <= massimo; x++)
if (x in vett)
print vett[x]
@}
+@end group
@end example
@node Visitare un intero vettore
@@ -17123,8 +17247,10 @@ fare da indice in un vettore. Perci@`o @command{awk} ha un tipo speciale di
istruzione @code{for} per visitare un vettore:
@example
+@group
for (@var{variabile} in @var{vettore})
@var{corpo}
+@end group
@end example
@noindent
@@ -17147,12 +17273,15 @@ anche il numero di tali parole.
per maggiori informazioni sulla funzione predefinita @code{length()}.
@example
+@group
# Registra un 1 per ogni parola usata almeno una volta
@{
for (i = 1; i <= NF; i++)
usate[$i] = 1
@}
+@end group
+@group
# Trova il numero di parole distinte lunghe pi@`u di 10 caratteri
END @{
for (x in usate) @{
@@ -17163,6 +17292,7 @@ END @{
@}
print numero_parole_lunghe, "parole pi@`u lunghe di 10 caratteri"
@}
+@end group
@end example
@noindent
@@ -17571,9 +17701,11 @@ che assegnargli un valore nullo (la stringa vuota, @code{""}).
Per esempio:
@example
+@group
pippo[4] = ""
if (4 in pippo)
- print "Questo viene stampato, anche se pippo[4] @`e vuoto"
+ print "Questa riga viene stampata, anche se pippo[4] @`e vuoto"
+@end group
@end example
@cindex @dfn{lint}, controlli, elementi di vettori
@@ -17734,22 +17866,26 @@ END @{
Dato l'input:
@example
+@group
1 2 3 4 5 6
2 3 4 5 6 1
3 4 5 6 1 2
4 5 6 1 2 3
+@end group
@end example
@noindent
il programma produce il seguente output:
@example
+@group
4 3 2 1
5 4 3 2
6 5 4 3
1 6 5 4
2 1 6 5
3 2 1 6
+@end group
@end example
@node Visitare vettori multidimensionali
@@ -17937,15 +18073,19 @@ Per esempio,
il seguente codice stampa gli elementi del nostro vettore principale @code{a}:
@example
+@group
for (i in a) @{
for (j in a[i]) @{
if (j == 3) @{
for (k in a[i][j])
print a[i][j][k]
+@end group
+@group
@} else
print a[i][j]
@}
@}
+@end group
@end example
@noindent
@@ -18445,9 +18585,11 @@ asort(a)
genera i seguenti contenuti di @code{a}:
@example
+@group
a[1] = "cul"
a[2] = "de"
a[3] = "sac"
+@end group
@end example
La funzione @code{asorti()} si comporta in maniera simile ad @code{asort()};
@@ -18472,8 +18614,9 @@ Se @var{come} @`e una stringa che inizia
con @samp{g} o @samp{G} (abbreviazione di ``global''), sostituisce
ogni occorrenza di @var{regexp} con la stringa
@var{rimpiazzo}. Altrimenti, @var{come} @`e visto come un numero che indica
-quale corrispondenza di @var{regexp} va rimpiazzata. Se non si specifica
-il nome dell'@var{obiettivo}, si
+quale corrispondenza di @var{regexp} va rimpiazzata. Valori numerici
+inferiori a uno vengono gestiti come se avessero il valore uno.
+Se non si specifica il nome dell'@var{obiettivo}, si
opera su @code{$0}. La funzione restituisce come risultato la stringa
modificata, e la stringa originale di partenza @emph{non} viene modificata.
@@ -19601,6 +19744,9 @@ buffer di un file o @dfn{pipe} che era stato aperto in lettura
o se @var{nome_file} non @`e un file, una @dfn{pipe}, o un coprocesso aperto.
in tal caso, @code{fflush()} restituisce ancora @minus{}1.
+@c end the table to let the sidebar take up the full width of the page.
+@end table
+
@sidebar Bufferizzazione interattiva e non interattiva
@cindex bufferizzazione, interattiva vs.@: non interattiva
@@ -19648,6 +19794,7 @@ In questo caso, nessun output viene stampato finch@'e non @`e stato battuto il
@dfn{pipe} al comando @command{cat} in un colpo solo.
@end sidebar
+@table @asis
@item @code{system(@var{comando})}
@cindexawkfunc{system}
@cindex chiamare comandi di shell
@@ -19712,7 +19859,7 @@ semplicemente limitata a restituire il valore del codice di ritorno
diviso per 256 (ossia la met@`a sinistra del numero di 16 bit, spostata
a destra). In una situazione normale questo equivale a utilizzare il
codice di ritornodi @code{system()}, ma nel caso in cui il programma sia
-stato terminato da un segnale, il valore diventa un numero frazionale a
+stato terminato da un segnale, il valore diventa un numero frazionale in
virgola mobile.@footnote{In uno scambio di messaggi privato il Dr.@:
Kernighan mi ha comunicato che questo modo di procedere @`e probabilmente
errato.} POSIX stabilisce che la chiamata a @code{system()} dall'interno
@@ -20391,7 +20538,7 @@ le operazioni a livello di bit.
I parametri facoltativi sono racchiusi tra parentesi quadre ([ ]):
@cindex @command{gawk}, operazioni a livello di bit in
-@table @code
+@table @asis
@cindexgawkfunc{and}
@cindex AND, operazione sui bit
@item @code{and(}@var{v1}@code{,} @var{v2} [@code{,} @dots{}]@code{)}
@@ -20445,7 +20592,7 @@ che illustra l'uso di queste funzioni:
@example
@group
@c file eg/lib/bits2str.awk
-# bits2str --- decodifica un byte in una serie di 0/1 leggibili
+# bits2str --- decodifica un numero intero in una serie di 0/1 leggibili
function bits2str(byte, dati, maschera)
@{
@@ -20467,7 +20614,7 @@ function bits2str(byte, dati, maschera)
@c this is a hack to make testbits.awk self-contained
@ignore
@c file eg/prog/testbits.awk
-# bits2str --- turn a byte into readable 1's and 0's
+# bits2str --- turn an integer into readable ones and zeros
function bits2str(bits, data, mask)
@{
@@ -20508,8 +20655,8 @@ $ @kbd{gawk -f testbits.awk}
@print{} 123 = 01111011
@print{} 0123 = 01010011
@print{} 0x99 = 10011001
-@print{} compl(0x99) = 0x3fffffffffff66 = 001111111111111111111111111111111
-@print{} 11111111111111101100110
+@print{} compl(0x99) = 0x3fffffffffff66 =
+@print{} 00111111111111111111111111111111111111111111111101100110
@print{} lshift(0x99, 2) = 0x264 = 0000001001100100
@print{} rshift(0x99, 2) = 0x26 = 00100110
@end example
@@ -20546,14 +20693,14 @@ e poi mostra i risultati delle funzioni
@sidebar Attenzione. Non @`e tutto oro quel che luccica!
In altri linguaggi, le operazioni "bit a bit" sono eseguite su valori interi,
-non su valori a virgola mobile. Come regola generale, tali operazioni
+non su valori in virgola mobile. Come regola generale, tali operazioni
funzionano meglio se eseguite su interi senza segno.
@command{gawk} tenta di trattare gli argomenti delle funzioni
"bit a bit" come interi senza segno. Per questo motivo, gli argomenti negativi
provocano un errore fatale.
-In una normale operazione, per tutte queste funzioni, prima il valore a virgola
+In una normale operazione, per tutte queste funzioni, prima il valore in virgola
mobile a doppia precisione viene convertito nel tipo intero senza segno di C
pi@`u ampio, poi viene eseguita l'operazione "bit a bit". Se il risultato non
pu@`o essere rappresentato esattamente come un tipo @code{double} di C,
@@ -20588,13 +20735,14 @@ $ @kbd{gawk -M 'BEGIN @{ printf "%#x\n", compl(42) @}'}
Quando si usa l'opzione @option{-M}, nel dettaglio, @command{gawk} usa
gli interi a precisione arbitraria di GNU MP che hanno almeno 64 bit di precisione.
Quando non si usa l'opzione @option{-M}, @command{gawk} memorizza i valori
-interi come regolari valori a virgola mobile con doppia precisione, che
+interi come regolari valori in virgola mobile con doppia precisione, che
mantengono solo 53 bit di precisione. Inoltre, la libreria GNU MP tratta
-(o almeno sembra che tratti) il bit iniziale come un bit con segno; cos@`i il
+(o almeno sembra che tratti) il bit iniziale come un bit con segno;
+cos@`{@dotless{i}} il
risultato con @option{-M} in questo caso @`e un numero negativo.
In breve, usare @command{gawk} per qualsiasi tipo di operazione "bit a bit",
-tranne le pi@`u semplici, probabilmente @`e una cattiva idea; caveat emptor!
+tranne le pi@`u semplici, probabilmente @`e una cattiva idea; @dfn{caveat emptor}!
@end sidebar
@@ -20799,10 +20947,12 @@ legge l'intero programma, prima di iniziare ad eseguirlo.
La definizione di una funzione chiamata @var{nome} @`e simile a questa:
@display
+@group
@code{function} @var{nome}@code{(}[@var{lista-parametri}]@code{)}
@code{@{}
@var{corpo-della-funzione}
@code{@}}
+@end group
@end display
@cindex nomi di funzione
@@ -20989,11 +21139,13 @@ La funzione seguente cancella tutti gli elementi in un vettore
l'inizio della lista delle variabili locali):
@example
+@group
function cancella_vettore(a, i)
@{
for (i in a)
delete a[i]
@}
+@end group
@end example
Quando si lavora con vettori, @`e spesso necessario cancellare
@@ -21215,10 +21367,12 @@ Inoltre, chiamate ricorsive creano nuovi vettori.
Si consideri questo esempio:
@example
+@group
function qualche_funz(p1, a)
@{
if (p1++ > 3)
return
+@end group
a[p1] = p1
@@ -21283,12 +21437,14 @@ locali, ci@`o non influisce su nessun'altra variabile. Quindi, se
@code{mia_funzione()} fa questo:
@example
+@group
function mia_funzione(stringa)
@{
print stringa
stringa = "zzz"
print stringa
@}
+@end group
@end example
@noindent
@@ -21466,11 +21622,13 @@ function massimo(vettore, i, max)
return max
@}
+@group
# Carica tutti i campi di ogni record in numeri.
@{
for (i = 1; i <= NF; i++)
numeri[NR, i] = $i
@}
+@end group
END @{
print massimo(numeri)
@@ -21606,7 +21764,7 @@ usando la chiamata indiretta di funzioni:
@ignore
@c file eg/prog/indirectcall.awk
#
-# Arnold Robbins, arnold@skeeve.com, Public Domain
+# Arnold Robbins, arnold@@skeeve.com, Public Domain
# January 2009
@c endfile
@end ignore
@@ -21781,12 +21939,14 @@ di confronto:
@example
@c file eg/prog/indirectcall.awk
+@group
# num_min --- confronto numerico per minore di
function num_min(sinistra, destra)
@{
return ((sinistra + 0) < (destra + 0))
@}
+@end group
# num_magg_o_ug --- confronto numerico per maggiore o uguale
@@ -21839,6 +21999,7 @@ Per finire, le due funzioni di ordinamento chiamano la funzione
@example
@c file eg/prog/indirectcall.awk
+@group
# ascendente --- ordina i dati in ordine crescente
# e li restituisce sotto forma di stringa
@@ -21846,7 +22007,9 @@ function ascendente(primo, ultimo)
@{
return ordina(primo, ultimo, "num_min")
@}
+@end group
+@group
# discendente --- ordina i dati in ordine decrescente
# e li restituisce sotto forma di stringa
@@ -21854,6 +22017,7 @@ function discendente(primo, ultimo)
@{
return ordina(primo, ultimo, "num_magg_o_ug")
@}
+@end group
@c endfile
@end example
@@ -22412,6 +22576,7 @@ il programma.
In C, l'uso di @code{assert()} @`e simile a questo:
@example
+@group
#include <assert.h>
int myfunc(int a, double b)
@@ -22419,6 +22584,7 @@ int myfunc(int a, double b)
assert(a <= 5 && b >= 17.1);
@dots{}
@}
+@end group
@end example
Se l'asserzione @`e falsa, il programma stampa un messaggio simile a questo:
@@ -22589,9 +22755,10 @@ function round(x, ival, aval, frazione)
@}
@c endfile
@c don't include test harness in the file that gets installed
-
+@group
# codice per testare, commentato
# @{ print $0, round($0) @}
+@end group
@end example
@node Funzione random Cliff
@@ -23031,7 +23198,7 @@ if (length(contenuto) == 0)
@end example
La verifica serve a determinare se il file @`e vuoto o no. Una verifica
-equivalente potrebbe essere @samp{contenuto == ""}.
+equivalente potrebbe essere @samp{@w{contenuto == ""}}.
@xref{Esempio di estensione Readfile} per una funzione di estensione
anch'essa finalizzata a leggere un intero file in memoria.
@@ -23361,8 +23528,10 @@ $ @kbd{gawk -f rewind.awk -f test.awk dati }
@print{} data 1 a
@print{} data 2 b
@print{} data 3 c
+@group
@print{} data 4 d
@print{} data 5 e
+@end group
@end example
@node Controllo di file
@@ -24709,8 +24878,10 @@ function getgrent()
_gr_init()
if (++_gr_contatore in _gr_bycount)
return _gr_bycount[_gr_contatore]
+@group
return ""
@}
+@end group
@c endfile
@end example
@@ -24751,8 +24922,8 @@ usa queste funzioni.
@iftex
La
@end iftex
-@ref{Vettori di vettori} trattava come @command{gawk}
-avere a disposizione vettori di vettori. In particolare, qualsiasi elemento di
+@ref{Vettori di vettori} trattava di come @command{gawk}
+mette a disposizione vettori di vettori. In particolare, qualsiasi elemento di
un vettore pu@`o essere uno scalare o un altro vettore. La funzione
@code{isarray()} (@pxref{Funzioni per i tipi})
permette di distinguere un vettore
@@ -25290,10 +25461,12 @@ preparare la lista dei campi o dei caratteri:
if (per_campi == 0 && per_caratteri == 0)
per_campi = 1 # default
+@group
if (lista_campi == "") @{
print "cut: specificare lista per -c o -f" > "/dev/stderr"
exit 1
@}
+@end group
if (per_campi)
prepara_lista_campi()
@@ -25662,8 +25835,10 @@ function endfile(file)
print contatore_file
@}
+@group
totale += contatore_file
@}
+@end group
@c endfile
@end example
@@ -25837,11 +26012,15 @@ BEGIN @{
pw = getpwuid(uid)
stampa_primo_campo(pw)
+@group
if (euid != uid) @{
printf(" euid=%d", euid)
pw = getpwuid(euid)
+@end group
+@group
stampa_primo_campo(pw)
@}
+@end group
printf(" gid=%d", gid)
pw = getgrgid(gid)
@@ -25974,14 +26153,17 @@ BEGIN @{
# testa argv nel caso che si legga da stdin invece che da file
if (i in ARGV)
i++ # salta nome file-dati
+@group
if (i in ARGV) @{
outfile = ARGV[i]
ARGV[i] = ""
@}
-
+@end group
+@group
s1 = s2 = "a"
out = (outfile s1 s2)
@}
+@end group
@c endfile
@end example
@@ -26146,11 +26328,15 @@ indicato nella riga di comando, e poi sullo standard output:
@`E anche possibile scrivere il ciclo cos@`{@dotless{i}}:
@example
+@group
for (i in copia)
if (append)
print >> copia[i]
+@end group
+@group
else
print > copia[i]
+@end group
@end example
@noindent
@@ -26305,10 +26491,12 @@ BEGIN @{
sintassi()
@}
+@group
if (ARGV[Optind] ~ /^\+[[:digit:]]+$/) @{
conta_caratteri = substr(ARGV[Optind], 2) + 0
Optind++
@}
+@end group
for (i = 1; i < Optind; i++)
ARGV[i] = ""
@@ -26345,11 +26533,13 @@ occorre saltare dei caratteri, si usa @code{substr()} per eliminare i primi
@example
@c file eg/prog/uniq.awk
+@group
function se_sono_uguali( n, m, campi_ultima, campi_corrente,\
vettore_ultima, vettore_corrente)
@{
if (contatore_file == 0 && conta_caratteri == 0)
return (ultima == $0)
+@end group
if (contatore_file > 0) @{
n = split(ultima, vettore_ultima)
@@ -26364,9 +26554,11 @@ vettore_ultima, vettore_corrente)
campi_ultima = substr(campi_ultima, conta_caratteri + 1)
campi_corrente = substr(campi_corrente, conta_caratteri + 1)
@}
+@group
return (campi_ultima == campi_corrente)
@}
+@end group
@c endfile
@end example
@@ -26428,11 +26620,13 @@ NR == 1 @{
END @{
if (conta_record)
printf("%4d %s\n", contatore, ultima) > file_output
+@group
else if ((solo_ripetute && contatore > 1) ||
(solo_non_ripetute && contatore == 1))
print ultima > file_output
close(file_output)
@}
+@end group
@c endfile
@end example
@@ -27272,10 +27466,12 @@ A prima vista, un programma come questo sembrerebbe essere sufficiente:
freq[$i]++
@}
+@group
END @{
for (word in freq)
printf "%s\t%d\n", word, freq[word]
@}
+@end group
@end example
Il programma si affida al meccanismo con cui @command{awk} divide i campi per
@@ -27662,7 +27858,7 @@ La riga @`e poi stampata nel file di output:
@}
if ($3 != file_corrente) @{
if (file_corrente != "")
- close(file_corrente)
+ lista_file[file_corrente] = 1 # memorizza per chiudere dopo
file_corrente = $3
@}
@@ -27689,9 +27885,11 @@ La riga @`e poi stampata nel file di output:
i++
@}
@}
+@group
print join(a, 1, n, SUBSEP) > file_corrente
@}
@}
+@end group
@c endfile
@end example
@@ -27699,14 +27897,35 @@ La riga @`e poi stampata nel file di output:
L'output fatto usando @samp{>} apre il file solo la prima volta; il file resta
poi aperto, e ogni scrittura successiva @`e aggiunta in fondo al file.
(@pxref{Ridirezione}).
-Ci@`o rende possibile mischiare testo del programm e commenti esplicativi
+Ci@`o rende agevole mischiare testo del programma e commenti esplicativi
(come @`e stato fatto qui) nello stesso file sorgente, senza nessun problema.
Il file viene chiuso solo quando viene trovato un nuovo nome di
@value{DF} oppure alla fine del file in input.
+Quando si incontra un nuovo @value{FN}, invece di chiudere il file,
+il programma memorizza il nome del file corrente in @code{lista_file}.
+Ci@`o rende possibile mischiare il codice per pi@`u di un file nel file
+sorgente Texinfo in input. (Precedenti versioni di questo programma
+chiudevano @emph{davvero} il file. Ma, a causa della ridirezione
+@samp{>}, un file le cui parti non erano tutte una di seguito all'altra
+finiva per contenere errori.)
+Una regola @code{END} effettua la chiusura di tutti i file aperti, quando
+l'elaborazione @`e stata completata:
+
+@example
+@c file eg/prog/extract.awk
+@group
+END @{
+ close(file_corrente) # chiudi l'ultimo file
+ for (f in lista_file) # chiudi tutti gli altri
+ close(f)
+@}
+@end group
+@c endfile
+@end example
+
Per finire, la funzione @code{@w{fine_file_inattesa()}} stampa un
-appropriato messaggio di errore ed esce.
-La regola @code{END} gestisce la pulizia finale, chiudendo il file aperto:
+appropriato messaggio di errore ed esce:
@example
@c file eg/prog/extract.awk
@@ -27718,11 +27937,6 @@ function fine_file_inattesa()
exit 1
@}
@end group
-
-END @{
- if (file_corrente)
- close(file_corrente)
-@}
@c endfile
@end example
@@ -27784,10 +27998,12 @@ function sintassi()
exit 1
@}
+@group
BEGIN @{
# valida argomenti
if (ARGC < 3)
sintassi()
+@end group
RS = ARGV[1]
ORS = ARGV[2]
@@ -28216,13 +28432,11 @@ di zero, il programma @`e terminato:
continue
@}
cammino = percorso($2)
-@group
if (cammino == "") @{
printf("igawk: %s:%d: non riesco a trovare %s\n",
input[indice_pila], FNR, $2) > "/dev/stderr"
continue
@}
-@end group
if (! (cammino in gia_fatto)) @{
gia_fatto[cammino] = input[indice_pila]
input[++indice_pila] = cammino # aggiungilo alla pila
@@ -28493,10 +28707,12 @@ notice and this notice are preserved.
Ecco il programma:
@example
+@group
awk 'BEGIN@{O="~"~"~";o="=="=="==";o+=+o;x=O""O;while(X++<=x+o+o)c=c"%c";
printf c,(x-O)*(x-O),x*(x-o)-o,x*(x-O)+x-O-o,+x*(x-O)-x+o,X*(o*o+O)+x-O,
X*(X-x)-o*o,(x+X)*o*o+o,x*(X-x)-O-O,x-O+(O+o+X+x)*(o+O),X*X-X*(x-O)-x+O,
O+X*(o*(o+O)+O),+x+O+X*o,x*(x-o),(o+X+x)*o*o-(x-O-O),O+(X-x)*(X+O),x-O@}'
+@end group
@end example
@c genera l'email del tizio:
@c dave_br@gmx.com
@@ -29042,11 +29258,13 @@ La prima funzione di confronto pu@`o essere usata per scorrere un vettore
secondo l'ordine numerico degli indici:
@example
+@group
function cfr_ind_num(i1, v1, i2, v2)
@{
# confronto di indici numerici, ordine crescente
return (i1 - i2)
@}
+@end group
@end example
La seconda funzione scorre un vettore secondo l'ordine delle stringhe
@@ -29155,10 +29373,13 @@ function per_campo(i1, v1, i2, v2)
a[NR][i] = $i
@}
+@group
END @{
PROCINFO["sorted_in"] = "per_campo"
+@end group
if (POS < 1 || POS > NF)
POS = 1
+
for (i in a) @{
for (j = 1; j <= NF; j++)
printf("%s%c", a[i][j], j < NF ? ":" : "")
@@ -29215,6 +29436,7 @@ function per_numero(i1, v1, i2, v2)
return (v1 != v2) ? (v2 - v1) : (i2 - i1)
@}
+@group
function per_stringa(i1, v1, i2, v2)
@{
# confronto di valori di stringa (e indici), ordine decrescente
@@ -29222,6 +29444,7 @@ function per_stringa(i1, v1, i2, v2)
v2 = v2 i2
return (v1 > v2) ? -1 : (v1 != v2)
@}
+@end group
@end example
@c Avoid using the term ``stable'' when describing the unpredictable behavior
@@ -29387,11 +29610,13 @@ trasforma gli elementi da confrontare in lettere minuscole, in modo da avere
confronti che non dipendono da maiuscolo/minuscolo.
@example
+@group
# confronta_in_minuscolo --- confronta stringhe ignorando maiuscolo/minuscolo
function confronta_in_minuscolo(i1, v1, i2, v2, l, r)
@{
l = tolower(v1)
+@end group
r = tolower(v2)
if (l < r)
@@ -29794,7 +30019,7 @@ TCP del sistema locale.
Stampa poi il risultato e chiude la connessione.
Poich@'e questo tema @`e molto ampio, l'uso di @command{gawk} per
-la programmazione TCP/IP viene documentato separatamente.
+la programmazione TCP/IP viene documentata separatamente.
@ifinfo
Si veda
@inforef{Top, , General Introduction, gawkinet, @value{GAWKINETTITLE}},
@@ -30863,9 +31088,11 @@ con altri contenenti degli specificatori posizionali in una stessa stringa di
formato:
@example
+@group
$ @kbd{gawk 'BEGIN @{ printf "%d %3$s\n", 1, 2, "ciao" @}'}
@error{} gawk: riga com.:1: fatale: `count$' va usato per tutti
@error{} i formati o per nessuno
+@end group
@end example
@quotation NOTA
@@ -31535,8 +31762,10 @@ ulteriormente, iniziamo a ``scorrere una ad una'' le righe di
[successivo]):
@example
+@group
gawk> @kbd{n}
@print{} 66 if (contatore_file > 0) @{
+@end group
@end example
Questo ci dice che @command{gawk} ora @`e pronto per eseguire la riga 66, che
@@ -32364,10 +32593,12 @@ Davide Brini (@pxref{Programma signature}):
@c FIXME: This will need updating if num-handler branch is ever merged in.
@smallexample
+@group
gawk> @kbd{dump}
@print{} # BEGIN
@print{}
@print{} [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk]
+@end group
@print{} [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR]
@print{} [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR]
@print{} [ 1:0xfcc280] Op_match :
@@ -32400,18 +32631,18 @@ gawk> @kbd{dump}
@print{} [ :0xfcc660] Op_no_op :
@print{} [ 1:0xfcc520] Op_assign_concat : c
@print{} [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440]
-@print{}
@dots{}
-@print{}
@print{} [ 2:0xfcc5a0] Op_K_printf : [expr_count = 17] [redir_type = ""]
@print{} [ :0xfcc140] Op_no_op :
@print{} [ :0xfcc1c0] Op_atexit :
@print{} [ :0xfcc640] Op_stop :
@print{} [ :0xfcc180] Op_no_op :
@print{} [ :0xfcd150] Op_after_beginfile :
+@group
@print{} [ :0xfcc160] Op_no_op :
@print{} [ :0xfcc1a0] Op_after_endfile :
gawk>
+@end group
@end smallexample
@cindex comando del debugger, @code{exit}
@@ -32805,55 +33036,84 @@ mentre i valori senza segno sono sempre maggiori o uguali a zero.
Nei sistemi informatici, il calcolo con valori interi @`e esatto, ma il possibile
campo di variazione dei valori @`e limitato. L'elaborazione con numeri interi @`e
-pi@`u veloce di quella con numeri a virgola mobile.
+pi@`u veloce di quella con numeri in virgola mobile.
-@item La matematica coi numeri a virgola mobile
-I numeri a virgola mobile rappresentano quelli che a scuola sono chiamati
+@cindex virgola mobile, numeri in
+@cindex numeri in virgola mobile
+@item La matematica coi numeri in virgola mobile
+I numeri in virgola mobile rappresentano quelli che a scuola sono chiamati
numeri ``reali'' (cio@`e, quelli che hanno una parte frazionaria, come
-3.1415927). Il vantaggio dei numeri a virgola mobile @`e che essi possono
+3.1415927). Il vantaggio dei numeri in virgola mobile @`e che essi possono
rappresentare uno spettro di valori molto pi@`u ampio di quello rappresentato dai
numeri interi. Lo svantaggio @`e che ci sono numeri che essi non possono
rappresentare in modo esatto.
-I computer moderni possono eseguire calcoli su valori a virgola mobile
+I computer moderni possono eseguire calcoli su valori in virgola mobile
nell'hardware dell'elaboratore, entro un intervallo di valori limitato.
-Ci sono inoltre librerie di programmi che consentono calcoli, usando numeri a
+Ci sono inoltre librerie di programmi che consentono calcoli, usando numeri in
virgola mobile, di precisione arbitraria.
-POSIX @command{awk} usa numeri a virgola mobile a @dfn{doppia precisione},
-che possono gestire pi@`u cifre rispetto ai numeri a virgola mobile a
+@cindex virgola mobile, numeri in@comma{} precisione singola
+@cindex virgola mobile, numeri in@comma{} precisione doppia
+@cindex virgola mobile, numeri in@comma{} precisione arbitraria
+@cindex precisione singola
+@cindex precisione doppia
+@cindex precisione arbitraria
+@cindex singola, precisione
+@cindex doppia, precisione
+@cindex arbitraria, precisione
+POSIX @command{awk} usa numeri in virgola mobile a @dfn{doppia precisione},
+che possono gestire pi@`u cifre rispetto ai numeri in virgola mobile a
@dfn{singola precisione}. @command{gawk} ha inoltre funzionalit@`a, descritte
in dettaglio pi@`u sotto, che lo mettono in grado di eseguire
-calcoli con i numeri a virgola mobile con precisione arbitraria.
+calcoli con i numeri in virgola mobile con precisione arbitraria.
@end table
-I calcolatori operano con valori interi e a virgola mobile su diversi
+I calcolatori operano con valori interi e in virgola mobile su diversi
intervalli. I valori interi normalmente hanno una dimensione di 32 bit o 64 bit.
-I valori a virgola mobile a singola precisione occupano 32 bit, mentre i
-valori a virgola mobile a doppia precisione occupano 64 bit. I valori a
-virgola mobile sono sempre con segno. Il possibile campo di variazione dei
-valori @`e mostrato in @ref{table-numeric-ranges}.
+I valori in virgola mobile a singola precisione occupano 32 bit, mentre i
+valori in virgola mobile a doppia precisione occupano 64 bit.
+(Esistono anche numeri in virgola mobile a precisione quadrupla. Occupano
+128 bit, ma non sono disponibili in @command{awk}.)
+I valori in virgola mobile sono sempre con segno. I possibili campi di
+variazione dei valori sono mostrati in @ref{table-numeric-ranges} e in
+@ref{table-floating-point-ranges}.
@float Tabella,table-numeric-ranges
-@caption{Intervalli dei valori per diverse rappresentazioni numeriche}
+@caption{Intervallo di valori per rappresentazioni di numeri interi}
@multitable @columnfractions .34 .33 .33
-@headitem Rappresentazione numerica @tab Valore minimo @tab Valore massimo
+@headitem Rappresentazione @tab Valore minimo @tab Valore massimo
@item Interi con segno a 32-bit @tab @minus{}2.147.483.648 @tab 2.147.483.647
@item Interi senza segno a 32-bit @tab 0 @tab 4.294.967.295
@item Interi con segno a 64-bit @tab @minus{}9.223.372.036.854.775.808 @tab 9.223.372.036.854.775.807
@item Interi senza segno a 64-bit @tab 0 @tab 18.446.744.073.709.551.615
+@end multitable
+@end float
+
+@float Tabella,table-floating-point-ranges
+@caption{Intervallo di valori per rappresentazioni di numeri in virgola mobile}
+@multitable @columnfractions .34 .22 .22 .22
+@iftex
+@headitem Rappresentazione @tab @w{Valore positivo} @w{minimo} @w{diverso da zero} @tab @w{Valore finito} @w{minimo} @tab @w{Valore finito} @w{massimo}
+@end iftex
+@ifnottex
+@headitem Rappresentazione @tab Valore positivo minimo diverso da zero @tab Valore finito minimo @tab Valore finito massimo
+@end ifnottex
@iftex
-@item Virgola mobile, singola precisione (circa) @tab @math{1,175494^{-38}} @tab @math{3,402823^{38}}
-@item Virgola mobile, doppia precisione (circa) @tab @math{2,225074^{-308}} @tab @math{1,797693^{308}}
+@item @w{Virgola mobile, singola precis.} @tab @math{1,175494 @cdot 10^{-38}} @tab @math{-3,402823 @cdot 10^{38}} @tab @math{3,402823 @cdot 10^{38}}
+@item @w{Virgola mobile, doppia precis.} @tab @math{2,225074 @cdot 10^{-308}} @tab @math{-1,797693 @cdot 10^{308}} @tab @math{1,797693 @cdot 10^{308}}
+@item @w{Virgola mobile, quadrupla prec.} @tab @math{3,362103 @cdot 10^{-4932}} @tab @math{-1,189731 @cdot 10^{4932}} @tab @math{1,189731 @cdot 10^{4932}}
@end iftex
@ifinfo
-@item Virgola mobile, singola precisione (circa) @tab 1,175494e-38 @tab 3,402823e38
-@item Virgola mobile, doppia precisione (circa) @tab 2,225074e-308 @tab 1,797693e308
+@item Virgola mobile, singola precis. @tab 1,175494e-38 @tab -3,402823e38 @tab 3,402823e38
+@item Virgola mobile, doppia precis. @tab 2,225074e-308 @tab -1,797693e308 @tab 1,797693e308
+@item Virgola mobile, quadrupla prec. @tab 3,362103e-4932 @tab -1,189731e4932 @tab 1,189731e4932
@end ifinfo
@ifnottex
@ifnotinfo
-@item Virgola mobile, singola precisione (circa) @tab 1,175494@sup{-38} @tab 3,402823@sup{38}
-@item Virgola mobile, singola precisione (circa) @tab 2,225074@sup{-308} @tab 1,797693@sup{308}
+@item Virgola mobile, singola precis. @tab 1,175494@sup{-38} @tab -3,402823@sup{38} @tab 3,402823*10@sup{38}
+@item Virgola mobile, singola precis. @tab 2,225074@sup{-308} @tab -1,797693@sup{308} @tab 1,797693*10@sup{308}
+@item Virgola mobile, quadrupla prec. @tab 3,362103@sup{-4932} @tab -1,189731@sup{4932} @tab 1,189731@sup{4932}
@end ifnotinfo
@end ifnottex
@end multitable
@@ -32868,7 +33128,7 @@ per la lettura di questo documento:
@table @dfn
@item Accuratezza
-L'accuratezza del calcolo sui numeri a virgola mobile indica di quanto si
+L'accuratezza del calcolo sui numeri in virgola mobile indica di quanto si
avvicina il calcolo al valore reale (calcolato con carta e penna).
@item Errore
@@ -32878,14 +33138,14 @@ possibile.
@item Esponente
L'ordine di grandezza di un valore;
-alcuni bit in un valore a virgola mobile contengono l'esponente.
+alcuni bit in un valore in virgola mobile contengono l'esponente.
@item Inf
Un valore speciale che rappresenta l'infinito. Le operazioni tra un qualsiasi
numero e l'infinito danno infinito.
@item Mantissa
-Un valore a virgola mobile @`e formato dalla mantissa moltiplicata per 10
+Un valore in virgola mobile @`e formato dalla mantissa moltiplicata per 10
alla potenza dell'esponente. Per esempio, in @code{1,2345e67},
la mantissa @`e @code{1,2345}.
@@ -32920,7 +33180,7 @@ generato il numero), ma non @`e memorizzato fisicamente.
Questo fornisce un bit di precisione in pi@`u.
@item Precisione
-Il numero di bit usati per rappresentare un numero a virgola mobile.
+Il numero di bit usati per rappresentare un numero in virgola mobile.
Pi@`u sono i bit, e maggiore @`e l'intervallo di cifre che si possono
rappresentare.
Le precisioni binaria e decimale sono legate in modo approssimativo, secondo
@@ -33069,10 +33329,10 @@ ottenere ulteriori informazioni, e non basarsi solo su quanto qui detto.
@node Inesattezza nei calcoli
@subsection La matematica in virgola mobile non @`e esatta
-Le rappresentazioni e i calcoli con numeri a virgola mobile binari sono
+Le rappresentazioni e i calcoli con numeri in virgola mobile binari sono
inesatti. Semplici valori come 0,1 non possono essere rappresentati in modo
-preciso usando numeri a virgola mobile binari, e la limitata precisione dei
-numeri a virgola mobile significa che piccoli cambiamenti nell'ordine delle
+preciso usando numeri in virgola mobile binari, e la limitata precisione dei
+numeri in virgola mobile significa che piccoli cambiamenti nell'ordine delle
operazioni o la precisione di memorizzazione di operazioni
intermedie pu@`o cambiare il
risultato. Per rendere la situazione pi@`u difficile, nel calcolo in virgola
@@ -33102,7 +33362,7 @@ Diversamente dal numero in @code{y}, il numero memorizzato in @code{x}
@`e rappresentabile esattamente nel formato binario, perch@'e pu@`o essere
scritto come somma finita di una o pi@`u frazioni i cui denominatori sono tutti
multipli di due.
-Quando @command{gawk} legge un numero a virgola mobile dal sorgente di un
+Quando @command{gawk} legge un numero in virgola mobile dal sorgente di un
programma, arrotonda automaticamente quel numero alla precisione, quale che
sia, supportata dal computer in uso. Se si tenta di stampare il contenuto
numerico di una variabile usando una stringa di formato in uscita di
@@ -33125,7 +33385,7 @@ nell'esempio precedente, d@`a luogo a un output identico all'input.
Poich@'e la rappresentazione interna del computer
pu@`o discostarsi, sia pur di poco, dal valore
-esatto, confrontare dei valori a virgola mobile per vedere se sono esattamente
+esatto, confrontare dei valori in virgola mobile per vedere se sono esattamente
uguali @`e generalmente una pessima idea. Questo @`e un esempio in cui tale
confronto non funziona come dovrebbe:
@@ -33134,19 +33394,21 @@ $ @kbd{gawk 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'}
@print{} 0
@end example
-Il metodo generalmente seguito per confrontare valori a virgola mobile
+Il metodo generalmente seguito per confrontare valori in virgola mobile
consiste nel controllare se la differenza tra loro @`e minore di un certo valore
(chiamato @dfn{delta}, o @dfn{tolleranza}). Quel che si deve decidere @`e qual
@`e il valore minimo di delta
adeguato. Il codice per far ci@`o @`e qualcosa del genere:
@example
+@group
delta = 0.00001 # per esempio
differenza = abs(a) - abs(b) # sottrazione dei due valori
if (differenza < delta)
# va bene
else
# non va bene
+@end group
@end example
@noindent
@@ -33157,7 +33419,7 @@ chiamata @code{abs()}.)
@node Gli errori si sommano
@subsubsection Gli errori diventano sempre maggiori
-La perdita di accuratezza in un singolo calcolo con numeri a virgola mobile
+La perdita di accuratezza in un singolo calcolo con numeri in virgola mobile
generalmente non dovrebbe destare preoccupazione. Tuttavia, se si calcola un
valore che @`e una sequenza di operazioni in virgola mobile, l'errore si pu@`o
accumulare e influire sensibilmente sul risultato del calcolo stesso.
@@ -33372,6 +33634,8 @@ $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 1/10) @}'}
@node Impostare modo di arrotondare
@subsection Impostare la modalit@`a di arrotondamento
+@cindex @code{ROUNDMODE}, variable
+@cindex variabile @code{ROUNDMODE}
La variabile @code{ROUNDMODE} permette di controllare a livello di programma
la modalit@`a di arrotondamento.
La corrispondenza tra @code{ROUNDMODE} e le modalit@`a di arrotondamento IEEE
@@ -33385,14 +33649,15 @@ La corrispondenza tra @code{ROUNDMODE} e le modalit@`a di arrotondamento IEEE
@item Arrotonda verso infinito @tab @code{roundTowardPositive} @tab @code{"U"} o @code{"u"}
@item Arrotonda verso meno infinito @tab @code{roundTowardNegative} @tab @code{"D"} o @code{"d"}
@item Arrotonda verso zero (troncamento) @tab @code{roundTowardZero} @tab @code{"Z"} o @code{"z"}
-@item Arrotonda al pi@`u vicino, o per eccesso @tab @code{roundTiesToAway} @tab @code{"A"} o @code{"a"}
+@item Arrotonda lontano da zero (per eccesso) @tab @tab @code{"A"} o @code{"a"}
@end multitable
@end float
@code{ROUNDMODE} ha @code{"N"} come valore di default, ovvero si usa la
modalit@`a di arrotondamento IEEE 754 @code{roundTiesToEven}.
In @ref{table-gawk-rounding-modes}, il valore @code{"A"} seleziona
-@code{roundTiesToAway}. Questo @`e applicabile solo se la versione in uso
+l'arrotondamento lontano da zero (per eccesso).
+Questo @`e applicabile solo se la versione in uso
della libreria MPFR lo supporta; altrimenti, l'impostazione di @code{ROUNDMODE}
ad @code{"A"} non ha alcun effetto.
@@ -33409,7 +33674,7 @@ In questo caso, il numero @`e arrotondato alla cifra @emph{pari} pi@`u prossima.
Cos@`{@dotless{i}} arrotondando 0.125 alle due cifre si arrotonda per difetto a 0.12,
ma arrotondando 0.6875 alle tre cifre si arrotonda per eccesso a 0.688.
Probabilmente ci si @`e gi@`a imbattuti in questa modalit@`a di arrotondamento
-usando @code{printf} per formattare numeri a virgola mobile.
+usando @code{printf} per formattare numeri in virgola mobile.
Per esempio:
@example
@@ -33447,6 +33712,32 @@ valori equidistanti in eccesso e in difetto si distribuiscono pi@`u o meno
uniformemente, con la possibile conseguenza che errori di arrotondamento
ripetuti tendono ad annullarsi a vicenda. Questa @`e la modalit@`a di
arrotondamento di default per funzioni e operatori di calcolo secondo IEEE 754.
+@c January 2018. Thanks to nethox@gmail.com for the example.
+@sidebar Modalit@`a di arrotondamento e conversioni
+@`E importante comprendere che, insieme a @code{CONVFMT} e
+@code{OFMT}, la modalit@`a di arrotondamento ha effetto anche sul
+modo con cui i numeri sono convertiti in stringhe di caratteri.
+Per esempio,si consideri il seguente programma:
+
+@example
+BEGIN @{
+ pi = 3.1416
+ OFMT = "%.f" # Stampa il valore come numero intero
+ print pi # ROUNDMODE = "N" per default.
+ ROUNDMODE = "U" # Ora si cambia ROUNDMODE
+ print pi
+@}
+@end example
+
+@noindent
+L'esecuzione di questo programma produce il seguente output:
+
+@example
+$ @kbd{gawk -M -f roundmode.awk}
+@print{} 3
+@print{} 4
+@end example
+@end sidebar
Le altre modalit@`a di arrotondamento sono usate raramente. Gli arrotondamenti
verso l'infinito (@code{roundTowardPositive}) e verso il meno infinito
@@ -33454,10 +33745,9 @@ verso l'infinito (@code{roundTowardPositive}) e verso il meno infinito
intervalli, dove si adotta questa modalit@`a di arrotondamento per calcolare
i limiti superiore e inferiore per l'intervallo di valori in uscita.
La modalit@`a
-@code{roundTowardZero} pu@`o essere usata per convertire numeri a virgola mobile
-in numeri interi. La modalit@`a di arrotondamento @code{roundTiesToAway}
-arrotonda il risultato al numero pi@`u vicino, e in caso di equidistanza
-arrotonda per eccesso.
+@code{roundTowardZero} pu@`o essere usata per convertire numeri in virgola mobile
+in numeri interi. Quando si arrotonda lontano da zero (per eccesso), viene
+scelto il numero pi@`u vicino di grandezza maggiore o uguale al valore.
Qualche esperto di analisi numerica dir@`a che la scelta dello stile di
arrotondamento ha un grandissimo impatto sul risultato finale, e consiglier@`a
@@ -33494,7 +33784,7 @@ disponibile. Per esempio, il seguente programma calcola
5@sup{4@sup{3@sup{2}}},
@end ifnotinfo
@end ifnottex
-il cui risultato @`e oltre i limiti degli ordinari valori a virgola mobile a
+il cui risultato @`e oltre i limiti degli ordinari valori in virgola mobile a
doppia precisione dei processori:
@example
@@ -33507,7 +33797,7 @@ $ @kbd{gawk -M 'BEGIN @{}
@print{} 62060698786608744707 ... 92256259918212890625
@end example
-Se invece si dovesse calcolare lo stesso valore usando valori a virgola mobile
+Se invece si dovesse calcolare lo stesso valore usando valori in virgola mobile
con precisione arbitraria, la precisione necessaria per il risultato corretto
(usando
la formula
@@ -33528,8 +33818,8 @@ would be
@end docbook
o 608693.
-Il risultato di un'operazione aritmetica tra un intero e un valore a virgola
-mobile @`e un valore a virgola mobile con precisione uguale alla precisione di
+Il risultato di un'operazione aritmetica tra un intero e un valore in virgola
+mobile @`e un valore in virgola mobile con precisione uguale alla precisione di
lavoro. Il seguente programma calcola l'ottavo termine nella successione di
Sylvester@footnote{Weisstein, Eric W.
@cite{Sylvester's Sequence}. From MathWorld---A Wolfram Web Resource
@@ -33555,7 +33845,7 @@ esattamente il risultato in virgola mobile. Si pu@`o o aumentare la precisione
gli interi per ottenere l'output corretto.
A volte @command{gawk} deve convertire implicitamente un intero con precisione
-arbitraria in un valore a virgola mobile con precisione arbitraria.
+arbitraria in un valore in virgola mobile con precisione arbitraria.
Ci@`o si rende necessario
principalmente perch@'e la libreria MPFR non sempre prevede l'interfaccia
necessaria per elaborare interi a precisione arbitraria o numeri di tipo
@@ -33563,7 +33853,7 @@ eterogeneo come richiesto da un'operazione o funzione. In tal caso, la
precisione viene impostata al minimo valore necessario per una conversione
esatta, e non viene usata la precisione di lavoro. Se
questo non @`e quello di cui si ha bisogno o che si vuole, si pu@`o ricorrere a un
-sotterfugio e convertire preventivamente l'intero in un valore a virgola
+sotterfugio e convertire preventivamente l'intero in un valore in virgola
mobile, come qui di seguito:
@example
@@ -33571,7 +33861,7 @@ gawk -M 'BEGIN @{ n = 13; print (n + 0.0) % 2.0 @}'
@end example
Si pu@`o evitare completamente questo passaggio specificando il numero come
-valore a virgola mobile fin dall'inizio:
+valore in virgola mobile fin dall'inizio:
@example
gawk -M 'BEGIN @{ n = 13.0; print n % 2.0 @}'
@@ -33585,7 +33875,7 @@ gawk -M 'BEGIN @{ n = 13; print n % 2 @}'
@end example
Dividendo due interi a precisione arbitraria con @samp{/} o con @samp{%}, il
-risultato @`e tipicamente un valore a virgola mobile con precisione arbitraria
+risultato @`e tipicamente un valore in virgola mobile con precisione arbitraria
(a meno che il risultato non sia un numero intero esatto).
@ifset INTDIV
Per eseguire divisioni intere o calcolare moduli con interi a precisione
@@ -33637,6 +33927,7 @@ che si @`e scelto di impostare:
@example
@c file eg/prog/pi.awk
+@group
# pi.awk --- calcola le cifre di pi
@c endfile
@c endfile
@@ -33652,6 +33943,7 @@ che si @`e scelto di impostare:
BEGIN @{
cifre = 100000
due = 2 * 10 ^ cifre
+@end group
pi = due
for (m = cifre * 4; m > 0; --m) @{
d = m * 2 + 1
@@ -33762,11 +34054,16 @@ BEGIN @{
if (! adequate_math_precision(fpbits)) @{
print("Errore: la precisione di calcolo disponibile non basta.\n" \
"Provare ancora specificando l'argomento -M?") > "/dev/stderr"
+ # Nota: pu@`o essere necessario impostare un flag a questo punto
+ # per evitare di eseguire delle eventuali regole END
exit 1
@}
@}
@end example
+Occorre tener presente che @code{exit} eseguir@`a le regole @code{END},
+eventualmente contenute nel programma (@pxref{Istruzione exit}).
+
@node Problemi virgola mobile POSIX
@section Confronto tra standard e uso corrente
@@ -33782,12 +34079,12 @@ aggiuntive. Queste sono:
@itemize @value{BULLET}
@item
-Interpretazione del valore dei dati a virgola mobile specificati in notazione
+Interpretazione del valore dei dati in virgola mobile specificati in notazione
esadecimale (p.es., @code{0xDEADBEEF}). (Da notare: valore dei dati letti,
@emph{non} costanti facenti parte del codice sorgente.)
@item
-Supporto per i valori a virgola mobile speciali IEEE 754 ``not a number''
+Supporto per i valori in virgola mobile speciali IEEE 754 ``not a number''
(NaN), pi@`u infinito (``inf'') e meno infinito (``@minus{}inf'').
In particolare, il formato per questi valori @`e quello specificato dallo
standard C ISO 1999, che non distingue maiuscole/minuscole e pu@`o consentire
@@ -33800,7 +34097,7 @@ dalla prassi consolidata:
@itemize @value{BULLET}
@item
-Il manutentore di @command{gawk} crede che supportare i valori a virgola mobile
+Il manutentore di @command{gawk} crede che supportare i valori in virgola mobile
esadecimali, nello specifico, sia sbagliato, e che non sia mai stata intenzione
dell'autore originale di introdurlo nel linguaggio.
@@ -33818,7 +34115,7 @@ arrivati sin qui, ma non pensiamo che questo sia il posto dove volete essere.''
Recependo queste argomentazioni, e cercando nel contempo di assicurare la
compatibilit@`a con le versioni precedenti dello standard, lo standard POSIX 2008
ha aggiunto delle formulazioni esplicite per consentire l'uso da parte di
-@command{awk}, solo a richiesta, dei valori a virgola mobile esadecimali e
+@command{awk}, solo a richiesta, dei valori in virgola mobile esadecimali e
dei valori speciali
``@dfn{not a number}'' e infinito.
@@ -33856,7 +34153,7 @@ e
@samp{-nan}
in modo speciale, producendo i corrispondenti valori numerici speciali.
Il segno iniziale serve per segnalare a @command{gawk} (e all'utente)
-che il valore @`e realmente numerico. I numeri a virgola mobile esadecimali
+che il valore @`e realmente numerico. I numeri in virgola mobile esadecimali
non sono consentiti (a meno di non usare anche @option{--non-decimal-data},
che @emph{non} @`e consigliabile). Per esempio:
@@ -33880,12 +34177,12 @@ speciali. Cos@`{@dotless{i}}, @samp{+nan} e @samp{+NaN} sono la stessa cosa.
@item
La maggior parte dell'aritmetica al calcolatore @`e fatta usando numeri interi
oppure
-valori a virgola mobile. L'@command{awk} standard usa valori a virgola mobile
+valori in virgola mobile. L'@command{awk} standard usa valori in virgola mobile
a doppia precisione.
@item
Nei primi anni '90 Barbie disse erroneamente, ``L'ora di matematica @`e
-ostica!'' Sebbene la matematica non sia ostica, l'aritmetica a virgola
+ostica!'' Sebbene la matematica non sia ostica, l'aritmetica in virgola
mobile non @`e proprio come la
matematica ``carta e penna'', e bisogna prestare attenzione:
@@ -33926,7 +34223,7 @@ una pi@`u efficiente allocazione dello spazio rispetto all'uso di MPFR per
eseguire gli stessi calcoli.
@item
-Ci sono diverse aree per quanto attiene ai numeri a virgola mobile in cui
+Ci sono diverse aree per quanto attiene ai numeri in virgola mobile in cui
@command{gawk} @`e in disaccordo con lo standard POSIX.
@`E importante averlo ben presente.
@@ -34362,7 +34659,7 @@ e sono gestite da @command{gawk} da quel punto in avanti.
@item
L'API definisce parecchie semplici @code{struct} che mappano dei valori
come sono visti da @command{awk}. Un valore pu@`o essere un numero @code{double}
-(a virgola mobile, in doppia precisione), una stringa o un
+(in virgola mobile, in doppia precisione), una stringa o un
vettore (come @`e il caso per i vettori multidimensionali o nella creazione di
un nuovo vettore).
@@ -34524,18 +34821,24 @@ e ogni campo @`e del tipo appropriato.
L'uso di queste macro rende pi@`u facile da seguire l'accesso ai campi di
@code{awk_value_t}.
+@item enum AWK_NUMBER_TYPE @{
+@itemx @ @ @ @ AWK_NUMBER_TYPE_DOUBLE,
+@itemx @ @ @ @ AWK_NUMBER_TYPE_MPFR,
+@itemx @ @ @ @ AWK_NUMBER_TYPE_MPZ
+@itemx @};
+La lista @code{enum} @`e usata nella struttura seguente per definire
+il tipo di valore numerico con cui si ha a che fare. Va dichiarata al
+livello pi@`u alto del file, in modo da poter essere usata sia con il
+linguaggio C++ che con il C.
+
@item typedef struct awk_number @{
@itemx @ @ @ @ double d;
-@itemx @ @ @ @ enum AWK_NUMBER_TYPE @{
-@itemx @ @ @ @ @ @ @ @ AWK_NUMBER_TYPE_DOUBLE,
-@itemx @ @ @ @ @ @ @ @ AWK_NUMBER_TYPE_MPFR,
-@itemx @ @ @ @ @ @ @ @ AWK_NUMBER_TYPE_MPZ
-@itemx @ @ @ @ @} type;
+@itemx @ @ @ @ enum AWK_NUMBER_TYPE type;
@itemx @ @ @ @ void *ptr;
@itemx @} awk_number_t;
Questo rappresenta un valore numerico. Internamente, @command{gawk}
memorizza ogni numero o come una variabile C di tipo @code{double},
-o come un numero intero GMP, o come un numero MPFR a virgola mobile
+o come un numero intero GMP, o come un numero MPFR in virgola mobile
di precisione arbitraria. Per consentire alle estensioni di
supportare valori numerici GMP ed MPFR, i valori numerici sono
trasmessi utilizzando questa struttura.
@@ -34544,10 +34847,9 @@ L'elemento in doppia-precisione @code{d} @`e sempre presente nei dati
ricevuti da @command{gawk}. Inoltre, esaminando il membro
@code{type}, un'estensione @`e in grado di determinare se il membro puntato
da @code{ptr} sia un numero intero GMP (tipo @code{mpz_ptr}), o un numero
-MPFR a virgola mobile (tipo @code{mpfr_ptr_t}), e trasformarlo a seconda
+MPFR in virgola mobile (tipo @code{mpfr_ptr_t}), e trasformarlo a seconda
delle necessit@`a.
-
@item typedef void *awk_scalar_t;
La variabili scalari possono essere rappresentate da un tipo opaco. Questi
valori sono ottenuti da @command{gawk} e in seguito gli vengono restituiti.
@@ -34756,15 +35058,18 @@ Questo @`e solitamente il nome della funzione che sta usando la macro.
Per esempio, si potrebbe allocare il valore di una stringa cos@`{@dotless{i}}:
@example
+@group
awk_value_t risultato;
char *message;
-const char greet[] = "non v'allarmate!";
+const char greet[] = "Non v'allarmate!";
emalloc(message, char *, sizeof(greet), "myfunc");
strcpy(message, greet);
make_malloced_string(message, strlen(message), & risultato);
+@end group
@end example
+@sp 2
@item #define ezalloc(pointer, type, size, message) @dots{}
Questo @`e simile a @code{emalloc()}, ma chiama @code{gawk_calloc()}
invece che @code{gawk_malloc()}.
@@ -34916,6 +35221,7 @@ registrare parti di un'estensione con @command{gawk}.
Le funzioni di estensione sono descritte dal seguente tracciato record:
@example
+@group
typedef struct awk_ext_func @{
@ @ @ @ const char *name;
@ @ @ @ awk_value_t *(*const function)(int num_actual_args,
@@ -34927,6 +35233,7 @@ typedef struct awk_ext_func @{
@ @ @ @ void *data; /* puntatore di tipo opaco
@ @ @ @ a ogni informazione ulteriore */
@} awk_ext_func_t;
+@end group
@end example
I campi sono:
@@ -35147,6 +35454,7 @@ L'estensione dovrebbe raccogliere queste funzioni all'interno di una
struttura @code{awk_input_parser_t}, simile a questa:
@example
+@group
typedef struct awk_input_parser @{
const char *name; /* nome dell'analizzatore */
awk_bool_t (*can_take_file)(const awk_input_buf_t *iobuf);
@@ -35154,6 +35462,7 @@ typedef struct awk_input_parser @{
awk_const struct awk_input_parser *awk_const next; /* per uso
di gawk */
@} awk_input_parser_t;
+@end group
@end example
I campi sono:
@@ -35980,6 +36289,7 @@ che un accesso @`e necessario. Questo
argomento @`e gi@`a stato trattato in precedenza, nella
@ref{Tipi di dati generali}.
+@need 1500
Le funzioni seguenti servono per gestire gli @dfn{scalar cookie}:
@table @code
@@ -36050,12 +36360,14 @@ uno @dfn{scalar cookie} per la
variabile usando @code{sym_lookup()}:
@example
+@group
static awk_scalar_t magic_var_cookie; /* cookie per MAGIC_VAR */
static void
inizializza_estensione()
@{
awk_value_t valore;
+@end group
/* immettere il valore iniziale */
sym_update("MAGIC_VAR", make_number(42.0, & valore));
@@ -36606,10 +36918,12 @@ Infine, poich@'e tutto @`e andato bene, la funzione imposta il codice di ritorno
a "successo", e lo restituisce quando esce:
@example
+@group
make_number(1.0, risultato);
out:
return risultato;
@}
+@end group
@end example
Ecco l'output ottenuto eseguendo questa parte del test:
@@ -36829,7 +37143,7 @@ BEGIN @{
Ecco il risultato dell'esecuzione dello script:
@example
-$ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk}
+$ @kbd{AWKLIBPATH=$PWD gawk -f subarray.awk}
@print{} new_array["sottovettore"]["pippo"] = pluto
@print{} new_array["salve"] = mondo
@print{} new_array["risposta"] = 42
@@ -36986,7 +37300,7 @@ Dipende dall'estensione decidere se ci sono incompatibilit@`a con l'API.
Tipicamente, basta un controllo di questo tipo:
@example
-if (api->major_version != GAWK_API_MAJOR_VERSION
+if ( api->major_version != GAWK_API_MAJOR_VERSION
|| api->minor_version < GAWK_API_MINOR_VERSION) @{
fprintf(stderr, "estensione_pippo: discordanza di versione \
con gawk!\n");
@@ -37106,10 +37420,12 @@ standard, come descritto qui sotto. Il codice predefinito in questione @`e
anche descritto nel file di intestazione @file{gawkapi.h}:
@example
+@group
/* Codice predefinito: */
int plugin_is_GPL_compatible;
static gawk_api_t *const api;
+@end group
static awk_ext_id_t ext_id;
static const char *ext_version = NULL; /* o @dots{} = "qualche stringa" */
@@ -37236,6 +37552,49 @@ compilazione, l'API rimane compatibile a livello di codice sorgente con la
precedente versione API. Le differenze pi@`u rilevanti sono gli ulteriori
campi nella struttura @code{awk_ext_func_t}, e l'aggiunta del terzo argomento
nella funzione di implementazione in linguaggio C.
+(@pxref{Funzioni di estensione}).
+
+Quella che segue @`e una lista di singole funzionalit@`a che sono
+state modificate nella versione 2 rispetto alla versione 1 dell'API:
+
+@itemize @bullet
+
+@item
+I valori numerici possono ora essere anche di tipo MPFR/MPZ
+(@pxref{Tipi di dati generali}).
+
+@item
+Ci sono nuovi tipi di stringa: @code{AWK_REGEX} e @code{AWK_STRNUM}
+(@pxref{Tipi di dati generali}).
+
+@item
+@`E disponibile la nuova macro @code{ezalloc()}
+(@pxref{Funzioni di allocazione memoria}).
+
+@item
+La struttura @code{awk_ext_func_t} @`e stata modificata. Invece del
+parametro @code{num_expected_args}, ha ora i due parametri
+@code{max_expected} e @code{min_required}
+(@pxref{Funzioni di estensione}).
+
+@item
+In @code{get_record()}, un analizzatore di input pu@`o ora specificare
+l'ampiezza dei campi
+(@pxref{Analizzatori di input}).
+
+@item
+Le estensioni possono ora inviare messaggi di errore non fatali
+(@pxref{Stampare messaggi}).
+
+@item
+Quando di appiattisce un vettore, si pu@`o ora specificare il tipo
+dell'indice e quello dei valori
+(@pxref{Funzioni per i vettori}).
+
+@item
+C'@`e una nuova API, @code{get_file()}
+(@pxref{Ridirezione API}).
+@end itemize
@node Trovare le estensioni
@section Come @command{gawk} trova le estensioni compilate
@@ -37502,11 +37861,13 @@ Il secondo @`e un puntatore a una struttura @code{awk_value_t}, normalmente
chiamata @code{risultato}:
@example
+@group
/* do_chdir --- fornisce funzione chdir()
caricata dinamicamente per gawk */
static awk_value_t *
do_chdir(int nargs, awk_value_t *risultato, struct awk_ext_func *non_usata)
+@end group
@{
awk_value_t newdir;
int ret = -1;
@@ -37641,7 +38002,7 @@ fill_stat_array(const char *name, awk_array_t vettore, struct stat *sbuf)
#endif
#ifdef S_IFDOOR /* Stranezza Solaris */
@{ S_IFDOOR, "door" @},
-#endif /* S_IFDOOR */
+#endif
@};
int j, k;
@end example
@@ -37683,9 +38044,11 @@ certi campi e/o il tipo del file. Viene poi restituito zero, per indicare che
tutto @`e andato bene:
@example
+@group
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
array_set_numeric(vettore, "blksize", sbuf->st_blksize);
-#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
+#endif
+@end group
pmode = format_mode(sbuf->st_mode);
array_set(vettore, "pmode", make_const_string(pmode, strlen(pmode),
@@ -37781,10 +38144,12 @@ Poi, ottiene le informazioni relative al file. Se la funzione chiamata
in caso di errore,
imposta ERRNO e ritorna */
ret = statfunc(name, & sbuf);
+@group
if (ret < 0) @{
update_ERRNO_int(errno);
return make_number(ret, risultato);
@}
+@end group
@end example
Il lavoro noioso @`e svolto da @code{fill_stat_array()}, visto in
@@ -37792,10 +38157,12 @@ precedenza. Alla fine, la funzione restituisce il codice di ritorno
impostato da @code{fill_stat_array()}:
@example
+@group
ret = fill_stat_array(name, vettore, & sbuf);
return make_number(ret, risultato);
@}
+@end group
@end example
Infine, @`e necessario fornire la ``colla'' che aggrega
@@ -38678,7 +39045,7 @@ Questo @`e il modo per caricare l'estensione.
@cindex estensione @code{gettimeofday()}
@item ora_corrente = gettimeofday()
Restituisce il numero di secondi trascorsi dalle ore 00:00 del giorno
-01/01/1970 UTC come valore a virgola mobile.
+01/01/1970 UTC come valore in virgola mobile.
Se questa informazione non @`e disponibile nella piattaforma in uso,
restituisce @minus{}1 e imposta @code{ERRNO}. Il valore fornito dovrebbe
avere la precisione di una frazione di
@@ -38697,7 +39064,7 @@ specificati. Se @var{secondi} ha un valore negativo,
o la chiamata di sistema non riesce, restituisce @minus{}1 e imposta @code{ERRNO}.
In caso contrario, restituisce zero dopo aver lasciato trascorrere
la quantit@`a di tempo indicata.
-Si noti che @var{secondi} pu@`o essere un numero a virgola mobile (non solo un
+Si noti che @var{secondi} pu@`o essere un numero in virgola mobile (non solo un
numero intero).
Dettagli di implementazione: a seconda della disponibilit@`a nel sistema in uso,
questa funzione tenta di usare @code{nanosleep()} o @code{select()} per
@@ -38730,31 +39097,28 @@ fornisce varie estensioni per @command{gawk}, compresa una per
l'elaborazione dei file XML. Questa @`e un'evoluzione del progetto noto come
@command{xgawk} (XML @command{gawk}).
-Al momento della stesura di questo testo, ci sono otto estensioni:
+Le estensioni sono parecchie. Alcune delle pi@`u interessanti sono:
@itemize @value{BULLET}
@item
-Estensione @code{errno}
-
-@item
-Estensione GD graphics library
-
-@item
-Estensione libreria MPFR
-(fornisce l'accesso a varie funzioni MPFR non previste dal supporto nativo
-di MPFR disponibile in @command{gawk})
+Estensione @code{abort}. Consente di uscire immediatamente dal programma
+@command{awk} senza eseguire le regole @code{END}.
@item
-Estensione PDF
+Estensione @code{json}.
+Permette di serializzare un vettore multidimensionale trasformandolo in
+una stringa in formato JSON (JavaScript Object Notation), di effettuare
+l'operazione inversa, de-serializzando una stringa JSON, generando
+un vettore @command{gawk}.
@item
-Estensione PostgreSQL
+Estensione libreria MPFR.
+Fornisce accesso a varie funzioni MPFR non previste dal supporto nativo
+di MPFR disponibile in @command{gawk}
@item
-Estensione Redis
-
-@item
-Estensione Select
+Estensione Select. Fornisce delle funzionalit@`a, appoggiandosi sulla
+chiamata di sistema @code{select()}.
@item
Estensione analizzatore XML, usando la libreria di analisi XML
@@ -38772,6 +39136,11 @@ Il comando per farlo @`e il seguente:
git clone git://git.code.sf.net/p/gawkextlib/code gawkextlib-code
@end example
+@cindex RapidJson, libreria per analizzare JSON
+@cindex JSON, RapidJson, libreria per analizzare
+Occorre che sia installata la libreria di analisi JSON
+per poter generare e usare l'estensione @code{json}.
+
@cindex Expat, libreria per analizzare XML
@cindex XML, Expat, libreria per analizzare
Per poter compilare e usare l'estensione XML, @`e necessario installare
@@ -40394,7 +40763,7 @@ La versione 4.2 di @command{gawk} ha introdotto le seguenti modifiche:
@itemize @bullet
@item
-Differenze apportate alle variabili di ambiente (@code{ENVIRON}) sono
+Differenze apportate alle variabili d'ambiente (@code{ENVIRON}) sono
riflesse in quelle rese disponibili a @command{gawk} e in quelle di
programmi che siano da esso richiamati.
@xref{Variabili auto-assegnate}.
@@ -41367,7 +41736,7 @@ gli esempi di estensione incluse con @command{gawk}.
Ulteriori file, non-essenziali. Al momento, questa directory contiene
alcuni file da eseguire al momento di iniziare una sessione,
da installare nella directory @file{/etc/profile.d}
-per essere di aiuto nella gestione delle variabili di ambiente
+per essere di aiuto nella gestione delle variabili d'ambiente
@env{AWKPATH} e @env{AWKLIBPATH}.
@xref{File da usare a inizio sessione}, per ulteriori informazioni.
@@ -41501,7 +41870,7 @@ utenti che possono utilizzare il comando @command{sudo}.
La distribuzione contiene i file da usare a inizio sessione
@file{gawk.sh} e
@file{gawk.csh}, che contengono funzioni che possono essere di aiuto
-nel gestire le variabili di ambiente
+nel gestire le variabili d'ambiente
@env{AWKPATH} e @env{AWKLIBPATH}.
Su un sistema Fedora GNU/Linux, questi file dovrebbero essere installati
nella directory @file{/etc/profile.d};
@@ -41558,7 +41927,7 @@ quando si compila @command{gawk} a partire dai sorgenti, tra cui:
@cindex @option{--disable-extensions}, opzione di configurazione
@cindex opzione di configurazione @code{--disable-extensions}
@item --disable-extensions
-Richiede di non configurare e generare le estensioni di esempio nella
+Richiesta di non configurare e generare le estensioni di esempio nella
directory @file{extension}. Questo @`e utile quando si genera
@command{gawk} per essere eseguito su un'altra piattaforma.
L'azione di default @`e di controllare dinamicamente se le estensioni
@@ -41567,7 +41936,7 @@ possono essere configurate e compilate.
@cindex @option{--disable-lint}, opzione di configurazione
@cindex opzione di configurazione @code{--disable-lint}
@item --disable-lint
-Disabilita i controlli @dfn{lint} all'interno di @command{gawk}. Le opzioni
+Disabilitare i controlli @dfn{lint} all'interno di @command{gawk}. Le opzioni
@option{--lint} e @option{--lint-old}
(@pxref{Opzioni})
sono accettate, ma non fanno nulla, e non emettono alcun messaggio di
@@ -41592,7 +41961,7 @@ Quest'opzione potr@`a essere rimossa in futuro.
@cindex @option{--disable-mpfr}, opzione di configurazione
@cindex opzione di configurazione @code{--disable-mpfr}
@item --disable-mpfr
-Non viene effettuato il controllo delle librerie MPFR e GMP.
+Non effettuare il controllo delle librerie MPFR e GMP.
Ci@`o pu@`o essere utile principalmente per gli sviluppatori,
per assicurarsi che tutto funzioni regolarmente nel caso in cui
il supporto MPFR non sia disponibile.
@@ -41600,16 +41969,19 @@ il supporto MPFR non sia disponibile.
@cindex @option{--disable-nls}, opzione di configurazione
@cindex opzione di configurazione @code{--disable-nls}
@item --disable-nls
-Non attiva la traduzione automatica dei messaggi.
+Non attivare la traduzione automatica dei messaggi.
Ci@`o normalmente non @`e consigliabile, ma pu@`o apportare qualche lieve
miglioramento nei tempi di esecuzione di un programma.
-@cindex @option{--with-whiny-user-strftime}, opzione di configurazione
-@cindex opzione di configurazione @code{--with-whiny-user-strftime}
-@item --with-whiny-user-strftime
-Forza l'uso della versione della funzione C @code{strftime()} inclusa nella
-distribuzione di @command{gawk}, per i sistemi in cui la funzione stessa
-non sia disponibile.
+@cindex @option{--enable-versioned-extension-dir}, opzione di configurazione
+@cindex opzione di configuzazione @code{--enable-versioned-extension-dir}
+@item --enable-versioned-extension-dir
+Usare una directory con l'indicazione della versione per le estensioni.
+Il nome della directory conterr@`a la versione principale e quella
+secondaria dell'API. Ci@`o consente la presenza, nello stesso sistema,
+di pi@`u di una versione dell'API, senza che fra di esse sorgano dei
+conflitti legati all'una o all'altra versione.
+
@end table
Si usi il comando @samp{./configure --help} per ottenere la lista completa
@@ -41741,9 +42113,10 @@ usando gli strumenti MinGW, scrivere @samp{make mingw32}.
@cindex PC, @command{gawk} su sistemi operativi
@cindex sistemi operativi PC, @command{gawk} su
-Sotto MS-Windows, gli ambienti Cygwin e MinGW consentono di usare
+Sotto MS-Windows, l'ambiente MinGW consente di usare
sia l'operatore @samp{|&} che le operazioni su rete TCP/IP
(@pxref{Reti TCP/IP}).
+L'ambiente DJGPP non consente di usare @samp{|&}.
@cindex percorso di ricerca
@cindex percorso di ricerca per file sorgente
@@ -41874,8 +42247,17 @@ make && make check
@end example
In confronto a un sistema GNU/Linux sulla stessa macchina, l'esecuzione
-del passo di @samp{configure} sotto Cygwin richiede molto pi@`u tempo. Tuttavia
-si conclude regolarmente, e poi @samp{make} funziona come ci si aspetta.
+del passo di @samp{configure} sotto Cygwin richiede molto pi@`u tempo.
+Tuttavia si conclude regolarmente, e poi @samp{make} funziona come ci si
+aspetta.
+
+Le versioni pi@`u recenti di Cygwin aprono tutti i file in modalit@`a binaria.
+Ci@`o implica che si dovrebbe usare @samp{RS = "\r?\n"} per riuscire a
+gestire file di testo MS-Windows in formato standard, in cui ogni riga
+termina con i due caratteri di Ritorno-del-carrello e A-capo.
+
+L'ambiente Cygwin consente l'utilizzo sia dell'operatore @samp{|&}
+che di reti TCP/IP (@pxref{Reti TCP/IP}).
@node MSYS
@appendixsubsubsec Usare @command{gawk} in ambiente MSYS
@@ -42480,13 +42862,6 @@ nel caso che qualche volontario desideri prenderla in carico.
Se questo non dovesse succedere, la parte di codice relativa questa
versione sar@`a rimossa dalla distribuzione.
-@c 7/2017, Juan Guerrero has taken over the DJGPP port.
-@ignore
-The DJGPP port is no longer supported; it will remain in the code base
-for a while in case a volunteer wishes to take it over. If this does
-not happen, then eventually code for this port will be removed.
-@end ignore
-
@node Altre versioni
@appendixsec Altre implementazioni di @command{awk} liberamente disponibili
@cindex @command{awk}, implementazioni di
@@ -43523,7 +43898,7 @@ sistemi operativi possono avere limiti differenti.
@item Numero di record in input in un singolo file @tab @code{MAX_LONG}
@item Numero totale di record in input @tab @code{MAX_LONG}
@item Numero di ridirezioni via @dfn{pipe} @tab min(numero processi per utente, numero di file aperti)
-@item Valori numerici @tab Numeri a virgola mobile in doppia precisione (se non si usa la funzionalit@`a MPFR)
+@item Valori numerici @tab Numeri in virgola mobile in doppia precisione (se non si usa la funzionalit@`a MPFR)
@item Dimensione di un campo @tab @code{MAX_INT}
@item Dimensione di una stringa letterale @tab @code{MAX_INT}
@item Dimensione di una stringa di @dfn{printf} @tab @code{MAX_INT}
@@ -44062,7 +44437,7 @@ variabili numeriche e di tipo stringa, sono definite come valori
La
@end iftex
@ref{Aritmetica del computer}, ha fornito un'introduzione di base ai tipi
-numerici (interi e a virgola mobile) e a come questi sono usati in un computer.
+numerici (interi e in virgola mobile) e a come questi sono usati in un computer.
Si consiglia di rileggere quelle informazioni, comprese le numerose avvertente
l@`a esposte.
@@ -44076,14 +44451,30 @@ programmi @command{awk}: @code{""}.
Gli esseri umani sono abituati a usare il sistema decimale, cio@`e a base 10.
In base 10, i numeri vanno da 0 a 9, e poi ``vengono riportati'' nella
-colonna successiva. (Chi si ricorda la scuola elementare? 42 = 4 x 10 + 2.)
+colonna
+@iftex
+colonna successiva.
+(Chi si ricorda la scuola elementare? @math{42 = 4 volte 10 + 2}.)
+@end iftex
+@ifnottex
+colonna successiva.
+(Chi si ricorda la scuola elementare? 42 = 4 x 10 + 2.)
+@end ifnottex
Ma esistono anche altre basi per i numeri. I computer normalmente usano
la base 2 o @dfn{binaria}, la base 8 o @dfn{ottale}, e la base 16 o
@dfn{esadecimale}. Nella numerazione binaria, ogni colonna rappresenta il
doppio del valore della colonna alla sua destra. Ogni colonna pu@`o contenere
-solo uno 0 o un 1. Quindi, il numero binario 1010 rappresenta (1 x 8) + (0 x
-4) + (1 x 2) + (0 x 1), ossia il numero decimale 10. Le numerazioni ottale ed
+solo uno 0 o un 1.
+@iftex
+Quindi, il numero binario 1010 rappresenta @math{(1 volta 8) + (0 volte 4)
++ (1 volta 2) + (0 volte 1)}, ossia il numero decimale 10.
+@end iftex
+@ifnottex
+Quindi, il numero binario 1010 rappresenta (1 x 8) + (0 x 4)
++ (1 x 2) + (0 x 1), ossia il numero decimale 10.
+@end ifnottex
+Le numerazioni ottale ed
esadecimale sono trattate pi@`u ampiamente
@ifnottex
in
@@ -44236,7 +44627,13 @@ i circuiti elettronici funzionano ``naturalmente'' in base 2
calcolata usando la base 2. Ciascuna cifra rappresenta la presenza
(o l'assenza) di una potenza di 2 ed @`e chiamata un @dfn{bit}.
Cos@`{@dotless{i}}, per esempio, il numero in base due @code{10101} rappresenta il
-numero in base decimale 21, ((1 x 16) + (1 x 4) + (1 x 1)).
+numero in base decimale 21,
+@iftex
+(@math{(1 volta 16) + (1 volta 4) + (1 volta 1)}).
+@end iftex
+@ifnottex
+((1 x 16) + (1 x 4) + (1 x 1)).
+@end ifnottex
Poich@'e i numeri in base due diventano rapidamente molto lunghi
sia da leggere che da scrivere, normalmente li si unisce a gruppi di tre
@@ -44303,9 +44700,9 @@ Abbreviazione di ``Binary Digit'' [cifra binaria].
Tutti i valori nella memoria di un computer sono rappresentati nella forma di
cifre binarie: valori che sono zero o uno.
Gruppi di bit possono essere interpretati differentemente---come numeri
-interi, numeri a virgola mobile, dati di tipo carattere, indirizzi di altri
+interi, numeri in virgola mobile, dati di tipo carattere, indirizzi di altri
oggetti contenuti in memoria, o altri dati ancora.
-@command{awk} permette di lavorare con numeri a virgola mobile e stringhe.
+@command{awk} permette di lavorare con numeri in virgola mobile e stringhe.
@command{gawk} permette di manipolare bit con le funzioni predefinite
descritte
@ifnottex
@@ -44346,7 +44743,7 @@ stile complessivo, che @`e abbastanza simile a quello del linguaggio C.
La C shell non @`e compatibile all'indietro con la Bourne Shell, e per questo
motivo un'attenzione speciale @`e necessaria se si convertono alla C shell
degli script scritti per altre shell Unix, in particolare per ci@`o che
-concerne la gestione delle variaili di shell.
+concerne la gestione delle variabili di shell.
Si veda anche ``Bourne Shell''.
@item C++
@@ -44484,7 +44881,13 @@ le lettere @code{A}--@code{F}, con @samp{A}
che rappresenta 10, @samp{B} che rappresenta 11, e cos@`{@dotless{i}} via, fino a
@samp{F} per 15.
I numeri esadecimali sono scritti in C prefissandoli con @samp{0x},
-per indicarne la base. Quindi, @code{0x12} @`e 18 ((1 x 16) + 2).
+per indicarne la base.
+@iftex
+Quindi, @code{0x12} @`e 18 (@math{(1 volta 16) + 2}).
+@end iftex
+@ifnottex
+Quindi, @code{0x12} @`e 18 ((1 x 16) + 2).
+@end ifnottex
@xref{Numeri non-decimali}.
@item Espressione booleana
@@ -44578,7 +44981,7 @@ Si veda anche ``Espressioni regolari''.
La negazione di una @dfn{espressione tra parentesi quadre}. Tutto ci@`o che
@emph{non} @`e descritto da una data espressione tra parentesi quadre.
Il simbolo @samp{^} precede l'espressione tra parentesi quadre che viene
-negata. Per esempio: @samp{[[^:digit:]}
+negata. Per esempio: @samp{[^[:digit:]]}
designa qualsiasi carattere che non sia una cifra. @samp{[^bad]}
designa qualsiasi carattere che non sia una delle lettere @samp{b}, @samp{a},
o @samp{d}.
@@ -44860,11 +45263,11 @@ Un'operazione che non fa nulla.
@item Numero
Un dato oggetto il cui valore @`e numerico. Le implementazioni di @command{awk}
-usano numeri a virgola mobile in doppia precisione per rappresentare i numeri.
-Le primissime implementazioni di @command{awk} usavano numeri a virgola mobile
+usano numeri in virgola mobile in doppia precisione per rappresentare i numeri.
+Le primissime implementazioni di @command{awk} usavano numeri in virgola mobile
in singola precisione.
-@item Numero a virgola mobile
+@item Numero in virgola mobile
Spesso descritto, in termini matematici, come un numero ``razionale'' o reale,
@`e soltanto un numero che pu@`o avere una parte frazionaria.
Si veda anche ``Doppia precisione'' e ``Singola precisione''.
@@ -44875,7 +45278,13 @@ Si veda ``Metacaratteri''.
@item Ottale
Notazione avente come base 8, nella quale le cifre sono @code{0}--@code{7}.
I numeri ottali in C sono scritti premettendo uno @samp{0},
-per indicare la base. Quindi, @code{013} @`e 11 ((1 x 8) + 3).
+per indicare la base.
+@iftex
+Quindi, @code{013} @`e 11 (@math{(1 volta 8) + 3}).
+@end iftex
+@ifnottex
+Quindi, @code{013} @`e 11 ((1 x 8) + 3).
+@end ifnottex
@xref{Numeri non-decimali}.
@item Parentesi Graffe
@@ -44894,7 +45303,7 @@ Le parole chiave di @command{gawk} sono:
@code{break},
@code{case},
@code{continue},
-@code{default}
+@code{default},
@code{delete},
@code{do@dots{}while},
@code{else},
@@ -45162,7 +45571,7 @@ interi sequenziali compresi in un intervallo prestabilito.
@c hence no sectioning command or @node.
@display
-Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
+Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{https://fsf.org/}
This is an unofficial translation of the GNU General Public License into
Italian. It was not published by the Free Software Foundation, and does not
@@ -45848,7 +46257,7 @@ CORREZIONE.
IN NESSUN CASO, A MENO CHE NON SIA RICHIESTO DALLA NORMATIVA VIGENTE O
CONCORDATO PER ISCRITTO, I DETENTORI DEL COPYRIGHT, O QUALUNQUE ALTRA PARTE
-CHE MODIICA E/O DISTRIBUISCE IL PROGRAMMA SECONDO LE CONDIZIONI PRECEDENTI,
+CHE MODIFICA E/O DISTRIBUISCE IL PROGRAMMA SECONDO LE CONDIZIONI PRECEDENTI,
POSSONO ESSERE RITENUTI RESPONSABILI NEI CONFRONTI DEL LICENZIATARIO PER
DANNI, INCLUSO QUALUNQUE DANNEGGIAMENTO GENERICO, SPECIALE, INCIDENTALE O
CONSEQUENZIALE DOVUTO ALL'USO O ALL'IMPOSSIBILIT@`A D'USO DEL PROGRAMMA
@@ -45899,8 +46308,8 @@ IDONEIT@`A AD UN PARTICOLARE SCOPO. Si veda la 'GNU General Public License' per
ulteriori dettagli.
Dovresti aver ricevuto una copia della GNU General Public License assieme a
-questo programma; se non @`e cos@`{@dotless{i}}, si veda
-@url{http://www.gnu.org/licenses/}.
+questo programma; se non @`e cos@`{@dotless{i}}, vedere
+@url{https://www.gnu.org/licenses/}.
@end smallexample
Inoltre, aggiungi le informazioni necessarie a contattarti via posta ordinaria
@@ -45927,14 +46336,14 @@ Devi inoltre fare in modo che il tuo datore di lavoro (se lavori come
programmatore presso terzi) o la tua scuola, eventualmente, firmino una
``rinuncia al copyright'' sul programma, se necessario. Per maggiori
informazioni su questo punto, e su come applicare e rispettare la GNU GPL,
-consultare la pagina @url{http://www.gnu.org/licenses/}.
+consultare la pagina @url{https://www.gnu.org/licenses/}.
La GNU General Public License non consente di incorporare il programma
all'interno di software proprietario. Se il tuo programma @`e una libreria di
funzioni, potresti ritenere pi@`u opportuno consentire il collegamento tra
software proprietario e la tua libreria. Se @`e questo ci@`o che vuoi, allora
utilizza la GNU Lesser General Public License anzich@'e questa Licenza, ma prima
-leggi @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
+leggi @url{https://www.gnu.org/philosophy/why-not-lgpl.html}.
@ifclear FOR_PRINT
@c The GNU Free Documentation License.
@@ -45957,7 +46366,7 @@ leggi @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
-@uref{http://fsf.org}
+@uref{https://fsf.org}
This is an unofficial translation of the GNU Free Documentation License into
Italian. It was not published by the Free Software Foundation, and does not
@@ -46395,7 +46804,7 @@ La Free Software Foundation pu@`o occasionalmente pubblicare versioni nuove
o rivedute della Licenza per Documentazione Libera GNU. Le nuove versioni
saranno simili nello spirito alla versione attuale ma potrebbero
differirne in qualche dettaglio per affrontare nuovi problemi e concetti.
-Si veda @uref{http://www.gnu.org/copyleft/}.
+Si veda @uref{https://www.gnu.org/copyleft/}.
Ad ogni versione della licenza viene dato un numero che la distingue. Se
il documento specifica che si riferisce ad una versione particolare della
@@ -46513,6 +46922,8 @@ Consistency issues:
The term "blank" is thus basically reserved for "blank lines" etc.
To make dark corners work, the @value{DARKCORNER} has to be outside
closing `.' of a sentence and after (pxref{...}).
+ Make sure that each @value{DARKCORNER} has an index entry, and
+ also that each `@cindex dark corner' has an @value{DARKCORNER}.
" " should have an @w{} around it
Use "non-" only with language names or acronyms, or the words bug and option and null
Use @command{ftp} when talking about anonymous ftp
@@ -46630,5 +47041,7 @@ But to use it you have to say
which sorta sucks.
TODO:
-Check that all dark corners are indexed properly.
-
+Add a section explaining recursion from ground zero. Probably
+easiest to do it with factorial as the example. Explain that
+recursion needs a stopping condition. Thanks to
+Bill Duncan <bduncan@beachnet.org> for the suggestion.
diff --git a/doc/it/texinfo.tex b/doc/it/texinfo.tex
index 2a4cdd6c..2ae6710a 100644..100755
--- a/doc/it/texinfo.tex
+++ b/doc/it/texinfo.tex
@@ -3,11 +3,11 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2016-02-05.07}
+\def\texinfoversion{2018-03-10.14}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
% Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
@@ -21,7 +21,7 @@
% General Public License for more details.
%
% You should have received a copy of the GNU General Public License
-% along with this program. If not, see <http://www.gnu.org/licenses/>.
+% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
% As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without
@@ -30,9 +30,9 @@
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
-% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
-% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
-% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
+% https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+% https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+% https://www.gnu.org/software/texinfo/ (the Texinfo home page)
% The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check.
%
@@ -56,7 +56,7 @@
% extent. You can get the existing language-specific files from the
% full Texinfo distribution.
%
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
\message{Loading texinfo [version \texinfoversion]:}
@@ -67,6 +67,10 @@
\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
+% LaTeX's \typeout. This ensures that the messages it is used for
+% are identical in format to the corresponding ones from latex/pdflatex.
+\def\typeout{\immediate\write17}%
+
\chardef\other=12
% We never want plain's \outer definition of \+ in Texinfo.
@@ -158,7 +162,7 @@
\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
%
-% Aggiunto per l'italiano
+% added for Italian
\gdef\putwordla{la}
\gdef\putwordLa{La}
\gdef\putwordsivedail{si veda il}
@@ -175,6 +179,9 @@
% Give the space character the catcode for a space.
\def\spaceisspace{\catcode`\ =10\relax}
+% Likewise for ^^M, the end of line character.
+\def\endlineisspace{\catcode13=10\relax}
+
\chardef\dashChar = `\-
\chardef\slashChar = `\/
\chardef\underChar = `\_
@@ -324,7 +331,7 @@
% Margin to add to right of even pages, to left of odd pages.
\newdimen\bindingoffset
\newdimen\normaloffset
-\newdimen\pagewidth \newdimen\pageheight
+\newdimen\txipagewidth \newdimen\txipageheight
% Main output routine.
%
@@ -348,7 +355,7 @@
% Common context changes for both heading and footing.
% Do this outside of the \shipout so @code etc. will be expanded in
% the headline as they should be, not taken literally (outputting ''code).
- \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
+ \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
%
% Retrieve the information for the headings from the marks in the page,
% and call Plain TeX's \makeheadline and \makefootline, which use the
@@ -447,7 +454,7 @@
\newinsert\margin \dimen\margin=\maxdimen
% Main part of page, including any footnotes
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
{\catcode`\@ =11
\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
% marginal hacks, juha@viisa.uucp (Juha Takala)
@@ -738,11 +745,11 @@
% \dimen0 is the vertical size of the group's box.
\dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
% \dimen2 is how much space is left on the page (more or less).
- \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
% if the group doesn't fit on the current page, and it's a big big
% group, force a page break.
\ifdim \dimen0 > \dimen2
- \ifdim \pagetotal < \vfilllimit\pageheight
+ \ifdim \pagetotal < \vfilllimit\txipageheight
\page
\fi
\fi
@@ -872,36 +879,6 @@ where each line of input produces a line of output.}
\temp
}
-% @| inserts a changebar to the left of the current line. It should
-% surround any changed text. This approach does *not* work if the
-% change spans more than two lines of output. To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change). This command
-% is not documented, not supported, and doesn't work.
-%
-\def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
-}
-
% @include FILE -- \input text of FILE.
%
\def\include{\parseargusing\filenamecatcodes\includezzz}
@@ -990,21 +967,14 @@ where each line of input produces a line of output.}
% @comment ...line which is ignored...
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
-%
-\def\comment{\begingroup \catcode`\^^M=\active%
-\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}%
-{\catcode`\^^M=\active%
-\gdef\commentxxx#1^^M{\endgroup%
-\futurelet\nexttoken\commentxxxx}%
-\gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}%
-}
\def\c{\begingroup \catcode`\^^M=\active%
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
\cxxx}
{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
-% See comment in \scanmacro about why the definitions of @c and @comment differ
+%
+\let\comment\c
% @paragraphindent NCHARS
% We'll use ems for NCHARS, close enough.
@@ -1114,6 +1084,86 @@ where each line of input produces a line of output.}
\newif\ifpdf
\newif\ifpdfmakepagedest
+%
+% For LuaTeX
+%
+
+\newif\iftxiuseunicodedestname
+\txiuseunicodedestnamefalse % For pdfTeX etc.
+
+\ifx\luatexversion\thisisundefined
+\else
+ % Use Unicode destination names
+ \txiuseunicodedestnametrue
+ % Escape PDF strings with converting UTF-16 from UTF-8
+ \begingroup
+ \catcode`\%=12
+ \directlua{
+ function UTF16oct(str)
+ tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
+ for c in string.utfvalues(str) do
+ if c < 0x10000 then
+ tex.sprint(
+ string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
+ string.char(0x5c) .. string.char(0x25) .. '03o',
+ (c / 256), (c % 256)))
+ else
+ c = c - 0x10000
+ local c_hi = c / 1024 + 0xd800
+ local c_lo = c % 1024 + 0xdc00
+ tex.sprint(
+ string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
+ string.char(0x5c) .. string.char(0x25) .. '03o' ..
+ string.char(0x5c) .. string.char(0x25) .. '03o' ..
+ string.char(0x5c) .. string.char(0x25) .. '03o',
+ (c_hi / 256), (c_hi % 256),
+ (c_lo / 256), (c_lo % 256)))
+ end
+ end
+ end
+ }
+ \endgroup
+ \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
+ % Escape PDF strings without converting
+ \begingroup
+ \directlua{
+ function PDFescstr(str)
+ for c in string.bytes(str) do
+ if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
+ tex.sprint(
+ string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
+ c))
+ else
+ tex.sprint(string.char(c))
+ end
+ end
+ end
+ }
+ \endgroup
+ \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
+ \ifnum\luatexversion>84
+ % For LuaTeX >= 0.85
+ \def\pdfdest{\pdfextension dest}
+ \let\pdfoutput\outputmode
+ \def\pdfliteral{\pdfextension literal}
+ \def\pdfcatalog{\pdfextension catalog}
+ \def\pdftexversion{\numexpr\pdffeedback version\relax}
+ \let\pdfximage\saveimageresource
+ \let\pdfrefximage\useimageresource
+ \let\pdflastximage\lastsavedimageresourceindex
+ \def\pdfendlink{\pdfextension endlink\relax}
+ \def\pdfoutline{\pdfextension outline}
+ \def\pdfstartlink{\pdfextension startlink}
+ \def\pdffontattr{\pdfextension fontattr}
+ \def\pdfobj{\pdfextension obj}
+ \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
+ \let\pdfpagewidth\pagewidth
+ \let\pdfpageheight\pageheight
+ \edef\pdfhorigin{\pdfvariable horigin}
+ \edef\pdfvorigin{\pdfvariable vorigin}
+ \fi
+\fi
+
% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
% can be set). So we test for \relax and 0 as well as being undefined.
\ifx\pdfoutput\thisisundefined
@@ -1144,12 +1194,21 @@ where each line of input produces a line of output.}
\ifx\pdfescapestring\thisisundefined
% No primitive available; should we give a warning or log?
% Many times it won't matter.
+ \xdef#1{#1}%
\else
% The expandable \pdfescapestring primitive escapes parentheses,
% backslashes, and other special chars.
\xdef#1{\pdfescapestring{#1}}%
\fi
}
+\def\txiescapepdfutfsixteen#1{%
+ \ifx\pdfescapestrutfsixteen\thisisundefined
+ % No UTF-16 converting macro available.
+ \txiescapepdf{#1}%
+ \else
+ \xdef#1{\pdfescapestrutfsixteen{#1}}%
+ \fi
+}
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
with PDF output, and none of those formats could be found. (.eps cannot
@@ -1259,17 +1318,77 @@ output) for that.)}
\pdfrefximage \pdflastximage
\fi}
%
- \def\pdfmkdest#1{{%
+ \def\setpdfdestname#1{{%
% We have to set dummies so commands such as @code, and characters
% such as \, aren't expanded when present in a section title.
\indexnofonts
- \turnoffactive
\makevalueexpandable
+ \turnoffactive
+ \iftxiuseunicodedestname
+ \ifx \declaredencoding \latone
+ % Pass through Latin-1 characters.
+ % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
+ \else
+ \ifx \declaredencoding \utfeight
+ % Pass through Unicode characters.
+ \else
+ % Use ASCII approximations in destination names.
+ \passthroughcharsfalse
+ \fi
+ \fi
+ \else
+ % Use ASCII approximations in destination names.
+ \passthroughcharsfalse
+ \fi
\def\pdfdestname{#1}%
\txiescapepdf\pdfdestname
- \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
}}
%
+ \def\setpdfoutlinetext#1{{%
+ \indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ \ifx \declaredencoding \latone
+ % The PDF format can use an extended form of Latin-1 in bookmark
+ % strings. See Appendix D of the PDF Reference, Sixth Edition, for
+ % the "PDFDocEncoding".
+ \passthroughcharstrue
+ % Pass through Latin-1 characters.
+ % LuaTeX: Convert to Unicode
+ % pdfTeX: Use Latin-1 as PDFDocEncoding
+ \def\pdfoutlinetext{#1}%
+ \else
+ \ifx \declaredencoding \utfeight
+ \ifx\luatexversion\thisisundefined
+ % For pdfTeX with UTF-8.
+ % TODO: the PDF format can use UTF-16 in bookmark strings,
+ % but the code for this isn't done yet.
+ % Use ASCII approximations.
+ \passthroughcharsfalse
+ \def\pdfoutlinetext{#1}%
+ \else
+ % For LuaTeX with UTF-8.
+ % Pass through Unicode characters for title texts.
+ \passthroughcharstrue
+ \def\pdfoutlinetext{#1}%
+ \fi
+ \else
+ % For non-Latin-1 or non-UTF-8 encodings.
+ % Use ASCII approximations.
+ \passthroughcharsfalse
+ \def\pdfoutlinetext{#1}%
+ \fi
+ \fi
+ % LuaTeX: Convert to UTF-16
+ % pdfTeX: Use Latin-1 as PDFDocEncoding
+ \txiescapepdfutfsixteen\pdfoutlinetext
+ }}
+ %
+ \def\pdfmkdest#1{%
+ \setpdfdestname{#1}%
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }
+ %
% used to mark target names; must be expandable.
\def\pdfmkpgn#1{#1}
%
@@ -1297,18 +1416,13 @@ output) for that.)}
% page number. We could generate a destination for the section
% text in the case where a section has no node, but it doesn't
% seem worth the trouble, since most documents are normally structured.
- \edef\pdfoutlinedest{#3}%
- \ifx\pdfoutlinedest\empty
- \def\pdfoutlinedest{#4}%
- \else
- \txiescapepdf\pdfoutlinedest
+ \setpdfoutlinetext{#1}
+ \setpdfdestname{#3}
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{#4}%
\fi
%
- % Also escape PDF chars in the display string.
- \edef\pdfoutlinetext{#1}%
- \txiescapepdf\pdfoutlinetext
- %
- \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+ \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
}
%
\def\pdfmakeoutlines{%
@@ -1464,23 +1578,254 @@ output) for that.)}
\fi % \ifx\pdfoutput
%
-% @image support for XeTeX
+% For XeTeX
%
-\newif\ifxeteximgpdf
\ifx\XeTeXrevision\thisisundefined
\else
%
+ % XeTeX version check
+ %
+ \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
+ % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
+ % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941).
+ % For avoiding PDF destination name replacement, we use this special
+ % instead of xdvipdfmx's command line option `-C 0x0010'.
+ \special{dvipdfmx:config C 0x0010}
+ % XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
+ % It can handle Unicode destination names for PDF.
+ \txiuseunicodedestnametrue
+ \else
+ % XeTeX < 0.99996 (TeX Live < 2016) cannot use the
+ % `dvipdfmx:config' special.
+ % So for avoiding PDF destination name replacement,
+ % xdvipdfmx's command line option `-C 0x0010' is necessary.
+ %
+ % XeTeX < 0.99995 can not handle Unicode destination names for PDF
+ % because xdvipdfmx 20150315 has a UTF-16 conversion issue.
+ % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
+ \txiuseunicodedestnamefalse
+ \fi
+ %
+ % Color support
+ %
+ \def\rgbDarkRed{0.50 0.09 0.12}
+ \def\rgbBlack{0 0 0}
+ %
+ \def\pdfsetcolor#1{\special{pdf:scolor [#1]}}
+ %
+ % Set color, and create a mark which defines \thiscolor accordingly,
+ % so that \makeheadline knows which color to restore.
+ \def\setcolor#1{%
+ \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \domark
+ \pdfsetcolor{#1}%
+ }
+ %
+ \def\maincolor{\rgbBlack}
+ \pdfsetcolor{\maincolor}
+ \edef\thiscolor{\maincolor}
+ \def\lastcolordefs{}
+ %
+ \def\makefootline{%
+ \baselineskip24pt
+ \line{\pdfsetcolor{\maincolor}\the\footline}%
+ }
+ %
+ \def\makeheadline{%
+ \vbox to 0pt{%
+ \vskip-22.5pt
+ \line{%
+ \vbox to8.5pt{}%
+ % Extract \thiscolor definition from the marks.
+ \getcolormarks
+ % Typeset the headline with \maincolor, then restore the color.
+ \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
+ }%
+ \vss
+ }%
+ \nointerlineskip
+ }
+ %
+ % PDF outline support
+ %
+ % Emulate pdfTeX primitive
+ \def\pdfdest name#1 xyz{%
+ \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
+ }
+ %
+ \def\setpdfdestname#1{{%
+ % We have to set dummies so commands such as @code, and characters
+ % such as \, aren't expanded when present in a section title.
+ \indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ \iftxiuseunicodedestname
+ % Pass through Unicode characters.
+ \else
+ % Use ASCII approximations in destination names.
+ \passthroughcharsfalse
+ \fi
+ \def\pdfdestname{#1}%
+ \txiescapepdf\pdfdestname
+ }}
+ %
+ \def\setpdfoutlinetext#1{{%
+ \turnoffactive
+ % Always use Unicode characters in title texts.
+ \def\pdfoutlinetext{#1}%
+ % For XeTeX, xdvipdfmx converts to UTF-16.
+ % So we do not convert.
+ \txiescapepdf\pdfoutlinetext
+ }}
+ %
+ \def\pdfmkdest#1{%
+ \setpdfdestname{#1}%
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }
+ %
+ % by default, use black for everything.
+ \def\urlcolor{\rgbBlack}
+ \def\linkcolor{\rgbBlack}
+ \def\endlink{\setcolor{\maincolor}\pdfendlink}
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ \setpdfoutlinetext{#1}
+ \setpdfdestname{#3}
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{#4}%
+ \fi
+ %
+ \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
+ << /S /GoTo /D (\pdfdestname) >> >> }%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ %
+ % For XeTeX, counts of subentries are not necessary.
+ % Therefore, we read toc only once.
+ %
+ % We use node names as destinations.
+ \def\partentry##1##2##3##4{}% ignore parts in the outlines
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{1}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{2}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{3}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{4}{##3}{##4}}%
+ %
+ \let\appentry\numchapentry%
+ \let\appsecentry\numsecentry%
+ \let\appsubsecentry\numsubsecentry%
+ \let\appsubsubsecentry\numsubsubsecentry%
+ \let\unnchapentry\numchapentry%
+ \let\unnsecentry\numsecentry%
+ \let\unnsubsecentry\numsubsecentry%
+ \let\unnsubsubsecentry\numsubsubsecentry%
+ %
+ % For XeTeX, xdvipdfmx converts strings to UTF-16.
+ % Therefore, the encoding and the language may not be considered.
+ %
+ \indexnofonts
+ \setupdatafile
+ % We can have normal brace characters in the PDF outlines, unlike
+ % Texinfo index files. So set that up.
+ \def\{{\lbracecharliteral}%
+ \def\}{\rbracecharliteral}%
+ \catcode`\\=\active \otherbackslash
+ \input \tocreadfilename
+ \endgroup
+ }
+ {\catcode`[=1 \catcode`]=2
+ \catcode`{=\other \catcode`}=\other
+ \gdef\lbracecharliteral[{]%
+ \gdef\rbracecharliteral[}]%
+ ]
+
+ \special{pdf:docview << /PageMode /UseOutlines >> }
+ % ``\special{pdf:tounicode ...}'' is not necessary
+ % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
+ % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315,
+ % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings.
+ % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
+%
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \nextsp}
+ \def\getfilename#1{%
+ \filenamelength=0
+ % If we don't expand the argument now, \skipspaces will get
+ % snagged on things like "@value{foo}".
+ \edef\temp{#1}%
+ \expandafter\skipspaces\temp|\relax
+ }
+ % make a live url in pdf output.
+ \def\pdfurl#1{%
+ \begingroup
+ % it seems we really need yet another set of dummies; have not
+ % tried to figure out what each command should do in the context
+ % of @url. for now, just make @/ a no-op, that's the only one
+ % people have actually reported a problem with.
+ %
+ \normalturnoffactive
+ \def\@{@}%
+ \let\/=\empty
+ \makevalueexpandable
+ % do we want to go so far as to use \indexnofonts instead of just
+ % special-casing \var here?
+ \def\var##1{##1}%
+ %
+ \leavevmode\setcolor{\urlcolor}%
+ \special{pdf:bann << /Border [0 0 0]
+ /Subtype /Link /A << /S /URI /URI (#1) >> >>}%
+ \endgroup}
+ \def\endlink{\setcolor{\maincolor}\special{pdf:eann}}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \special{pdf:bann << /Border [0 0 0]
+ /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
+ \setcolor{\linkcolor}#1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+%
+ %
+ % @image support
+ %
% #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
\def\doxeteximage#1#2#3{%
\def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
\def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
%
- % XeTeX (and the PDF format) support .pdf, .png, .jpg (among
+ % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
% others). Let's try in that order, PDF first since if
% someone has a scalable image, presumably better to use that than a
% bitmap.
\let\xeteximgext=\empty
- \xeteximgpdffalse
\begingroup
\openin 1 #1.pdf \ifeof 1
\openin 1 #1.PDF \ifeof 1
@@ -1497,57 +1842,32 @@ output) for that.)}
\fi
\else \gdef\xeteximgext{png}%
\fi
- \else \gdef\xeteximgext{PDF} \global\xeteximgpdftrue%
+ \else \gdef\xeteximgext{PDF}%
\fi
- \else \gdef\xeteximgext{pdf} \global\xeteximgpdftrue%
+ \else \gdef\xeteximgext{pdf}%
\fi
\closein 1
\endgroup
%
- \ifxeteximgpdf
+ \def\xetexpdfext{pdf}%
+ \ifx\xeteximgext\xetexpdfext
\XeTeXpdffile "#1".\xeteximgext ""
\else
- \XeTeXpicfile "#1".\xeteximgext ""
+ \def\xetexpdfext{PDF}%
+ \ifx\xeteximgext\xetexpdfext
+ \XeTeXpdffile "#1".\xeteximgext ""
+ \else
+ \XeTeXpicfile "#1".\xeteximgext ""
+ \fi
\fi
\ifdim \wd0 >0pt width \xeteximagewidth \fi
\ifdim \wd2 >0pt height \xeteximageheight \fi \relax
}
\fi
-\message{fonts,}
-
-% Change the current font style to #1, remembering it in \curfontstyle.
-% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
-% italics, not bold italics.
-%
-\def\setfontstyle#1{%
- \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
- \csname ten#1\endcsname % change the current font
-}
-% Select #1 fonts with the current style.
%
-\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
-
-\def\rm{\fam=0 \setfontstyle{rm}}
-\def\it{\fam=\itfam \setfontstyle{it}}
-\def\sl{\fam=\slfam \setfontstyle{sl}}
-\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
-\def\tt{\fam=\ttfam \setfontstyle{tt}}
-
-% Unfortunately, we have to override this for titles and the like, since
-% in those cases "rm" is bold. Sigh.
-\def\rmisbold{\rm\def\curfontstyle{bf}}
-
-% Texinfo sort of supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf.
-\newfam\sffam
-\def\sf{\fam=\sffam \setfontstyle{sf}}
-\let\li = \sf % Sometimes we call it \li, not \sf.
-
-% We don't need math for this font style.
-\def\ttsl{\setfontstyle{ttsl}}
-
+\message{fonts,}
% Set the baselineskip to #1, and the lineskip and strut size
% correspondingly. There is no deep meaning behind these magic numbers
@@ -1898,8 +2218,8 @@ end
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
\setfont\defsl\slshape{10}{\magstep1}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf
-\let\tenttsl=\defttsl \let\tensl=\defsl \bf}
+\def\df{\let\ttfont=\deftt \let\bffont = \defbf
+\let\ttslfont=\defttsl \let\slfont=\defsl \bf}
% Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt}
@@ -1929,6 +2249,20 @@ end
\font\smallersy=cmsy8
\def\smallerecsize{0800}
+% Fonts for math mode superscripts (7pt).
+\def\sevennominalsize{7pt}
+\setfont\sevenrm\rmshape{7}{1000}{OT1}
+\setfont\seventt\ttshape{10}{700}{OT1TT}
+\setfont\sevenbf\bfshape{10}{700}{OT1}
+\setfont\sevenit\itshape{7}{1000}{OT1IT}
+\setfont\sevensl\slshape{10}{700}{OT1}
+\setfont\sevensf\sfshape{10}{700}{OT1}
+\setfont\sevensc\scshape{10}{700}{OT1}
+\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+\font\seveni=cmmi7
+\font\sevensy=cmsy7
+\def\sevenecsize{0700}
+
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
@@ -1986,7 +2320,7 @@ end
\font\ssecsy=cmsy10 scaled 1315
\def\ssececsize{1200}
-% Reduced fonts for @acro in text (10pt).
+% Reduced fonts for @acronym in text (10pt).
\def\reducednominalsize{10pt}
\setfont\reducedrm\rmshape{10}{1000}{OT1}
\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
@@ -2032,8 +2366,8 @@ end
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
\setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf
-\let\tensl=\defsl \let\tenttsl=\defttsl \bf}
+\def\df{\let\ttfont=\deftt \let\bffont = \defbf
+\let\slfont=\defsl \let\ttslfont=\defttsl \bf}
% Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt}
@@ -2063,6 +2397,20 @@ end
\font\smallersy=cmsy8
\def\smallerecsize{0800}
+% Fonts for math mode superscripts (7pt).
+\def\sevennominalsize{7pt}
+\setfont\sevenrm\rmshape{7}{1000}{OT1}
+\setfont\seventt\ttshape{10}{700}{OT1TT}
+\setfont\sevenbf\bfshape{10}{700}{OT1}
+\setfont\sevenit\itshape{7}{1000}{OT1IT}
+\setfont\sevensl\slshape{10}{700}{OT1}
+\setfont\sevensf\sfshape{10}{700}{OT1}
+\setfont\sevensc\scshape{10}{700}{OT1}
+\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+\font\seveni=cmmi7
+\font\sevensy=cmsy7
+\def\sevenecsize{0700}
+
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
@@ -2119,7 +2467,7 @@ end
\font\ssecsy=cmsy10
\def\ssececsize{1000}
-% Reduced fonts for @acro in text (9pt).
+% Reduced fonts for @acronym in text (9pt).
\def\reducednominalsize{9pt}
\setfont\reducedrm\rmshape{9}{1000}{OT1}
\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
@@ -2139,6 +2487,12 @@ end
\rm
} % end of 10pt text font size definitions, \definetextfontsizex
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}{OT1}
+\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}{OT1}
+\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
+
% We provide the user-level command
% @fonttextsize 10
@@ -2165,20 +2519,57 @@ end
\endgroup
}
+%
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+ \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+ \csname #1font\endcsname % change the current font
+}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+
% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families. We don't
-% bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
+% we have to define the \textfont of the standard families.
+% We don't bother to reset \scriptscriptfont; awaiting user need.
%
\def\resetmathfonts{%
- \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
- \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
- \textfont\ttfam=\tentt \textfont\sffam=\tensf
+ \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
+ \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
+ \textfont\ttfam=\ttfont \textfont\sffam=\sffont
+ %
+ % Fonts for superscript. Note that the 7pt fonts are used regardless
+ % of the current font size.
+ \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
+ \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
+ \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
+ \scriptfont\sffam=\sevensf
}
-% The font-changing commands redefine the meanings of \tenSTYLE, instead
-% of just \STYLE. We do this because \STYLE needs to also set the
-% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
-% \tenSTYLE to set the current font.
+%
+
+% The font-changing commands (all called \...fonts) redefine the meanings
+% of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs
+% to also set the current \fam for math mode. Our \STYLE (e.g., \rm)
+% commands hardwire \STYLEfont to set the current font.
+%
+% The fonts used for \ifont are for "math italics" (\itfont is for italics
+% in regular text). \syfont is also used in math mode only.
%
% Each font-changing command also sets the names \lsize (one size lower)
% and \lllsize (three sizes lower). These relative commands are used
@@ -2186,78 +2577,63 @@ end
%
% This all needs generalizing, badly.
%
-\def\textfonts{%
- \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
- \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
- \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
- \let\tenttsl=\textttsl
- \def\curfontsize{text}%
- \def\lsize{reduced}\def\lllsize{smaller}%
- \resetmathfonts \setleading{\textleading}}
-\def\titlefonts{%
- \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
- \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
- \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
- \let\tenttsl=\titlettsl
- \def\curfontsize{title}%
- \def\lsize{chap}\def\lllsize{subsec}%
- \resetmathfonts \setleading{27pt}}
-\def\titlefont#1{{\titlefonts\rmisbold #1}}
-\def\chapfonts{%
- \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
- \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
- \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
- \let\tenttsl=\chapttsl
- \def\curfontsize{chap}%
- \def\lsize{sec}\def\lllsize{text}%
- \resetmathfonts \setleading{19pt}}
-\def\secfonts{%
- \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
- \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
- \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
- \let\tenttsl=\secttsl
- \def\curfontsize{sec}%
- \def\lsize{subsec}\def\lllsize{reduced}%
- \resetmathfonts \setleading{17pt}}
-\def\subsecfonts{%
- \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
- \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
- \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
- \let\tenttsl=\ssecttsl
- \def\curfontsize{ssec}%
- \def\lsize{text}\def\lllsize{small}%
- \resetmathfonts \setleading{15pt}}
-\let\subsubsecfonts = \subsecfonts
-\def\reducedfonts{%
- \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
- \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
- \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
- \let\tenttsl=\reducedttsl
- \def\curfontsize{reduced}%
- \def\lsize{small}\def\lllsize{smaller}%
- \resetmathfonts \setleading{10.5pt}}
-\def\smallfonts{%
- \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
- \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
- \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
- \let\tenttsl=\smallttsl
- \def\curfontsize{small}%
- \def\lsize{smaller}\def\lllsize{smaller}%
- \resetmathfonts \setleading{10.5pt}}
-\def\smallerfonts{%
- \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
- \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
- \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
- \let\tenttsl=\smallerttsl
- \def\curfontsize{smaller}%
- \def\lsize{smaller}\def\lllsize{smaller}%
- \resetmathfonts \setleading{9.5pt}}
-% Fonts for short table of contents.
-\setfont\shortcontrm\rmshape{12}{1000}{OT1}
-\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
-\setfont\shortcontsl\slshape{12}{1000}{OT1}
-\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
+\def\assignfonts#1{%
+ \expandafter\let\expandafter\rmfont\csname #1rm\endcsname
+ \expandafter\let\expandafter\itfont\csname #1it\endcsname
+ \expandafter\let\expandafter\slfont\csname #1sl\endcsname
+ \expandafter\let\expandafter\bffont\csname #1bf\endcsname
+ \expandafter\let\expandafter\ttfont\csname #1tt\endcsname
+ \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname
+ \expandafter\let\expandafter\sffont \csname #1sf\endcsname
+ \expandafter\let\expandafter\ifont \csname #1i\endcsname
+ \expandafter\let\expandafter\syfont \csname #1sy\endcsname
+ \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname
+}
+
+\newif\ifrmisbold
+
+% Select smaller font size with the current style. Used to change font size
+% in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for
+% normal roman text, also use bold fonts for roman text in the smaller size.
+\def\switchtolllsize{%
+ \expandafter\assignfonts\expandafter{\lllsize}%
+ \ifrmisbold
+ \let\rmfont\bffont
+ \fi
+ \csname\curfontstyle\endcsname
+}%
+
+\def\switchtolsize{%
+ \expandafter\assignfonts\expandafter{\lsize}%
+ \ifrmisbold
+ \let\rmfont\bffont
+ \fi
+ \csname\curfontstyle\endcsname
+}%
+
+\def\definefontsetatsize#1#2#3#4#5{%
+\expandafter\def\csname #1fonts\endcsname{%
+ \def\curfontsize{#1}%
+ \def\lsize{#2}\def\lllsize{#3}%
+ \csname rmisbold#5\endcsname
+ \assignfonts{#1}%
+ \resetmathfonts
+ \setleading{#4}%
+}}
+
+\definefontsetatsize{text} {reduced}{smaller}{\textleading}{false}
+\definefontsetatsize{title} {chap} {subsec} {27pt} {true}
+\definefontsetatsize{chap} {sec} {text} {19pt} {true}
+\definefontsetatsize{sec} {subsec} {reduced}{17pt} {true}
+\definefontsetatsize{ssec} {text} {small} {15pt} {true}
+\definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false}
+\definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false}
+\definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false}
+
+\def\titlefont#1{{\titlefonts\rm #1}}
+\let\subsecfonts = \ssecfonts
+\let\subsubsecfonts = \ssecfonts
% Define these just so they can be easily changed for other fonts.
\def\angleleft{$\langle$}
@@ -2295,26 +2671,11 @@ end
% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
% define and register \INITMACRO to be called on markup style changes.
% \INITMACRO can check \currentmarkupstyle for the innermost
-% style and the set of \ifmarkupSTYLE switches for all styles
-% currently in effect.
-\newif\ifmarkupvar
-\newif\ifmarkupsamp
-\newif\ifmarkupkey
-%\newif\ifmarkupfile % @file == @samp.
-%\newif\ifmarkupoption % @option == @samp.
-\newif\ifmarkupcode
-\newif\ifmarkupkbd
-%\newif\ifmarkupenv % @env == @code.
-%\newif\ifmarkupcommand % @command == @code.
-\newif\ifmarkuptex % @tex (and part of @math, for now).
-\newif\ifmarkupexample
-\newif\ifmarkupverb
-\newif\ifmarkupverbatim
+% style.
\let\currentmarkupstyle\empty
\def\setupmarkupstyle#1{%
- \csname markup#1true\endcsname
\def\currentmarkupstyle{#1}%
\markupstylesetup
}
@@ -2376,11 +2737,15 @@ end
% lilypond developers report. xpdf does work with the regular 0x27.
%
\def\codequoteright{%
- \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
- \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
- '%
+ \ifmonospace
+ \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else \char'15 \fi
\else \char'15 \fi
- \else \char'15 \fi
+ \else
+ '%
+ \fi
}
%
% and a similar option for the left quote char vs. a grave accent.
@@ -2388,13 +2753,17 @@ end
% the code environments to do likewise.
%
\def\codequoteleft{%
- \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
- \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
- % [Knuth] pp. 380,381,391
- % \relax disables Spanish ligatures ?` and !` of \tt font.
- \relax`%
+ \ifmonospace
+ \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+ \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+ % [Knuth] pp. 380,381,391
+ % \relax disables Spanish ligatures ?` and !` of \tt font.
+ \relax`%
+ \else \char'22 \fi
\else \char'22 \fi
- \else \char'22 \fi
+ \else
+ \relax`%
+ \fi
}
% Commands to set the quote options.
@@ -2673,6 +3042,7 @@ end
\setbox0 = \hbox{\ignorespaces #2}% look for second arg
\ifdim\wd0 > 0pt
\ifpdf
+ % For pdfTeX and LuaTeX
\ifurefurlonlylink
% PDF plus option to not display url, show just arg
\unhbox0
@@ -2682,7 +3052,19 @@ end
\unhbox0\ (\urefcode{#1})%
\fi
\else
- \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
+ \ifx\XeTeXrevision\thisisundefined
+ \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
+ \else
+ % For XeTeX
+ \ifurefurlonlylink
+ % PDF plus option to not display url, show just arg
+ \unhbox0
+ \else
+ % PDF, normally display both arg and url for consistency,
+ % visibility, if the pdf is eventually used to print, etc.
+ \unhbox0\ (\urefcode{#1})%
+ \fi
+ \fi
\fi
\else
\urefcode{#1}% only url given, so show it
@@ -2783,7 +3165,18 @@ end
\endlink
\endgroup}
\else
- \let\email=\uref
+ \ifx\XeTeXrevision\thisisundefined
+ \let\email=\uref
+ \else
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+ \fi
\fi
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
@@ -2858,7 +3251,7 @@ end
%
\def\acronym#1{\doacronym #1,,\finish}
\def\doacronym#1,#2,#3\finish{%
- {\selectfonts\lsize #1}%
+ {\switchtolsize #1}%
\def\temp{#2}%
\ifx\temp\empty \else
\space ({\unsepspaces \ignorespaces \temp \unskip})%
@@ -2951,10 +3344,10 @@ end
% fix it (significant additions to font machinery) until someone notices.
%
\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
-\def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}%
+\def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}%
%
\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
-\def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}%
+\def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
@@ -3018,23 +3411,10 @@ end
\let\atchar=\@
% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
-% Unless we're in typewriter, use \ecfont because the CM text fonts do
-% not have braces, and we don't want to switch into math.
-\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
-\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
-\let\{=\mylbrace \let\lbracechar=\{
-\let\}=\myrbrace \let\rbracechar=\}
-\begingroup
- % Definitions to produce \{ and \} commands for indices,
- % and @{ and @} for the aux/toc files.
- \catcode`\{ = \other \catcode`\} = \other
- \catcode`\[ = 1 \catcode`\] = 2
- \catcode`\! = 0 \catcode`\\ = \other
- !gdef!lbracecmd[\{]%
- !gdef!rbracecmd[\}]%
- !gdef!lbraceatcmd[@{]%
- !gdef!rbraceatcmd[@}]%
-!endgroup
+\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}}
+\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}}
+\let\{=\lbracechar
+\let\}=\rbracechar
% @comma{} to avoid , parsing problems.
\let\comma = ,
@@ -3052,8 +3432,8 @@ end
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`}
\def\exclamdown{!`}
-\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
-\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+\def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}}
% Dotless i and dotless j, used for accents.
\def\imacro{i}
@@ -3082,12 +3462,12 @@ end
{\setbox0=\hbox{T}%
\vbox to \ht0{\hbox{%
\ifx\textnominalsize\xwordpt
- % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
+ % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX.
% Revert to plain's \scriptsize, which is 7pt.
\count255=\the\fam $\fam\count255 \scriptstyle A$%
\else
% For 11pt, we can use our lllsize.
- \selectfonts\lllsize A%
+ \switchtolllsize A%
\fi
}%
\vss
@@ -3153,7 +3533,7 @@ end
%
\newbox\errorbox
%
-{\tentt \global\dimen0 = 3em}% Width of the box.
+{\ttfont \global\dimen0 = 3em}% Width of the box.
\dimen2 = .55pt % Thickness of rules
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
@@ -3304,7 +3684,7 @@ end
% Adapted from the plain.tex definition of \copyright.
%
\def\registeredsymbol{%
- $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}%
\hfil\crcr\Orb}}%
}$%
}
@@ -3337,13 +3717,16 @@ end
\newif\ifseenauthor
\newif\iffinishedtitlepage
-% Do an implicit @contents or @shortcontents after @end titlepage if the
-% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
-%
-\newif\ifsetcontentsaftertitlepage
- \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
-\newif\ifsetshortcontentsaftertitlepage
- \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+% @setcontentsaftertitlepage used to do an implicit @contents or
+% @shortcontents after @end titlepage, but it is now obsolete.
+\def\setcontentsaftertitlepage{%
+ \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
+ command; move your @contents command if you want the contents
+ after the title page.}}%
+\def\setshortcontentsaftertitlepage{%
+ \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
+ command; move your @shortcontents and @contents commands if you
+ want the contents after the title page.}}%
\parseargdef\shorttitlepage{%
\begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
@@ -3385,20 +3768,6 @@ end
% Need this before the \...aftertitlepage checks so that if they are
% in effect the toc pages will come out with page numbers.
\HEADINGSon
- %
- % If they want short, they certainly want long too.
- \ifsetshortcontentsaftertitlepage
- \shortcontents
- \contents
- \global\let\shortcontents = \relax
- \global\let\contents = \relax
- \fi
- %
- \ifsetcontentsaftertitlepage
- \contents
- \global\let\contents = \relax
- \global\let\shortcontents = \relax
- \fi
}
\def\finishtitlepage{%
@@ -3409,12 +3778,11 @@ end
% Settings used for typesetting titles: no hyphenation, no indentation,
% don't worry much about spacing, ragged right. This should be used
-% inside a \vbox, and fonts need to be set appropriately first. Because
-% it is always used for titles, nothing else, we call \rmisbold. \par
-% should be specified before the end of the \vbox, since a vbox is a group.
+% inside a \vbox, and fonts need to be set appropriately first. \par should
+% be specified before the end of the \vbox, since a vbox is a group.
%
\def\raggedtitlesettings{%
- \rmisbold
+ \rm
\hyphenpenalty=10000
\parindent=0pt
\tolerance=5000
@@ -3423,7 +3791,7 @@ end
% Macros to be used within @titlepage:
-\let\subtitlerm=\tenrm
+\let\subtitlerm=\rmfont
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
\parseargdef\title{%
@@ -3449,7 +3817,7 @@ end
\else
\checkenv\titlepage
\ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
- {\secfonts\rmisbold \leftline{#1}}%
+ {\secfonts\rm \leftline{#1}}%
\fi
}
@@ -3502,7 +3870,7 @@ end
%
% Leave some space for the footline. Hopefully ok to assume
% @evenfooting will not be used by itself.
- \global\advance\pageheight by -12pt
+ \global\advance\txipageheight by -12pt
\global\advance\vsize by -12pt
}
@@ -3527,9 +3895,9 @@ end
\def\oddheadingmarks{\headingmarks{odd}{heading}}
\def\evenfootingmarks{\headingmarks{even}{footing}}
\def\oddfootingmarks{\headingmarks{odd}{footing}}
-\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
+\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
\headingmarks{odd}{heading}{#1} }
-\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
+\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
\headingmarks{odd}{footing}{#1} }
% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
\def\headingmarks#1#2#3 {%
@@ -3550,7 +3918,7 @@ end
% By default, they are off at the start of a document,
% and turned `on' after @end titlepage.
-\def\headings #1 {\csname HEADINGS#1\endcsname}
+\parseargdef\headings{\csname HEADINGS#1\endcsname}
\def\headingsoff{% non-global headings elimination
\evenheadline={\hfil}\evenfootline={\hfil}%
@@ -4364,6 +4732,31 @@ end
\fi
}
+% Like \expandablevalue, but completely expandable (the \message in the
+% definition above operates at the execution level of TeX). Used when
+% writing to auxiliary files, due to the expansion that \write does.
+% If flag is undefined, pass through an unexpanded @value command: maybe it
+% will be set by the time it is read back in.
+%
+% NB flag names containing - or _ may not work here.
+\def\dummyvalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \noexpand\value{#1}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% Used for @value's in index entries to form the sort key: expand the @value
+% if possible, otherwise sort late.
+\def\indexnofontsvalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ ZZZZZZZ
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
%
@@ -4488,14 +4881,7 @@ end
% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
% #3 the target index (bar).
\def\dosynindex#1#2#3{%
- % Only do \closeout if we haven't already done it, else we'll end up
- % closing the target index.
- \expandafter \ifx\csname donesynindex#2\endcsname \relax
- % The \closeout helps reduce unnecessary open files; the limit on the
- % Acorn RISC OS is a mere 16 files.
- \expandafter\closeout\csname#2indfile\endcsname
- \expandafter\let\csname donesynindex#2\endcsname = 1
- \fi
+ \requireopenindexfile{#3}%
% redefine \fooindfile:
\expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
\expandafter\let\csname#2indfile\endcsname=\temp
@@ -4505,7 +4891,7 @@ end
% Define \doindex, the driver for all index macros.
% Argument #1 is generated by the calling \fooindex macro,
-% and it the two-letter name of the index.
+% and it is the two-letter name of the index.
\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
\def\doindexxxx #1{\doind{\indexname}{#1}}
@@ -4514,63 +4900,61 @@ end
\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
-% Used when writing an index entry out to an index file, to prevent
+
+% Used when writing an index entry out to an index file to prevent
% expansion of Texinfo commands that can appear in an index entry.
%
\def\indexdummies{%
\escapechar = `\\ % use backslash in output files.
- \def\@{@}% change to @@ when we switch to @ as escape char in index files.
- \def\ {\realbackslash\space }%
- %
- % Need these unexpandable (because we define \tt as a dummy)
- % definitions when @{ or @} appear in index entry text. Also, more
- % complicated, when \tex is in effect and \{ is a \delimiter again.
- % We can't use \lbracecmd and \rbracecmd because texindex assumes
- % braces and backslashes are used only as delimiters. Perhaps we
- % should use @lbracechar and @rbracechar?
- \def\{{{\tt\char123}}%
- \def\}{{\tt\char125}}%
+ \definedummyletter\@%
+ \definedummyletter\ %
+ %
+ % For texindex which always views { and } as separators.
+ \def\{{\lbracechar{}}%
+ \def\}{\rbracechar{}}%
%
% Do the redefinitions.
- \commondummies
+ \definedummies
}
-% For the aux and toc files, @ is the escape character. So we want to
-% redefine everything using @ as the escape character (instead of
-% \realbackslash, still used for index files). When everything uses @,
-% this will be simpler.
+% Used for the aux and toc files, where @ is the escape character.
%
\def\atdummies{%
- \def\@{@@}%
- \def\ {@ }%
- \let\{ = \lbraceatcmd
- \let\} = \rbraceatcmd
+ \definedummyletter\@%
+ \definedummyletter\ %
+ \definedummyletter\{%
+ \definedummyletter\}%
%
% Do the redefinitions.
- \commondummies
+ \definedummies
\otherbackslash
}
-% Called from \indexdummies and \atdummies.
+% \definedummyword defines \#1 as \string\#1\space, thus effectively
+% preventing its expansion. This is used only for control words,
+% not control letters, because the \space would be incorrect for
+% control characters, but is needed to separate the control word
+% from whatever follows.
%
-\def\commondummies{%
- % \definedummyword defines \#1 as \string\#1\space, thus effectively
- % preventing its expansion. This is used only for control words,
- % not control letters, because the \space would be incorrect for
- % control characters, but is needed to separate the control word
- % from whatever follows.
- %
- % For control letters, we have \definedummyletter, which omits the
- % space.
- %
- % These can be used both for control words that take an argument and
- % those that do not. If it is followed by {arg} in the input, then
- % that will dutifully get written to the index (or wherever).
- %
- \def\definedummyword ##1{\def##1{\string##1\space}}%
- \def\definedummyletter##1{\def##1{\string##1}}%
- \let\definedummyaccent\definedummyletter
+% These can be used both for control words that take an argument and
+% those that do not. If it is followed by {arg} in the input, then
+% that will dutifully get written to the index (or wherever).
+%
+% For control letters, we have \definedummyletter, which omits the
+% space.
+%
+\def\definedummyword #1{\def#1{\string#1\space}}%
+\def\definedummyletter#1{\def#1{\string#1}}%
+\let\definedummyaccent\definedummyletter
+
+% Called from \indexdummies and \atdummies, to effectively prevent
+% the expansion of commands.
+%
+\def\definedummies{%
%
+ \let\commondummyword\definedummyword
+ \let\commondummyletter\definedummyletter
+ \let\commondummyaccent\definedummyaccent
\commondummiesnofonts
%
\definedummyletter\_%
@@ -4611,6 +4995,7 @@ end
\definedummyword\TeX
%
% Assorted special characters.
+ \definedummyword\atchar
\definedummyword\arrow
\definedummyword\bullet
\definedummyword\comma
@@ -4650,85 +5035,82 @@ end
%
% We want to disable all macros so that they are not expanded by \write.
\macrolist
+ \let\value\dummyvalue
%
\normalturnoffactive
- %
- % Handle some cases of @value -- where it does not contain any
- % (non-fully-expandable) commands.
- \makevalueexpandable
}
-% \commondummiesnofonts: common to \commondummies and \indexnofonts.
-% Define \definedumyletter, \definedummyaccent and \definedummyword before
-% using.
+% \commondummiesnofonts: common to \definedummies and \indexnofonts.
+% Define \commondummyletter, \commondummyaccent and \commondummyword before
+% using. Used for accents, font commands, and various control letters.
%
\def\commondummiesnofonts{%
% Control letters and accents.
- \definedummyletter\!%
- \definedummyaccent\"%
- \definedummyaccent\'%
- \definedummyletter\*%
- \definedummyaccent\,%
- \definedummyletter\.%
- \definedummyletter\/%
- \definedummyletter\:%
- \definedummyaccent\=%
- \definedummyletter\?%
- \definedummyaccent\^%
- \definedummyaccent\`%
- \definedummyaccent\~%
- \definedummyword\u
- \definedummyword\v
- \definedummyword\H
- \definedummyword\dotaccent
- \definedummyword\ogonek
- \definedummyword\ringaccent
- \definedummyword\tieaccent
- \definedummyword\ubaraccent
- \definedummyword\udotaccent
- \definedummyword\dotless
+ \commondummyletter\!%
+ \commondummyaccent\"%
+ \commondummyaccent\'%
+ \commondummyletter\*%
+ \commondummyaccent\,%
+ \commondummyletter\.%
+ \commondummyletter\/%
+ \commondummyletter\:%
+ \commondummyaccent\=%
+ \commondummyletter\?%
+ \commondummyaccent\^%
+ \commondummyaccent\`%
+ \commondummyaccent\~%
+ \commondummyword\u
+ \commondummyword\v
+ \commondummyword\H
+ \commondummyword\dotaccent
+ \commondummyword\ogonek
+ \commondummyword\ringaccent
+ \commondummyword\tieaccent
+ \commondummyword\ubaraccent
+ \commondummyword\udotaccent
+ \commondummyword\dotless
%
% Texinfo font commands.
- \definedummyword\b
- \definedummyword\i
- \definedummyword\r
- \definedummyword\sansserif
- \definedummyword\sc
- \definedummyword\slanted
- \definedummyword\t
+ \commondummyword\b
+ \commondummyword\i
+ \commondummyword\r
+ \commondummyword\sansserif
+ \commondummyword\sc
+ \commondummyword\slanted
+ \commondummyword\t
%
% Commands that take arguments.
- \definedummyword\abbr
- \definedummyword\acronym
- \definedummyword\anchor
- \definedummyword\cite
- \definedummyword\code
- \definedummyword\command
- \definedummyword\dfn
- \definedummyword\dmn
- \definedummyword\email
- \definedummyword\emph
- \definedummyword\env
- \definedummyword\file
- \definedummyword\image
- \definedummyword\indicateurl
- \definedummyword\inforef
- \definedummyword\kbd
- \definedummyword\key
- \definedummyword\math
- \definedummyword\option
- \definedummyword\pxref
- \definedummyword\ref
- \definedummyword\samp
- \definedummyword\strong
- \definedummyword\tie
- \definedummyword\U
- \definedummyword\uref
- \definedummyword\url
- \definedummyword\var
- \definedummyword\verb
- \definedummyword\w
- \definedummyword\xref
+ \commondummyword\abbr
+ \commondummyword\acronym
+ \commondummyword\anchor
+ \commondummyword\cite
+ \commondummyword\code
+ \commondummyword\command
+ \commondummyword\dfn
+ \commondummyword\dmn
+ \commondummyword\email
+ \commondummyword\emph
+ \commondummyword\env
+ \commondummyword\file
+ \commondummyword\image
+ \commondummyword\indicateurl
+ \commondummyword\inforef
+ \commondummyword\kbd
+ \commondummyword\key
+ \commondummyword\math
+ \commondummyword\option
+ \commondummyword\pxref
+ \commondummyword\ref
+ \commondummyword\samp
+ \commondummyword\strong
+ \commondummyword\tie
+ \commondummyword\U
+ \commondummyword\uref
+ \commondummyword\url
+ \commondummyword\var
+ \commondummyword\verb
+ \commondummyword\w
+ \commondummyword\xref
}
% For testing: output @{ and @} in index sort strings as \{ and \}.
@@ -4784,11 +5166,11 @@ end
%
\def\indexnofonts{%
% Accent commands should become @asis.
- \def\definedummyaccent##1{\let##1\asis}%
+ \def\commondummyaccent##1{\let##1\asis}%
% We can just ignore other control letters.
- \def\definedummyletter##1{\let##1\empty}%
+ \def\commondummyletter##1{\let##1\empty}%
% All control words become @asis by default; overrides below.
- \let\definedummyword\definedummyaccent
+ \let\commondummyword\commondummyaccent
\commondummiesnofonts
%
% Don't no-op \tt, since it isn't a user-level command
@@ -4830,37 +5212,40 @@ end
\def\LaTeX{LaTeX}%
\def\TeX{TeX}%
%
- % Assorted special characters.
- % (The following {} will end up in the sort string, but that's ok.)
- \def\arrow{->}%
- \def\bullet{bullet}%
- \def\comma{,}%
- \def\copyright{copyright}%
- \def\dots{...}%
- \def\enddots{...}%
- \def\equiv{==}%
- \def\error{error}%
- \def\euro{euro}%
- \def\expansion{==>}%
- \def\geq{>=}%
- \def\guillemetleft{<<}%
- \def\guillemetright{>>}%
- \def\guilsinglleft{<}%
- \def\guilsinglright{>}%
- \def\leq{<=}%
- \def\minus{-}%
- \def\point{.}%
- \def\pounds{pounds}%
- \def\print{-|}%
- \def\quotedblbase{"}%
- \def\quotedblleft{"}%
- \def\quotedblright{"}%
- \def\quoteleft{`}%
- \def\quoteright{'}%
- \def\quotesinglbase{,}%
- \def\registeredsymbol{R}%
- \def\result{=>}%
- \def\textdegree{o}%
+ % Assorted special characters. \defglyph gives the control sequence a
+ % definition that removes the {} that follows its use.
+ \defglyph\atchar{@}%
+ \defglyph\arrow{->}%
+ \defglyph\bullet{bullet}%
+ \defglyph\comma{,}%
+ \defglyph\copyright{copyright}%
+ \defglyph\dots{...}%
+ \defglyph\enddots{...}%
+ \defglyph\equiv{==}%
+ \defglyph\error{error}%
+ \defglyph\euro{euro}%
+ \defglyph\expansion{==>}%
+ \defglyph\geq{>=}%
+ \defglyph\guillemetleft{<<}%
+ \defglyph\guillemetright{>>}%
+ \defglyph\guilsinglleft{<}%
+ \defglyph\guilsinglright{>}%
+ \defglyph\leq{<=}%
+ \defglyph\lbracechar{\{}%
+ \defglyph\minus{-}%
+ \defglyph\point{.}%
+ \defglyph\pounds{pounds}%
+ \defglyph\print{-|}%
+ \defglyph\quotedblbase{"}%
+ \defglyph\quotedblleft{"}%
+ \defglyph\quotedblright{"}%
+ \defglyph\quoteleft{`}%
+ \defglyph\quoteright{'}%
+ \defglyph\quotesinglbase{,}%
+ \defglyph\rbracechar{\}}%
+ \defglyph\registeredsymbol{R}%
+ \defglyph\result{=>}%
+ \defglyph\textdegree{o}%
%
% We need to get rid of all macros, leaving only the arguments (if present).
% Of course this is not nearly correct, but it is the best we can do for now.
@@ -4873,7 +5258,11 @@ end
% goes to end-of-line is not handled.
%
\macrolist
+ \let\value\indexnofontsvalue
}
+\def\defglyph#1#2{\def#1##1{#2}} % see above
+
+
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
@@ -4920,9 +5309,10 @@ end
\ifx\suffix\indexisfl\def\suffix{f1}\fi
% Open the file
\immediate\openout\csname#1indfile\endcsname \jobname.\suffix
- % Using \immediate here prevents an object entering into the current box,
- % which could confound checks such as those in \safewhatsit for preceding
- % skips.
+ % Using \immediate above here prevents an object entering into the current
+ % box, which could confound checks such as those in \safewhatsit for
+ % preceding skips.
+ \typeout{Writing index file \jobname.\suffix}%
\fi}
\def\indexisfl{fl}
@@ -5120,7 +5510,7 @@ end
% \initial {@}
% as its first line, TeX doesn't complain about mismatched braces
% (because it thinks @} is a control sequence).
- \catcode`\@ = 11
+ \catcode`\@ = 12
% See comment in \requireopenindexfile.
\def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
\openin 1 \jobname.\indexname s
@@ -5130,9 +5520,9 @@ end
% index. The easiest way to prevent this problem is to make sure
% there is some text.
\putwordIndexNonexistent
+ \typeout{No file \jobname.\indexname s.}%
\else
\catcode`\\ = 0
- \escapechar = `\\
%
% If the index file exists but is empty, then \openin leaves \ifeof
% false. We have to make TeX try to read something from the file, so
@@ -5148,17 +5538,15 @@ end
\let\indexlbrace\{ % Likewise, set these sequences for braces
\let\indexrbrace\} % used in the sort key.
\begindoublecolumns
- \let\entryorphanpenalty=\indexorphanpenalty
+ \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty
%
% Read input from the index file line by line.
\loopdo
- \ifeof1
- \let\firsttoken\relax
- \else
+ \ifeof1 \else
\read 1 to \nextline
- \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
- \act
\fi
+ %
+ \indexinputprocessing
\thisline
%
\ifeof1\else
@@ -5170,12 +5558,20 @@ end
\fi
\closein 1
\endgroup}
+\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
+\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
+\def\indexinputprocessing{%
+ \ifeof1
+ \let\firsttoken\relax
+ \else
+ \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
+ \act
+ \fi
+}
\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
-\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
-\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
@@ -5249,6 +5645,12 @@ end
\def\entry{%
\begingroup
%
+ % For pdfTeX and XeTeX.
+ % The redefinition of \domark stops marks being added in \pdflink to
+ % preserve coloured links across page boundaries. Otherwise the marks
+ % would get in the way of \lastbox in \insertentrybox.
+ \let\domark\relax
+ %
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
\par
@@ -5262,10 +5664,6 @@ end
\def\*{\unskip\space\ignorespaces}%
\def\entrybreak{\hfil\break}% An undocumented command
%
- % A bit of stretch before each entry for the benefit of balancing
- % columns.
- \vskip 0pt plus0.5pt
- %
% Swallow the left brace of the text (first parameter):
\afterassignment\doentry
\let\temp =
@@ -5299,26 +5697,25 @@ end
%
\ifpdf
\pdfgettoks#1.%
- \bgroup\let\domark\relax
- \hskip\skip\thinshrinkable\the\toksA
- \egroup
- % The redefinion of \domark stops marks being added in \pdflink to
- % preserve coloured links across page boundaries. Otherwise the marks
- % would get in the way of \lastbox in \insertindexentrybox.
+ \hskip\skip\thinshrinkable\the\toksA
\else
- \hskip\skip\thinshrinkable #1%
+ \ifx\XeTeXrevision\thisisundefined
+ \hskip\skip\thinshrinkable #1%
+ \else
+ \pdfgettoks#1.%
+ \hskip\skip\thinshrinkable\the\toksA
+ \fi
\fi
\fi
\egroup % end \boxA
\ifdim\wd\boxB = 0pt
- \global\setbox\entryindexbox=\vbox{\unhbox\boxA}%
+ \global\setbox\entrybox=\vbox{\unhbox\boxA}%
\else
- \global\setbox\entryindexbox=\vbox\bgroup
- \prevdepth=\entrylinedepth
- \noindent
+ \global\setbox\entrybox=\vbox\bgroup
% We want the text of the entries to be aligned to the left, and the
% page numbers to be aligned to the right.
%
+ \parindent = 0pt
\advance\leftskip by 0pt plus 1fil
\advance\leftskip by 0pt plus -1fill
\rightskip = 0pt plus -1fil
@@ -5327,8 +5724,6 @@ end
% if the list of page numbers is long, to be aligned to the right.
\parfillskip=0pt plus -1fill
%
- \hangindent=1em
- %
\advance\rightskip by \entryrightmargin
% Determine how far we can stretch into the margin.
% This allows, e.g., "Appendix H GNU Free Documentation License" to
@@ -5346,19 +5741,27 @@ end
\advance\dimen@ii by 1\dimen@i
\ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
\ifdim\dimen@ > 0.8\dimen@ii % due to long index text
- \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly
+ % Try to split the text roughly evenly. \dimen@ will be the length of
+ % the first line.
+ \dimen@ = 0.7\dimen@
\dimen@ii = \hsize
- \advance \dimen@ii by -1em
\ifnum\dimen@>\dimen@ii
- % If the entry is too long, use the whole line
+ % If the entry is too long (for example, if it needs more than
+ % two lines), use all the space in the first line.
\dimen@ = \dimen@ii
\fi
\advance\leftskip by 0pt plus 1fill % ragged right
\advance \dimen@ by 1\rightskip
- \parshape = 2 0pt \dimen@ 1em \dimen@ii
- % Ideally we'd add a finite glue at the end of the first line only, but
- % TeX doesn't seem to provide a way to do such a thing.
+ \parshape = 2 0pt \dimen@ 0em \dimen@ii
+ % Ideally we'd add a finite glue at the end of the first line only,
+ % instead of using \parshape with explicit line lengths, but TeX
+ % doesn't seem to provide a way to do such a thing.
+ %
+ % Indent all lines but the first one.
+ \advance\leftskip by 1em
+ \advance\parindent by -1em
\fi\fi
+ \indent % start paragraph
\unhbox\boxA
%
% Do not prefer a separate line ending with a hyphen to fewer lines.
@@ -5374,53 +5777,54 @@ end
\egroup % The \vbox
\fi
\endgroup
- % delay text of entry until after penalty
- \bgroup\aftergroup\insertindexentrybox
- \entryorphanpenalty
+ \dotheinsertentrybox
}}
\newskip\thinshrinkable
\skip\thinshrinkable=.15em minus .15em
-\newbox\entryindexbox
-\def\insertindexentrybox{%
- \copy\entryindexbox
- % The following gets the depth of the last box. This is for even
- % line spacing when entries span several lines.
- \setbox\dummybox\vbox{%
- \unvbox\entryindexbox
- \nointerlineskip
- \lastbox
- \global\entrylinedepth=\prevdepth
- }%
- % Note that we couldn't simply \unvbox\entryindexbox followed by
- % \nointerlineskip\lastbox to remove the last box and then reinstate it,
- % because this resets how far the box has been \moveleft'ed to 0. \unvbox
- % doesn't affect \prevdepth either.
+\newbox\entrybox
+\def\insertentrybox{%
+ \ourunvbox\entrybox
}
-\newdimen\entrylinedepth
-% Default is no penalty
-\let\entryorphanpenalty\egroup
+% default definition
+\let\dotheinsertentrybox\insertentrybox
+
+% Use \lastbox to take apart vbox box by box, and add each sub-box
+% to the current vertical list.
+\def\ourunvbox#1{%
+\bgroup % for local binding of \delayedbox
+ % Remove the last box from box #1
+ \global\setbox#1=\vbox{%
+ \unvbox#1%
+ \unskip % remove any glue
+ \unpenalty
+ \global\setbox\interbox=\lastbox
+ }%
+ \setbox\delayedbox=\box\interbox
+ \ifdim\ht#1=0pt\else
+ \ourunvbox#1 % Repeat on what's left of the box
+ \nobreak
+ \fi
+ \box\delayedbox
+\egroup
+}
+\newbox\delayedbox
+\newbox\interbox
% Used from \printindex. \firsttoken should be the first token
% after the \entry. If it's not another \entry, we are at the last
% line of a group of index entries, so insert a penalty to discourage
-% orphaned index entries.
-\long\def\indexorphanpenalty{%
- \def\isentry{\entry}%
+% widowed index entries.
+\def\dotheinsertentryboxwithpenalty{%
\ifx\firsttoken\isentry
\else
- \unskip\penalty 9000
- % The \unskip here stops breaking before the glue. It relies on the
- % \vskip above being there, otherwise there is an error
- % "You can't use `\unskip' in vertical mode". There has to be glue
- % in the current vertical list that hasn't been added to the
- % "current page". See Chapter 24 of the TeXbook. This contradicts
- % Section 8.3.7 in "TeX by Topic," though.
+ \penalty 9000
\fi
- \egroup % now comes the box added with \aftergroup
+ \insertentrybox
}
+\def\isentry{\entry}%
% Like plain.tex's \dotfill, except uses up at least 1 em.
% The filll stretch here overpowers both the fil and fill stretch to push
@@ -5441,7 +5845,11 @@ end
\ifpdf
\pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
\else
- #2
+ \ifx\XeTeXrevision\thisisundefined
+ #2
+ \else
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \fi
\fi
\par
}}
@@ -5453,8 +5861,6 @@ end
\newbox\partialpage
\newdimen\doublecolumnhsize
-\newdimen\doublecolumntopgap
-\doublecolumntopgap = 0pt
% Use inside an output routine to save \topmark and \firstmark
\def\savemarks{%
@@ -5535,14 +5941,12 @@ end
\divide\doublecolumnhsize by 2
\hsize = \doublecolumnhsize
%
- % Double the \vsize as well. (We don't need a separate register here,
- % since nobody clobbers \vsize.)
- \global\doublecolumntopgap = \topskip
- \global\advance\doublecolumntopgap by -1\baselineskip
- \advance\vsize by -1\doublecolumntopgap
+ % Double the \vsize as well.
+ \advance\vsize by -\ht\partialpage
\vsize = 2\vsize
- \topskip=0pt
- \global\entrylinedepth=0pt\relax
+ %
+ % For the benefit of balancing columns
+ \advance\baselineskip by 0pt plus 0.5pt
}
% The double-column output routine for all double-column pages except
@@ -5556,12 +5960,12 @@ end
% previous page.
\dimen@ = \vsize
\divide\dimen@ by 2
- \advance\dimen@ by -\ht\partialpage
%
% box0 will be the left-hand column, box2 the right.
- \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
+ \global\advance\vsize by 2\ht\partialpage
\onepageout\pagesofar
- \unvbox255
+ \unvbox\PAGE
\penalty\outputpenalty
}
%
@@ -5572,9 +5976,7 @@ end
%
\hsize = \doublecolumnhsize
\wd0=\hsize \wd2=\hsize
- \vbox{%
- \vskip\doublecolumntopgap
- \hbox to\pagewidth{\box0\hfil\box2}}%
+ \hbox to\txipagewidth{\box0\hfil\box2}%
}
@@ -5601,7 +6003,7 @@ end
% goal. When TeX sees \eject from below which follows the final
% section, it invokes the new output routine that we've set after
% \balancecolumns below; \onepageout will try to fit the two columns
- % and the final section into the vbox of \pageheight (see
+ % and the final section into the vbox of \txipageheight (see
% \pagebody), causing an overfull box.
%
% Note that glue won't work here, because glue does not exercise the
@@ -5612,24 +6014,30 @@ end
% Split the last of the double-column material.
\savemarks
\balancecolumns
- %
+ }%
+ \eject % call the \output just set
+ \ifdim\pagetotal=0pt
% Having called \balancecolumns once, we do not
% want to call it again. Therefore, reset \output to its normal
% definition right away.
\global\output = {\onepageout{\pagecontents\PAGE}}%
- }%
- \eject
- \endgroup % started in \begindoublecolumns
- \restoremarks
- % Leave the double-column material on the current page, no automatic
- % page break.
- \box\balancedcolumns
- %
- % \pagegoal was set to the doubled \vsize above, since we restarted
- % the current page. We're now back to normal single-column
- % typesetting, so reset \pagegoal to the normal \vsize (after the
- % \endgroup where \vsize got restored).
- \pagegoal = \vsize
+ %
+ \endgroup % started in \begindoublecolumns
+ \restoremarks
+ % Leave the double-column material on the current page, no automatic
+ % page break.
+ \box\balancedcolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize.
+ \global\vsize = \txipageheight %
+ \pagegoal = \txipageheight %
+ \else
+ % We had some left-over material. This might happen when \doublecolumnout
+ % is called in \balancecolumns. Try again.
+ \expandafter\enddoublecolumns
+ \fi
}
\newbox\balancedcolumns
\setbox\balancedcolumns=\vbox{shouldnt see this}%
@@ -5637,46 +6045,54 @@ end
% Only called for the last of the double column material. \doublecolumnout
% does the others.
\def\balancecolumns{%
- \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
\dimen@ = \ht0
\advance\dimen@ by \topskip
\advance\dimen@ by-\baselineskip
- \ifdim\dimen@<14\baselineskip
+ \ifdim\dimen@<5\baselineskip
% Don't split a short final column in two.
\setbox2=\vbox{}%
+ \global\setbox\balancedcolumns=\vbox{\pagesofar}%
\else
\divide\dimen@ by 2 % target to split to
\dimen@ii = \dimen@
\splittopskip = \topskip
- % Loop until the second column is no higher than the first
+ % Loop until left column is at least as high as the right column.
{%
\vbadness = 10000
\loop
\global\setbox3 = \copy0
\global\setbox1 = \vsplit3 to \dimen@
- % Remove glue from bottom of first column to
- % make sure it is higher than the second.
- \global\setbox1 = \vbox{\unvbox1\unpenalty\unskip}%
- \ifdim\ht3>\ht1
+ \ifdim\ht1<\ht3
\global\advance\dimen@ by 1pt
\repeat
}%
- \multiply\dimen@ii by 4
- \divide\dimen@ii by 5
- \ifdim\ht3<\dimen@ii
- % Column heights are too different, so don't make their bottoms
- % flush with each other. The glue at the end of the second column
- % allows a second column to stretch, reducing the difference in
- % height between the two.
- \setbox0=\vbox to\dimen@{\unvbox1\vfill}%
- \setbox2=\vbox to\dimen@{\unvbox3\vskip 0pt plus 0.3\ht0}%
+ % Now the left column is in box 1, and the right column in box 3.
+ %
+ % Check whether the left column has come out higher than the page itself.
+ % (Note that we have doubled \vsize for the double columns, so
+ % the actual height of the page is 0.5\vsize).
+ \ifdim2\ht1>\vsize
+ % It appears that we have been called upon to balance too much material.
+ % Output some of it with \doublecolumnout, leaving the rest on the page.
+ \setbox\PAGE=\box0
+ \doublecolumnout
\else
- \setbox0=\vbox to\dimen@{\unvbox1}%
- \setbox2=\vbox to\dimen@{\unvbox3}%
+ % Compare the heights of the two columns.
+ \ifdim4\ht1>5\ht3
+ % Column heights are too different, so don't make their bottoms
+ % flush with each other.
+ \setbox2=\vbox to \ht1 {\unvbox3\vfill}%
+ \setbox0=\vbox to \ht1 {\unvbox1\vfill}%
+ \else
+ % Make column bottoms flush with each other.
+ \setbox2=\vbox to\ht1{\unvbox3\unskip}%
+ \setbox0=\vbox to\ht1{\unvbox1\unskip}%
+ \fi
+ \global\setbox\balancedcolumns=\vbox{\pagesofar}%
\fi
\fi
%
- \global\setbox\balancedcolumns=\vbox{\pagesofar}%
}
\catcode`\@ = \other
@@ -5691,7 +6107,7 @@ end
\null
\vskip.3\vsize % move it down on the page a bit
\begingroup
- \noindent \titlefonts\rmisbold #1\par % the text
+ \noindent \titlefonts\rm #1\par % the text
\let\lastnode=\empty % no node to associate with
\writetocentry{part}{#1}{}% but put it in the toc
\headingsoff % no headline or footline on the part page
@@ -6085,7 +6501,7 @@ end
\fi
}
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
@@ -6177,7 +6593,7 @@ end
\domark
%
{%
- \chapfonts \rmisbold
+ \chapfonts \rm
\let\footnote=\errfootnoteheading % give better error message
%
% Have to define \lastsection before calling \donoderef, because the
@@ -6231,30 +6647,6 @@ end
}
-% I don't think this chapter style is supported any more, so I'm not
-% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
-%
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
-%
-\def\unnchfopen #1{%
- \chapoddpage
- \vbox{\chapfonts \raggedtitlesettings #1\par}%
- \nobreak\bigskip\nobreak
-}
-\def\chfopen #1#2{\chapoddpage {\chapfonts
-\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
-\par\penalty 5000 %
-}
-\def\centerchfopen #1{%
- \chapoddpage
- \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
- \nobreak\bigskip \nobreak
-}
-\def\CHAPFopen{%
- \global\let\chapmacro=\chfopen
- \global\let\centerchapmacro=\centerchfopen}
-
-
% Section titles. These macros combine the section number parts and
% call the generic \sectionheading to do the printing.
%
@@ -6293,7 +6685,7 @@ end
\let\footnote=\errfootnoteheading
%
% Switch to the right set of fonts.
- \csname #2fonts\endcsname \rmisbold
+ \csname #2fonts\endcsname \rm
%
% Insert first mark before the heading break (see notes for \domark).
\let\prevsectiondefs=\lastsectiondefs
@@ -6457,7 +6849,14 @@ end
% 1 and 2 (the page numbers aren't printed), and so are the first
% two pages of the document. Thus, we'd have two destinations named
% `1', and two named `2'.
- \ifpdf \global\pdfmakepagedesttrue \fi
+ \ifpdf
+ \global\pdfmakepagedesttrue
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ \global\pdfmakepagedesttrue
+ \fi
+ \fi
}
@@ -6600,7 +6999,15 @@ end
% exist, with an empty box. Let's hope all the numbers have the same width.
% Also ignore the page number, which is conventionally not printed.
\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
-\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+\def\partentry#1#2#3#4{%
+ % Add stretch and a bonus for breaking the page before the part heading.
+ % This reduces the chance of the page being broken immediately after the
+ % part heading, before a following chapter heading.
+ \vskip 0pt plus 5\baselineskip
+ \penalty-300
+ \vskip 0pt plus -5\baselineskip
+ \dochapentry{\numeralbox\labelspace#1}{}%
+}
%
% Parts, in the short toc.
\def\shortpartentry#1#2#3#4{%
@@ -6717,7 +7124,6 @@ end
\catcode `\>=\other
\catcode `\`=\other
\catcode `\'=\other
- \escapechar=`\\
%
% ' is active in math mode (mathcode"8000). So reset it, and all our
% other math active characters (just in case), to plain's definitions.
@@ -7560,7 +7966,7 @@ end
\fi % no return type
#3% output function name
}%
- {\rm\enskip}% hskip 0.5 em of \tenrm
+ {\rm\enskip}% hskip 0.5 em of \rmfont
%
\boldbrax
% arguments will be output next, if any.
@@ -7689,43 +8095,41 @@ end
}
\fi
-\let\aftermacroxxx\relax
-\def\aftermacro{\aftermacroxxx}
-
% alias because \c means cedilla in @tex or @math
\let\texinfoc=\c
+\newcount\savedcatcodeone
+\newcount\savedcatcodetwo
+
% Used at the time of macro expansion.
% Argument is macro body with arguments substituted
\def\scanmacro#1{%
\newlinechar`\^^M
- \def\xprocessmacroarg{\eatspaces}%
+ \def\xeatspaces{\eatspaces}%
+ %
+ % Temporarily undo catcode changes of \printindex. Set catcode of @ to
+ % 0 so that @-commands in macro expansions aren't printed literally when
+ % formatting an index file, where \ is used as the escape character.
+ \savedcatcodeone=\catcode`\@
+ \savedcatcodetwo=\catcode`\\
+ \catcode`\@=0
+ \catcode`\\=\active
%
% Process the macro body under the current catcode regime.
- \scantokens{#1\texinfoc}\aftermacro%
+ \scantokens{#1@texinfoc}%
+ %
+ \catcode`\@=\savedcatcodeone
+ \catcode`\\=\savedcatcodetwo
%
- % The \c is to remove the \newlinechar added by \scantokens, and
+ % The \texinfoc is to remove the \newlinechar added by \scantokens, and
% can be noticed by \parsearg.
- % The \aftermacro allows a \comment at the end of the macro definition
- % to duplicate itself past the final \newlinechar added by \scantokens:
- % this is used in the definition of \group to comment out a newline. We
- % don't do the same for \c to support Texinfo files with macros that ended
- % with a @c, which should no longer be necessary.
% We avoid surrounding the call to \scantokens with \bgroup and \egroup
% to allow macros to open or close groups themselves.
}
% Used for copying and captions
\def\scanexp#1{%
- \bgroup
- % Undo catcode changes of \startcontents and \printindex
- % When called from @insertcopying or (short)caption, we need active
- % backslash to get it printed correctly.
- % FIXME: This may not be needed.
- %\catcode`\@=0 \catcode`\\=\active \escapechar=`\@
- \edef\temp{\noexpand\scanmacro{#1}}%
- \temp
- \egroup
+ \expandafter\scanmacro\expandafter{#1}%
}
\newcount\paramno % Count of parameters
@@ -7733,7 +8137,7 @@ end
\newif\ifrecursive % Is it recursive?
% List of all defined macros in the form
-% \definedummyword\macro1\definedummyword\macro2...
+% \commondummyword\macro1\commondummyword\macro2...
% Currently is also contains all @aliases; the list can be split
% if there is a need.
\def\macrolist{}
@@ -7741,7 +8145,7 @@ end
% Add the macro to \macrolist
\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
\def\addtomacrolistxxx#1{%
- \toks0 = \expandafter{\macrolist\definedummyword#1}%
+ \toks0 = \expandafter{\macrolist\commondummyword#1}%
\xdef\macrolist{\the\toks0}%
}
@@ -7795,7 +8199,7 @@ end
\catcode`\_=\other
\catcode`\|=\other
\catcode`\~=\other
- \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
+ \passthroughcharstrue
}
\def\scanargctxt{% used for copying and captions, not macros.
@@ -7882,7 +8286,7 @@ end
% Remove the macro name from \macrolist:
\begingroup
\expandafter\let\csname#1\endcsname \relax
- \let\definedummyword\unmacrodo
+ \let\commondummyword\unmacrodo
\xdef\macrolist{\macrolist}%
\endgroup
\else
@@ -7897,7 +8301,7 @@ end
\ifx #1\relax
% remove this
\else
- \noexpand\definedummyword \noexpand#1%
+ \noexpand\commondummyword \noexpand#1%
\fi
}
@@ -7929,7 +8333,7 @@ end
\paramno=0\def\paramlist{}%
\let\hash\relax
% \hash is redefined to `#' later to get it into definitions
- \let\processmacroarg\relax
+ \let\xeatspaces\relax
\parsemargdefxxx#1,;,%
\ifnum\paramno<10\relax\else
\paramno0\relax
@@ -7941,7 +8345,7 @@ end
\else \let\next=\parsemargdefxxx
\advance\paramno by 1
\expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
- {\processmacroarg{\hash\the\paramno}}%
+ {\xeatspaces{\hash\the\paramno}}%
\edef\paramlist{\paramlist\hash\the\paramno,}%
\fi\next}
@@ -8167,128 +8571,75 @@ end
%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
-
-% Remove following spaces at the expansion stage.
-% This works because spaces are discarded before each argument when TeX is
-% getting the arguments for a macro.
-% This must not be immediately followed by a }.
-\long\def\gobblespaces#1{#1}
-
% This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
% \macrobody has the body of the macro in it, with placeholders for
-% its parameters, looking like "\processmacroarg{\hash 1}".
+% its parameters, looking like "\xeatspaces{\hash 1}".
% \paramno is the number of parameters
% \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
-% There are eight cases: recursive and nonrecursive macros of zero, one,
-% up to nine, and many arguments.
+% There are four cases: macros of zero, one, up to nine, and many arguments.
% \xdef is used so that macro definitions will survive the file
% they're defined in: @include reads the file inside a group.
%
\def\defmacro{%
\let\hash=##% convert placeholders to macro parameter chars
\ifnum\paramno=1
- \def\processmacroarg{\gobblespaces}%
+ \def\xeatspaces##1{##1}%
% This removes the pair of braces around the argument. We don't
% use \eatspaces, because this can cause ends of lines to be lost
% when the argument to \eatspaces is read, leading to line-based
% commands like "@itemize" not being read correctly.
\else
- \def\processmacroarg{\xprocessmacroarg}%
- \let\xprocessmacroarg\relax
+ \let\xeatspaces\relax % suppress expansion
\fi
- \ifrecursive %%%%%%%%%%%%%% Recursive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\scanmacro{\macrobody}}%
- \or % 1
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup
+ \noexpand\spaceisspace
+ \noexpand\endlineisspace
+ \noexpand\expandafter % skip any whitespace after the macro name.
+ \expandafter\noexpand\csname\the\macname @@@\endcsname}%
+ \expandafter\xdef\csname\the\macname @@@\endcsname{%
+ \egroup
+ \noexpand\scanmacro{\macrobody}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname @@@\endcsname}%
+ \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
+ \egroup
+ \noexpand\scanmacro{\macrobody}%
+ }%
+ \else % at most 9
+ \ifnum\paramno<10\relax
+ % @MACNAME sets the context for reading the macro argument
+ % @MACNAME@@ gets the argument, processes backslashes and appends a
+ % comma.
+ % @MACNAME@@@ removes braces surrounding the argument list.
+ % @MACNAME@@@@ scans the macro body with arguments substituted.
\expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup
- \noexpand\braceorline
- \expandafter\noexpand\csname\the\macname @@@\endcsname}%
+ \bgroup
+ \noexpand\expandafter % This \expandafter skip any spaces after the
+ \noexpand\macroargctxt % macro before we change the catcode of space.
+ \noexpand\expandafter
+ \expandafter\noexpand\csname\the\macname @@\endcsname}%
+ \expandafter\xdef\csname\the\macname @@\endcsname##1{%
+ \noexpand\passargtomacro
+ \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
\expandafter\xdef\csname\the\macname @@@\endcsname##1{%
- \expandafter\noexpand\csname\the\macname @@@@\endcsname{%
- \noexpand\gobblespaces##1\empty}%
- % The \empty is for \gobblespaces in case #1 is empty
- }%
- \expandafter\xdef\csname\the\macname @@@@\endcsname##1{%
- \egroup\noexpand\scanmacro{\macrobody}}%
- \else
- \ifnum\paramno<10\relax % at most 9
- % See non-recursive section below for comments
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup
- \noexpand\expandafter
- \noexpand\macroargctxt
- \noexpand\expandafter
- \expandafter\noexpand\csname\the\macname @@\endcsname}%
- \expandafter\xdef\csname\the\macname @@\endcsname##1{%
- \noexpand\passargtomacro
- \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
- \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
- \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname @@@@\endcsname\paramlist{%
- \egroup\noexpand\scanmacro{\macrobody}}%
- \else % 10 or more
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\getargvals@{\the\macname}{\argl}%
- }%
- \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
- \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
- \fi
- \fi
- \else %%%%%%%%%%%%%%%%%%%%%% Non-recursive %%%%%%%%%%%%%%%%%%%%%%%%%%
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\scanmacro{\macrobody}}%
- \or % 1
+ \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname @@@@\endcsname\paramlist{%
+ \egroup\noexpand\scanmacro{\macrobody}}%
+ \else % 10 or more:
\expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup
- \noexpand\braceorline
- \expandafter\noexpand\csname\the\macname @@@\endcsname}%
- \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
- \expandafter\noexpand\csname\the\macname @@@@\endcsname{%
- \noexpand\gobblespaces##1\empty}%
- % The \empty is for \gobblespaces in case #1 is empty
- }%
- \expandafter\xdef\csname\the\macname @@@@\endcsname##1{%
- \egroup
- \noexpand\scanmacro{\macrobody}%
- }%
- \else % at most 9
- \ifnum\paramno<10\relax
- % @MACNAME sets the context for reading the macro argument
- % @MACNAME@@ gets the argument, processes backslashes and appends a
- % comma.
- % @MACNAME@@@ removes braces surrounding the argument list.
- % @MACNAME@@@@ scans the macro body with arguments substituted.
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup
- \noexpand\expandafter % This \expandafter skip any spaces after the
- \noexpand\macroargctxt % macro before we change the catcode of space.
- \noexpand\expandafter
- \expandafter\noexpand\csname\the\macname @@\endcsname}%
- \expandafter\xdef\csname\the\macname @@\endcsname##1{%
- \noexpand\passargtomacro
- \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
- \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
- \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname @@@@\endcsname\paramlist{%
- \egroup\noexpand\scanmacro{\macrobody}}%
- \else % 10 or more:
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\getargvals@{\the\macname}{\argl}%
- }%
- \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
- \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
- \fi
+ \noexpand\getargvals@{\the\macname}{\argl}%
+ }%
+ \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
+ \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
\fi
\fi}
@@ -8484,6 +8835,8 @@ end
{%
\requireauxfile
\atdummies % preserve commands, but don't expand them
+ % match definition in \xrdef, \refx, \xrefX.
+ \def\value##1{##1}%
\edef\writexrdef##1##2{%
\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
##1}{##2}}% these are parameters of \writexrdef
@@ -8574,9 +8927,10 @@ end
%
% Make link in pdf output.
\ifpdf
+ % For pdfTeX and LuaTeX
{\indexnofonts
- \turnoffactive
\makevalueexpandable
+ \turnoffactive
% This expands tokens, so do it after making catcode changes, so _
% etc. don't get their TeX definitions. This ignores all spaces in
% #4, including (wrongly) those in the middle of the filename.
@@ -8584,28 +8938,67 @@ end
%
% This (wrongly) does not take account of leading or trailing
% spaces in #1, which should be ignored.
- \edef\pdfxrefdest{#1}%
- \ifx\pdfxrefdest\empty
- \def\pdfxrefdest{Top}% no empty targets
- \else
- \txiescapepdf\pdfxrefdest % escape PDF special chars
+ \setpdfdestname{#1}%
+ %
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{Top}% no empty targets
\fi
%
\leavevmode
\startlink attr{/Border [0 0 0]}%
\ifnum\filenamelength>0
- goto file{\the\filename.pdf} name{\pdfxrefdest}%
+ goto file{\the\filename.pdf} name{\pdfdestname}%
\else
- goto name{\pdfmkpgn{\pdfxrefdest}}%
+ goto name{\pdfmkpgn{\pdfdestname}}%
\fi
}%
\setcolor{\linkcolor}%
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ % For XeTeX
+ {\indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ % This expands tokens, so do it after making catcode changes, so _
+ % etc. don't get their TeX definitions. This ignores all spaces in
+ % #4, including (wrongly) those in the middle of the filename.
+ \getfilename{#4}%
+ %
+ % This (wrongly) does not take account of leading or trailing
+ % spaces in #1, which should be ignored.
+ \setpdfdestname{#1}%
+ %
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{Top}% no empty targets
+ \fi
+ %
+ \leavevmode
+ \ifnum\filenamelength>0
+ % With default settings,
+ % XeTeX (xdvipdfmx) replaces link destination names with integers.
+ % In this case, the replaced destination names of
+ % remote PDFs are no longer known. In order to avoid a replacement,
+ % you can use xdvipdfmx's command line option `-C 0x0010'.
+ % If you use XeTeX 0.99996+ (TeX Live 2016+),
+ % this command line option is no longer necessary
+ % because we can use the `dvipdfmx:config' special.
+ \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
+ << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
+ \else
+ \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
+ << /S /GoTo /D (\pdfdestname) >> >>}%
+ \fi
+ }%
+ \setcolor{\linkcolor}%
+ \fi
\fi
{%
% Have to otherify everything special to allow the \csname to
% include an _ in the xref name, etc.
\indexnofonts
\turnoffactive
+ \def\value##1{##1}%
\expandafter\global\expandafter\let\expandafter\Xthisreftitle
\csname XR#1-title\endcsname
}%
@@ -8746,14 +9139,14 @@ end
\fi\fi\fi
}
-% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
-% If its value is nonempty, SUFFIX is output afterward.
-%
+% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX
+% is output afterwards if non-empty.
\def\refx#1#2{%
\requireauxfile
{%
\indexnofonts
\otherbackslash
+ \def\value##1{##1}%
\expandafter\global\expandafter\let\expandafter\thisrefX
\csname XR#1\endcsname
}%
@@ -8778,20 +9171,28 @@ end
#2% Output the suffix in any case.
}
-% This is the macro invoked by entries in the aux file. Usually it's
-% just a \def (we prepend XR to the control sequence name to avoid
-% collisions). But if this is a float type, we have more work to do.
+% This is the macro invoked by entries in the aux file. Define a control
+% sequence for a cross-reference target (we prepend XR to the control sequence
+% name to avoid collisions). The value is the page number. If this is a float
+% type, we have more work to do.
%
\def\xrdef#1#2{%
- {% The node name might contain 8-bit characters, which in our current
- % implementation are changed to commands like @'e. Don't let these
- % mess up the control sequence name.
+ {% Expand the node or anchor name to remove control sequences.
+ % \turnoffactive stops 8-bit characters being changed to commands
+ % like @'e. \refx does the same to retrieve the value in the definition.
\indexnofonts
\turnoffactive
+ \def\value##1{##1}%
\xdef\safexrefname{#1}%
}%
%
- \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
+ \bgroup
+ \expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
+ \egroup
+ % We put the \gdef inside a group to avoid the definitions building up on
+ % TeX's save stack, which can cause it to run out of space for aux files with
+ % thousands of lines. \gdef doesn't use the save stack, but \csname does
+ % when it defines an unknown control sequence as \relax.
%
% Was that xref control sequence that we just defined for a float?
\expandafter\iffloat\csname XR\safexrefname\endcsname
@@ -8909,9 +9310,6 @@ end
% now. --karl, 15jan04.
\catcode`\\=\other
%
- % Make the characters 128-255 be printing characters.
- {\setnonasciicharscatcodenonglobal\other}%
- %
% @ is our escape character in .aux files, and we need braces.
\catcode`\{=1
\catcode`\}=2
@@ -8975,7 +9373,7 @@ end
% We want to typeset this text as a normal paragraph, even if the
% footnote reference occurs in (for example) a display environment.
% So reset some parameters.
- \hsize=\pagewidth
+ \hsize=\txipagewidth
\interlinepenalty\interfootnotelinepenalty
\splittopskip\ht\strutbox % top baseline for broken footnotes
\splitmaxdepth\dp\strutbox
@@ -9100,7 +9498,7 @@ end
\newif\ifwarnednoepsf
\newhelp\noepsfhelp{epsf.tex must be installed for images to
work. It is also included in the Texinfo distribution, or you can get
- it from ftp://tug.org/tex/epsf.tex.}
+ it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
%
\def\image#1{%
\ifx\epsfbox\thisisundefined
@@ -9290,7 +9688,7 @@ end
%
\ifx\thiscaption\empty \else
\ifx\floatident\empty \else
- \appendtomacro\captionline{: }% had ident, so need a colon between
+ \appendtomacro\captionline{: }% had ident, so need a colon between
\fi
%
% caption text.
@@ -9317,30 +9715,17 @@ end
\requireauxfile
\atdummies
%
- % since we read the caption text in the macro world, where ^^M
- % is turned into a normal character, we have to scan it back, so
- % we don't write the literal three characters "^^M" into the aux file.
- \scanexp{%
- \xdef\noexpand\gtemp{%
- \ifx\thisshortcaption\empty
- \thiscaption
- \else
- \thisshortcaption
- \fi
- }%
- }%
+ \ifx\thisshortcaption\empty
+ \def\gtemp{\thiscaption}%
+ \else
+ \def\gtemp{\thisshortcaption}%
+ \fi
\immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
- \ifx\gtemp\empty \else : \gtemp \fi}}%
+ \ifx\gtemp\empty \else : \gtemp \fi}}%
}%
\fi
\egroup % end of \vtop
%
- % place the captured inserts
- %
- % BEWARE: when the floats start floating, we have to issue warning
- % whenever an insert appears inside a float which could possibly
- % float. --kasal, 26may04
- %
\checkinserts
}
@@ -9515,43 +9900,68 @@ directory should work if nowhere else does.}
\global\righthyphenmin = #3\relax
}
-% Get input by bytes instead of by UTF-8 codepoints for XeTeX and LuaTeX,
-% otherwise the encoding support is completely broken.
+% XeTeX and LuaTeX can handle Unicode natively.
+% Their default I/O uses UTF-8 sequences instead of a byte-wise operation.
+% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
+%
+\newif\iftxinativeunicodecapable
+\newif\iftxiusebytewiseio
+
\ifx\XeTeXrevision\thisisundefined
+ \ifx\luatexversion\thisisundefined
+ \txinativeunicodecapablefalse
+ \txiusebytewiseiotrue
+ \else
+ \txinativeunicodecapabletrue
+ \txiusebytewiseiofalse
+ \fi
\else
-\XeTeXdefaultencoding "bytes" % For subsequent files to be read
-\XeTeXinputencoding "bytes" % Effective in texinfo.tex only
-% Unfortunately, there seems to be no corresponding XeTeX command for
-% output encoding. This is a problem for auxiliary index and TOC files.
-% The only solution would be perhaps to write out @U{...} sequences in
-% place of UTF-8 characters.
+ \txinativeunicodecapabletrue
+ \txiusebytewiseiofalse
\fi
-\ifx\luatexversion\thisisundefined
-\else
-\directlua{
-local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
-local function convert_char (char)
- return utf8_char(byte(char))
-end
-
-local function convert_line (line)
- return gsub(line, ".", convert_char)
-end
-
-callback.register("process_input_buffer", convert_line)
+% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
+% for non-UTF-8 (byte-wise) encodings.
+%
+\def\setbytewiseio{%
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ \XeTeXdefaultencoding "bytes" % For subsequent files to be read
+ \XeTeXinputencoding "bytes" % For document root file
+ % Unfortunately, there seems to be no corresponding XeTeX command for
+ % output encoding. This is a problem for auxiliary index and TOC files.
+ % The only solution would be perhaps to write out @U{...} sequences in
+ % place of non-ASCII characters.
+ \fi
-local function convert_line_out (line)
- local line_out = ""
- for c in string.utfvalues(line) do
- line_out = line_out .. string.char(c)
- end
- return line_out
-end
+ \ifx\luatexversion\thisisundefined
+ \else
+ \directlua{
+ local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
+ local function convert_char (char)
+ return utf8_char(byte(char))
+ end
+
+ local function convert_line (line)
+ return gsub(line, ".", convert_char)
+ end
+
+ callback.register("process_input_buffer", convert_line)
+
+ local function convert_line_out (line)
+ local line_out = ""
+ for c in string.utfvalues(line) do
+ line_out = line_out .. string.char(c)
+ end
+ return line_out
+ end
+
+ callback.register("process_output_buffer", convert_line_out)
+ }
+ \fi
-callback.register("process_output_buffer", convert_line_out)
+ \txiusebytewiseiotrue
}
-\fi
% Helpers for encodings.
@@ -9578,13 +9988,6 @@ callback.register("process_output_buffer", convert_line_out)
%
\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
\def\documentencodingzzz#1{%
- % Get input by bytes instead of by UTF-8 codepoints for XeTeX,
- % otherwise the encoding support is completely broken.
- % This settings is for the document root file.
- \ifx\XeTeXrevision\thisisundefined
- \else
- \XeTeXinputencoding "bytes"
- \fi
%
% Encoding being declared for the document.
\def\declaredencoding{\csname #1.enc\endcsname}%
@@ -9601,22 +10004,38 @@ callback.register("process_output_buffer", convert_line_out)
\asciichardefs
%
\else \ifx \declaredencoding \lattwo
+ \iftxinativeunicodecapable
+ \setbytewiseio
+ \fi
\setnonasciicharscatcode\active
\lattwochardefs
%
\else \ifx \declaredencoding \latone
+ \iftxinativeunicodecapable
+ \setbytewiseio
+ \fi
\setnonasciicharscatcode\active
\latonechardefs
%
\else \ifx \declaredencoding \latnine
+ \iftxinativeunicodecapable
+ \setbytewiseio
+ \fi
\setnonasciicharscatcode\active
\latninechardefs
%
\else \ifx \declaredencoding \utfeight
- \setnonasciicharscatcode\active
- % since we already invoked \utfeightchardefs at the top level
- % (below), do not re-invoke it, then our check for duplicated
- % definitions triggers. Making non-ascii chars active is enough.
+ \iftxinativeunicodecapable
+ % For native Unicode handling (XeTeX and LuaTeX)
+ \nativeunicodechardefs
+ \else
+ % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX)
+ \setnonasciicharscatcode\active
+ % since we already invoked \utfeightchardefs at the top level
+ % (below), do not re-invoke it, otherwise our check for duplicated
+ % definitions gets triggered. Making non-ascii chars active is
+ % sufficient.
+ \fi
%
\else
\message{Ignoring unknown document encoding: #1.}%
@@ -9626,6 +10045,18 @@ callback.register("process_output_buffer", convert_line_out)
\fi % latone
\fi % lattwo
\fi % ascii
+ %
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ \ifx \declaredencoding \utfeight
+ \else
+ \ifx \declaredencoding \ascii
+ \else
+ \message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
+ non-ASCII characters in auxiliary files.}%
+ \fi
+ \fi
+ \fi
}
% emacs-page
@@ -9642,109 +10073,119 @@ callback.register("process_output_buffer", convert_line_out)
% macros containing the character definitions.
\setnonasciicharscatcode\active
%
+
+\def\gdefchar#1#2{%
+\gdef#1{%
+ \ifpassthroughchars
+ \string#1%
+ \else
+ #2%
+ \fi
+}}
+
% Latin1 (ISO-8859-1) character definitions.
\def\latonechardefs{%
- \gdef^^a0{\tie}
- \gdef^^a1{\exclamdown}
- \gdef^^a2{{\tcfont \char162}} % cent
- \gdef^^a3{\pounds}
- \gdef^^a4{{\tcfont \char164}} % currency
- \gdef^^a5{{\tcfont \char165}} % yen
- \gdef^^a6{{\tcfont \char166}} % broken bar
- \gdef^^a7{\S}
- \gdef^^a8{\"{}}
- \gdef^^a9{\copyright}
- \gdef^^aa{\ordf}
- \gdef^^ab{\guillemetleft}
- \gdef^^ac{\ensuremath\lnot}
- \gdef^^ad{\-}
- \gdef^^ae{\registeredsymbol}
- \gdef^^af{\={}}
- %
- \gdef^^b0{\textdegree}
- \gdef^^b1{$\pm$}
- \gdef^^b2{$^2$}
- \gdef^^b3{$^3$}
- \gdef^^b4{\'{}}
- \gdef^^b5{$\mu$}
- \gdef^^b6{\P}
- \gdef^^b7{\ensuremath\cdot}
- \gdef^^b8{\cedilla\ }
- \gdef^^b9{$^1$}
- \gdef^^ba{\ordm}
- \gdef^^bb{\guillemetright}
- \gdef^^bc{$1\over4$}
- \gdef^^bd{$1\over2$}
- \gdef^^be{$3\over4$}
- \gdef^^bf{\questiondown}
- %
- \gdef^^c0{\`A}
- \gdef^^c1{\'A}
- \gdef^^c2{\^A}
- \gdef^^c3{\~A}
- \gdef^^c4{\"A}
- \gdef^^c5{\ringaccent A}
- \gdef^^c6{\AE}
- \gdef^^c7{\cedilla C}
- \gdef^^c8{\`E}
- \gdef^^c9{\'E}
- \gdef^^ca{\^E}
- \gdef^^cb{\"E}
- \gdef^^cc{\`I}
- \gdef^^cd{\'I}
- \gdef^^ce{\^I}
- \gdef^^cf{\"I}
- %
- \gdef^^d0{\DH}
- \gdef^^d1{\~N}
- \gdef^^d2{\`O}
- \gdef^^d3{\'O}
- \gdef^^d4{\^O}
- \gdef^^d5{\~O}
- \gdef^^d6{\"O}
- \gdef^^d7{$\times$}
- \gdef^^d8{\O}
- \gdef^^d9{\`U}
- \gdef^^da{\'U}
- \gdef^^db{\^U}
- \gdef^^dc{\"U}
- \gdef^^dd{\'Y}
- \gdef^^de{\TH}
- \gdef^^df{\ss}
- %
- \gdef^^e0{\`a}
- \gdef^^e1{\'a}
- \gdef^^e2{\^a}
- \gdef^^e3{\~a}
- \gdef^^e4{\"a}
- \gdef^^e5{\ringaccent a}
- \gdef^^e6{\ae}
- \gdef^^e7{\cedilla c}
- \gdef^^e8{\`e}
- \gdef^^e9{\'e}
- \gdef^^ea{\^e}
- \gdef^^eb{\"e}
- \gdef^^ec{\`{\dotless i}}
- \gdef^^ed{\'{\dotless i}}
- \gdef^^ee{\^{\dotless i}}
- \gdef^^ef{\"{\dotless i}}
- %
- \gdef^^f0{\dh}
- \gdef^^f1{\~n}
- \gdef^^f2{\`o}
- \gdef^^f3{\'o}
- \gdef^^f4{\^o}
- \gdef^^f5{\~o}
- \gdef^^f6{\"o}
- \gdef^^f7{$\div$}
- \gdef^^f8{\o}
- \gdef^^f9{\`u}
- \gdef^^fa{\'u}
- \gdef^^fb{\^u}
- \gdef^^fc{\"u}
- \gdef^^fd{\'y}
- \gdef^^fe{\th}
- \gdef^^ff{\"y}
+ \gdefchar^^a0{\tie}
+ \gdefchar^^a1{\exclamdown}
+ \gdefchar^^a2{{\tcfont \char162}} % cent
+ \gdefchar^^a3{\pounds{}}
+ \gdefchar^^a4{{\tcfont \char164}} % currency
+ \gdefchar^^a5{{\tcfont \char165}} % yen
+ \gdefchar^^a6{{\tcfont \char166}} % broken bar
+ \gdefchar^^a7{\S}
+ \gdefchar^^a8{\"{}}
+ \gdefchar^^a9{\copyright{}}
+ \gdefchar^^aa{\ordf}
+ \gdefchar^^ab{\guillemetleft{}}
+ \gdefchar^^ac{\ensuremath\lnot}
+ \gdefchar^^ad{\-}
+ \gdefchar^^ae{\registeredsymbol{}}
+ \gdefchar^^af{\={}}
+ %
+ \gdefchar^^b0{\textdegree}
+ \gdefchar^^b1{$\pm$}
+ \gdefchar^^b2{$^2$}
+ \gdefchar^^b3{$^3$}
+ \gdefchar^^b4{\'{}}
+ \gdefchar^^b5{$\mu$}
+ \gdefchar^^b6{\P}
+ \gdefchar^^b7{\ensuremath\cdot}
+ \gdefchar^^b8{\cedilla\ }
+ \gdefchar^^b9{$^1$}
+ \gdefchar^^ba{\ordm}
+ \gdefchar^^bb{\guillemetright{}}
+ \gdefchar^^bc{$1\over4$}
+ \gdefchar^^bd{$1\over2$}
+ \gdefchar^^be{$3\over4$}
+ \gdefchar^^bf{\questiondown}
+ %
+ \gdefchar^^c0{\`A}
+ \gdefchar^^c1{\'A}
+ \gdefchar^^c2{\^A}
+ \gdefchar^^c3{\~A}
+ \gdefchar^^c4{\"A}
+ \gdefchar^^c5{\ringaccent A}
+ \gdefchar^^c6{\AE}
+ \gdefchar^^c7{\cedilla C}
+ \gdefchar^^c8{\`E}
+ \gdefchar^^c9{\'E}
+ \gdefchar^^ca{\^E}
+ \gdefchar^^cb{\"E}
+ \gdefchar^^cc{\`I}
+ \gdefchar^^cd{\'I}
+ \gdefchar^^ce{\^I}
+ \gdefchar^^cf{\"I}
+ %
+ \gdefchar^^d0{\DH}
+ \gdefchar^^d1{\~N}
+ \gdefchar^^d2{\`O}
+ \gdefchar^^d3{\'O}
+ \gdefchar^^d4{\^O}
+ \gdefchar^^d5{\~O}
+ \gdefchar^^d6{\"O}
+ \gdefchar^^d7{$\times$}
+ \gdefchar^^d8{\O}
+ \gdefchar^^d9{\`U}
+ \gdefchar^^da{\'U}
+ \gdefchar^^db{\^U}
+ \gdefchar^^dc{\"U}
+ \gdefchar^^dd{\'Y}
+ \gdefchar^^de{\TH}
+ \gdefchar^^df{\ss}
+ %
+ \gdefchar^^e0{\`a}
+ \gdefchar^^e1{\'a}
+ \gdefchar^^e2{\^a}
+ \gdefchar^^e3{\~a}
+ \gdefchar^^e4{\"a}
+ \gdefchar^^e5{\ringaccent a}
+ \gdefchar^^e6{\ae}
+ \gdefchar^^e7{\cedilla c}
+ \gdefchar^^e8{\`e}
+ \gdefchar^^e9{\'e}
+ \gdefchar^^ea{\^e}
+ \gdefchar^^eb{\"e}
+ \gdefchar^^ec{\`{\dotless i}}
+ \gdefchar^^ed{\'{\dotless i}}
+ \gdefchar^^ee{\^{\dotless i}}
+ \gdefchar^^ef{\"{\dotless i}}
+ %
+ \gdefchar^^f0{\dh}
+ \gdefchar^^f1{\~n}
+ \gdefchar^^f2{\`o}
+ \gdefchar^^f3{\'o}
+ \gdefchar^^f4{\^o}
+ \gdefchar^^f5{\~o}
+ \gdefchar^^f6{\"o}
+ \gdefchar^^f7{$\div$}
+ \gdefchar^^f8{\o}
+ \gdefchar^^f9{\`u}
+ \gdefchar^^fa{\'u}
+ \gdefchar^^fb{\^u}
+ \gdefchar^^fc{\"u}
+ \gdefchar^^fd{\'y}
+ \gdefchar^^fe{\th}
+ \gdefchar^^ff{\"y}
}
% Latin9 (ISO-8859-15) encoding character definitions.
@@ -9752,119 +10193,119 @@ callback.register("process_output_buffer", convert_line_out)
% Encoding is almost identical to Latin1.
\latonechardefs
%
- \gdef^^a4{\euro}
- \gdef^^a6{\v S}
- \gdef^^a8{\v s}
- \gdef^^b4{\v Z}
- \gdef^^b8{\v z}
- \gdef^^bc{\OE}
- \gdef^^bd{\oe}
- \gdef^^be{\"Y}
+ \gdefchar^^a4{\euro{}}
+ \gdefchar^^a6{\v S}
+ \gdefchar^^a8{\v s}
+ \gdefchar^^b4{\v Z}
+ \gdefchar^^b8{\v z}
+ \gdefchar^^bc{\OE}
+ \gdefchar^^bd{\oe}
+ \gdefchar^^be{\"Y}
}
% Latin2 (ISO-8859-2) character definitions.
\def\lattwochardefs{%
- \gdef^^a0{\tie}
- \gdef^^a1{\ogonek{A}}
- \gdef^^a2{\u{}}
- \gdef^^a3{\L}
- \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
- \gdef^^a5{\v L}
- \gdef^^a6{\'S}
- \gdef^^a7{\S}
- \gdef^^a8{\"{}}
- \gdef^^a9{\v S}
- \gdef^^aa{\cedilla S}
- \gdef^^ab{\v T}
- \gdef^^ac{\'Z}
- \gdef^^ad{\-}
- \gdef^^ae{\v Z}
- \gdef^^af{\dotaccent Z}
- %
- \gdef^^b0{\textdegree}
- \gdef^^b1{\ogonek{a}}
- \gdef^^b2{\ogonek{ }}
- \gdef^^b3{\l}
- \gdef^^b4{\'{}}
- \gdef^^b5{\v l}
- \gdef^^b6{\'s}
- \gdef^^b7{\v{}}
- \gdef^^b8{\cedilla\ }
- \gdef^^b9{\v s}
- \gdef^^ba{\cedilla s}
- \gdef^^bb{\v t}
- \gdef^^bc{\'z}
- \gdef^^bd{\H{}}
- \gdef^^be{\v z}
- \gdef^^bf{\dotaccent z}
- %
- \gdef^^c0{\'R}
- \gdef^^c1{\'A}
- \gdef^^c2{\^A}
- \gdef^^c3{\u A}
- \gdef^^c4{\"A}
- \gdef^^c5{\'L}
- \gdef^^c6{\'C}
- \gdef^^c7{\cedilla C}
- \gdef^^c8{\v C}
- \gdef^^c9{\'E}
- \gdef^^ca{\ogonek{E}}
- \gdef^^cb{\"E}
- \gdef^^cc{\v E}
- \gdef^^cd{\'I}
- \gdef^^ce{\^I}
- \gdef^^cf{\v D}
- %
- \gdef^^d0{\DH}
- \gdef^^d1{\'N}
- \gdef^^d2{\v N}
- \gdef^^d3{\'O}
- \gdef^^d4{\^O}
- \gdef^^d5{\H O}
- \gdef^^d6{\"O}
- \gdef^^d7{$\times$}
- \gdef^^d8{\v R}
- \gdef^^d9{\ringaccent U}
- \gdef^^da{\'U}
- \gdef^^db{\H U}
- \gdef^^dc{\"U}
- \gdef^^dd{\'Y}
- \gdef^^de{\cedilla T}
- \gdef^^df{\ss}
- %
- \gdef^^e0{\'r}
- \gdef^^e1{\'a}
- \gdef^^e2{\^a}
- \gdef^^e3{\u a}
- \gdef^^e4{\"a}
- \gdef^^e5{\'l}
- \gdef^^e6{\'c}
- \gdef^^e7{\cedilla c}
- \gdef^^e8{\v c}
- \gdef^^e9{\'e}
- \gdef^^ea{\ogonek{e}}
- \gdef^^eb{\"e}
- \gdef^^ec{\v e}
- \gdef^^ed{\'{\dotless{i}}}
- \gdef^^ee{\^{\dotless{i}}}
- \gdef^^ef{\v d}
- %
- \gdef^^f0{\dh}
- \gdef^^f1{\'n}
- \gdef^^f2{\v n}
- \gdef^^f3{\'o}
- \gdef^^f4{\^o}
- \gdef^^f5{\H o}
- \gdef^^f6{\"o}
- \gdef^^f7{$\div$}
- \gdef^^f8{\v r}
- \gdef^^f9{\ringaccent u}
- \gdef^^fa{\'u}
- \gdef^^fb{\H u}
- \gdef^^fc{\"u}
- \gdef^^fd{\'y}
- \gdef^^fe{\cedilla t}
- \gdef^^ff{\dotaccent{}}
+ \gdefchar^^a0{\tie}
+ \gdefchar^^a1{\ogonek{A}}
+ \gdefchar^^a2{\u{}}
+ \gdefchar^^a3{\L}
+ \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdefchar^^a5{\v L}
+ \gdefchar^^a6{\'S}
+ \gdefchar^^a7{\S}
+ \gdefchar^^a8{\"{}}
+ \gdefchar^^a9{\v S}
+ \gdefchar^^aa{\cedilla S}
+ \gdefchar^^ab{\v T}
+ \gdefchar^^ac{\'Z}
+ \gdefchar^^ad{\-}
+ \gdefchar^^ae{\v Z}
+ \gdefchar^^af{\dotaccent Z}
+ %
+ \gdefchar^^b0{\textdegree{}}
+ \gdefchar^^b1{\ogonek{a}}
+ \gdefchar^^b2{\ogonek{ }}
+ \gdefchar^^b3{\l}
+ \gdefchar^^b4{\'{}}
+ \gdefchar^^b5{\v l}
+ \gdefchar^^b6{\'s}
+ \gdefchar^^b7{\v{}}
+ \gdefchar^^b8{\cedilla\ }
+ \gdefchar^^b9{\v s}
+ \gdefchar^^ba{\cedilla s}
+ \gdefchar^^bb{\v t}
+ \gdefchar^^bc{\'z}
+ \gdefchar^^bd{\H{}}
+ \gdefchar^^be{\v z}
+ \gdefchar^^bf{\dotaccent z}
+ %
+ \gdefchar^^c0{\'R}
+ \gdefchar^^c1{\'A}
+ \gdefchar^^c2{\^A}
+ \gdefchar^^c3{\u A}
+ \gdefchar^^c4{\"A}
+ \gdefchar^^c5{\'L}
+ \gdefchar^^c6{\'C}
+ \gdefchar^^c7{\cedilla C}
+ \gdefchar^^c8{\v C}
+ \gdefchar^^c9{\'E}
+ \gdefchar^^ca{\ogonek{E}}
+ \gdefchar^^cb{\"E}
+ \gdefchar^^cc{\v E}
+ \gdefchar^^cd{\'I}
+ \gdefchar^^ce{\^I}
+ \gdefchar^^cf{\v D}
+ %
+ \gdefchar^^d0{\DH}
+ \gdefchar^^d1{\'N}
+ \gdefchar^^d2{\v N}
+ \gdefchar^^d3{\'O}
+ \gdefchar^^d4{\^O}
+ \gdefchar^^d5{\H O}
+ \gdefchar^^d6{\"O}
+ \gdefchar^^d7{$\times$}
+ \gdefchar^^d8{\v R}
+ \gdefchar^^d9{\ringaccent U}
+ \gdefchar^^da{\'U}
+ \gdefchar^^db{\H U}
+ \gdefchar^^dc{\"U}
+ \gdefchar^^dd{\'Y}
+ \gdefchar^^de{\cedilla T}
+ \gdefchar^^df{\ss}
+ %
+ \gdefchar^^e0{\'r}
+ \gdefchar^^e1{\'a}
+ \gdefchar^^e2{\^a}
+ \gdefchar^^e3{\u a}
+ \gdefchar^^e4{\"a}
+ \gdefchar^^e5{\'l}
+ \gdefchar^^e6{\'c}
+ \gdefchar^^e7{\cedilla c}
+ \gdefchar^^e8{\v c}
+ \gdefchar^^e9{\'e}
+ \gdefchar^^ea{\ogonek{e}}
+ \gdefchar^^eb{\"e}
+ \gdefchar^^ec{\v e}
+ \gdefchar^^ed{\'{\dotless{i}}}
+ \gdefchar^^ee{\^{\dotless{i}}}
+ \gdefchar^^ef{\v d}
+ %
+ \gdefchar^^f0{\dh}
+ \gdefchar^^f1{\'n}
+ \gdefchar^^f2{\v n}
+ \gdefchar^^f3{\'o}
+ \gdefchar^^f4{\^o}
+ \gdefchar^^f5{\H o}
+ \gdefchar^^f6{\"o}
+ \gdefchar^^f7{$\div$}
+ \gdefchar^^f8{\v r}
+ \gdefchar^^f9{\ringaccent u}
+ \gdefchar^^fa{\'u}
+ \gdefchar^^fb{\H u}
+ \gdefchar^^fc{\"u}
+ \gdefchar^^fd{\'y}
+ \gdefchar^^fe{\cedilla t}
+ \gdefchar^^ff{\dotaccent{}}
}
% UTF-8 character definitions.
@@ -9894,35 +10335,56 @@ callback.register("process_output_buffer", convert_line_out)
\fi
}
+% Give non-ASCII bytes the active definitions for processing UTF-8 sequences
\begingroup
\catcode`\~13
+ \catcode`\$12
\catcode`\"12
+ % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
+ % substituting ~ and $ with a character token of that value.
\def\UTFviiiLoop{%
\global\catcode\countUTFx\active
\uccode`\~\countUTFx
+ \uccode`\$\countUTFx
\uppercase\expandafter{\UTFviiiTmp}%
\advance\countUTFx by 1
\ifnum\countUTFx < \countUTFy
\expandafter\UTFviiiLoop
\fi}
+ % For bytes other than the first in a UTF-8 sequence. Not expected to
+ % be expanded except when writing to auxiliary files.
+ \countUTFx = "80
+ \countUTFy = "C2
+ \def\UTFviiiTmp{%
+ \gdef~{%
+ \ifpassthroughchars $\fi}}%
+ \UTFviiiLoop
+
\countUTFx = "C2
\countUTFy = "E0
\def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
+ \gdef~{%
+ \ifpassthroughchars $%
+ \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
\UTFviiiLoop
\countUTFx = "E0
\countUTFy = "F0
\def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
+ \gdef~{%
+ \ifpassthroughchars $%
+ \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
\UTFviiiLoop
\countUTFx = "F0
\countUTFy = "F4
\def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiFourOctets\string~}}
+ \gdef~{%
+ \ifpassthroughchars $%
+ \else\expandafter\UTFviiiFourOctets\expandafter$\fi
+ }}%
\UTFviiiLoop
\endgroup
@@ -9931,13 +10393,36 @@ callback.register("process_output_buffer", convert_line_out)
% @U{xxxx} to produce U+xxxx, if we support it.
\def\U#1{%
\expandafter\ifx\csname uni:#1\endcsname \relax
- \errhelp = \EMsimple
- \errmessage{Unicode character U+#1 not supported, sorry}%
+ \iftxinativeunicodecapable
+ % All Unicode characters can be used if native Unicode handling is
+ % active. However, if the font does not have the glyph,
+ % letters are missing.
+ \begingroup
+ \uccode`\.="#1\relax
+ \uppercase{.}
+ \endgroup
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unicode character U+#1 not supported, sorry}%
+ \fi
\else
\csname uni:#1\endcsname
\fi
}
+% These macros are used here to construct the name of a control
+% sequence to be defined.
+\def\UTFviiiTwoOctetsName#1#2{%
+ \csname u8:#1\string #2\endcsname}%
+\def\UTFviiiThreeOctetsName#1#2#3{%
+ \csname u8:#1\string #2\string #3\endcsname}%
+\def\UTFviiiFourOctetsName#1#2#3#4{%
+ \csname u8:#1\string #2\string #3\string #4\endcsname}%
+
+% For UTF-8 byte sequences (TeX, e-TeX and pdfTeX),
+% provide a definition macro to replace a Unicode character;
+% this gets used by the @U command
+%
\begingroup
\catcode`\"=12
\catcode`\<=12
@@ -9946,20 +10431,22 @@ callback.register("process_output_buffer", convert_line_out)
\catcode`\;=12
\catcode`\!=12
\catcode`\~=13
- \gdef\DeclareUnicodeCharacter#1#2{%
+ \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
\countUTFz = "#1\relax
- %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
\begingroup
\parseXMLCharref
- \def\UTFviiiTwoOctets##1##2{%
- \csname u8:##1\string ##2\endcsname}%
- \def\UTFviiiThreeOctets##1##2##3{%
- \csname u8:##1\string ##2\string ##3\endcsname}%
- \def\UTFviiiFourOctets##1##2##3##4{%
- \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
- \expandafter\expandafter\expandafter\expandafter
- \expandafter\expandafter\expandafter
- \gdef\UTFviiiTmp{#2}%
+
+ % Give \u8:... its definition. The sequence of seven \expandafter's
+ % expands after the \gdef three times, e.g.
+ %
+ % 1. \UTFviiTwoOctetsName B1 B2
+ % 2. \csname u8:B1 \string B2 \endcsname
+ % 3. \u8: B1 B2 (a single control sequence token)
+ %
+ \expandafter\expandafter
+ \expandafter\expandafter
+ \expandafter\expandafter
+ \expandafter\gdef \UTFviiiTmp{#2}%
%
\expandafter\ifx\csname uni:#1\endcsname \relax \else
\message{Internal error, already defined: #1}%
@@ -9968,42 +10455,67 @@ callback.register("process_output_buffer", convert_line_out)
% define an additional control sequence for this code point.
\expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
\endgroup}
-
+ %
+ % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp
+ % to the corresponding UTF-8 sequence.
\gdef\parseXMLCharref{%
\ifnum\countUTFz < "A0\relax
\errhelp = \EMsimple
\errmessage{Cannot define Unicode char value < 00A0}%
\else\ifnum\countUTFz < "800\relax
\parseUTFviiiA,%
- \parseUTFviiiB C\UTFviiiTwoOctets.,%
+ \parseUTFviiiB C\UTFviiiTwoOctetsName.,%
\else\ifnum\countUTFz < "10000\relax
\parseUTFviiiA;%
\parseUTFviiiA,%
- \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
+ \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
\else
\parseUTFviiiA;%
\parseUTFviiiA,%
\parseUTFviiiA!%
- \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
+ \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
\fi\fi\fi
}
+ % Extract a byte from the end of the UTF-8 representation of \countUTFx.
+ % It must be a non-initial byte in the sequence.
+ % Change \uccode of #1 for it to be used in \parseUTFviiiB as one
+ % of the bytes.
\gdef\parseUTFviiiA#1{%
\countUTFx = \countUTFz
\divide\countUTFz by 64
- \countUTFy = \countUTFz
+ \countUTFy = \countUTFz % Save to be the future value of \countUTFz.
\multiply\countUTFz by 64
+
+ % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
+ % in order to get the last five bits.
\advance\countUTFx by -\countUTFz
+
+ % Convert this to the byte in the UTF-8 sequence.
\advance\countUTFx by 128
\uccode `#1\countUTFx
\countUTFz = \countUTFy}
+ % Used to put a UTF-8 byte sequence into \UTFviiiTmp
+ % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8
+ % sequence.
+ % #2 is one of the \UTFviii*OctetsName macros.
+ % #3 is always a full stop (.)
+ % #4 is a template for the other bytes in the sequence. The values for these
+ % bytes is substituted in here with \uppercase using the \uccode's.
\gdef\parseUTFviiiB#1#2#3#4{%
\advance\countUTFz by "#10\relax
\uccode `#3\countUTFz
\uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
\endgroup
+% For native Unicode handling (XeTeX and LuaTeX),
+% provide a definition macro that sets a catcode to `other' non-globally
+%
+\def\DeclareUnicodeCharacterNativeOther#1#2{%
+ \catcode"#1=\other
+}
+
% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
@@ -10018,732 +10530,738 @@ callback.register("process_output_buffer", convert_line_out)
% We won't be doing that here in this simple file. But we can try to at
% least make most of the characters not bomb out.
%
-\def\utfeightchardefs{%
- \DeclareUnicodeCharacter{00A0}{\tie}
- \DeclareUnicodeCharacter{00A1}{\exclamdown}
+\def\unicodechardefs{%
+ \DeclareUnicodeCharacter{00A0}{\tie}%
+ \DeclareUnicodeCharacter{00A1}{\exclamdown}%
\DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
- \DeclareUnicodeCharacter{00A3}{\pounds}
+ \DeclareUnicodeCharacter{00A3}{\pounds{}}%
\DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
\DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
\DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
- \DeclareUnicodeCharacter{00A7}{\S}
- \DeclareUnicodeCharacter{00A8}{\"{ }}
- \DeclareUnicodeCharacter{00A9}{\copyright}
- \DeclareUnicodeCharacter{00AA}{\ordf}
- \DeclareUnicodeCharacter{00AB}{\guillemetleft}
- \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}
- \DeclareUnicodeCharacter{00AD}{\-}
- \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
- \DeclareUnicodeCharacter{00AF}{\={ }}
- %
- \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
- \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}
- \DeclareUnicodeCharacter{00B2}{$^2$}
- \DeclareUnicodeCharacter{00B3}{$^3$}
- \DeclareUnicodeCharacter{00B4}{\'{ }}
- \DeclareUnicodeCharacter{00B5}{$\mu$}
- \DeclareUnicodeCharacter{00B6}{\P}
- \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}
- \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
- \DeclareUnicodeCharacter{00B9}{$^1$}
- \DeclareUnicodeCharacter{00BA}{\ordm}
- \DeclareUnicodeCharacter{00BB}{\guillemetright}
- \DeclareUnicodeCharacter{00BC}{$1\over4$}
- \DeclareUnicodeCharacter{00BD}{$1\over2$}
- \DeclareUnicodeCharacter{00BE}{$3\over4$}
- \DeclareUnicodeCharacter{00BF}{\questiondown}
- %
- \DeclareUnicodeCharacter{00C0}{\`A}
- \DeclareUnicodeCharacter{00C1}{\'A}
- \DeclareUnicodeCharacter{00C2}{\^A}
- \DeclareUnicodeCharacter{00C3}{\~A}
- \DeclareUnicodeCharacter{00C4}{\"A}
- \DeclareUnicodeCharacter{00C5}{\AA}
- \DeclareUnicodeCharacter{00C6}{\AE}
- \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
- \DeclareUnicodeCharacter{00C8}{\`E}
- \DeclareUnicodeCharacter{00C9}{\'E}
- \DeclareUnicodeCharacter{00CA}{\^E}
- \DeclareUnicodeCharacter{00CB}{\"E}
- \DeclareUnicodeCharacter{00CC}{\`I}
- \DeclareUnicodeCharacter{00CD}{\'I}
- \DeclareUnicodeCharacter{00CE}{\^I}
- \DeclareUnicodeCharacter{00CF}{\"I}
- %
- \DeclareUnicodeCharacter{00D0}{\DH}
- \DeclareUnicodeCharacter{00D1}{\~N}
- \DeclareUnicodeCharacter{00D2}{\`O}
- \DeclareUnicodeCharacter{00D3}{\'O}
- \DeclareUnicodeCharacter{00D4}{\^O}
- \DeclareUnicodeCharacter{00D5}{\~O}
- \DeclareUnicodeCharacter{00D6}{\"O}
- \DeclareUnicodeCharacter{00D7}{\ensuremath\times}
- \DeclareUnicodeCharacter{00D8}{\O}
- \DeclareUnicodeCharacter{00D9}{\`U}
- \DeclareUnicodeCharacter{00DA}{\'U}
- \DeclareUnicodeCharacter{00DB}{\^U}
- \DeclareUnicodeCharacter{00DC}{\"U}
- \DeclareUnicodeCharacter{00DD}{\'Y}
- \DeclareUnicodeCharacter{00DE}{\TH}
- \DeclareUnicodeCharacter{00DF}{\ss}
- %
- \DeclareUnicodeCharacter{00E0}{\`a}
- \DeclareUnicodeCharacter{00E1}{\'a}
- \DeclareUnicodeCharacter{00E2}{\^a}
- \DeclareUnicodeCharacter{00E3}{\~a}
- \DeclareUnicodeCharacter{00E4}{\"a}
- \DeclareUnicodeCharacter{00E5}{\aa}
- \DeclareUnicodeCharacter{00E6}{\ae}
- \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
- \DeclareUnicodeCharacter{00E8}{\`e}
- \DeclareUnicodeCharacter{00E9}{\'e}
- \DeclareUnicodeCharacter{00EA}{\^e}
- \DeclareUnicodeCharacter{00EB}{\"e}
- \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
- \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
- \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
- \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
- %
- \DeclareUnicodeCharacter{00F0}{\dh}
- \DeclareUnicodeCharacter{00F1}{\~n}
- \DeclareUnicodeCharacter{00F2}{\`o}
- \DeclareUnicodeCharacter{00F3}{\'o}
- \DeclareUnicodeCharacter{00F4}{\^o}
- \DeclareUnicodeCharacter{00F5}{\~o}
- \DeclareUnicodeCharacter{00F6}{\"o}
- \DeclareUnicodeCharacter{00F7}{\ensuremath\div}
- \DeclareUnicodeCharacter{00F8}{\o}
- \DeclareUnicodeCharacter{00F9}{\`u}
- \DeclareUnicodeCharacter{00FA}{\'u}
- \DeclareUnicodeCharacter{00FB}{\^u}
- \DeclareUnicodeCharacter{00FC}{\"u}
- \DeclareUnicodeCharacter{00FD}{\'y}
- \DeclareUnicodeCharacter{00FE}{\th}
- \DeclareUnicodeCharacter{00FF}{\"y}
- %
- \DeclareUnicodeCharacter{0100}{\=A}
- \DeclareUnicodeCharacter{0101}{\=a}
- \DeclareUnicodeCharacter{0102}{\u{A}}
- \DeclareUnicodeCharacter{0103}{\u{a}}
- \DeclareUnicodeCharacter{0104}{\ogonek{A}}
- \DeclareUnicodeCharacter{0105}{\ogonek{a}}
- \DeclareUnicodeCharacter{0106}{\'C}
- \DeclareUnicodeCharacter{0107}{\'c}
- \DeclareUnicodeCharacter{0108}{\^C}
- \DeclareUnicodeCharacter{0109}{\^c}
- \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
- \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
- \DeclareUnicodeCharacter{010C}{\v{C}}
- \DeclareUnicodeCharacter{010D}{\v{c}}
- \DeclareUnicodeCharacter{010E}{\v{D}}
- \DeclareUnicodeCharacter{010F}{d'}
- %
- \DeclareUnicodeCharacter{0110}{\DH}
- \DeclareUnicodeCharacter{0111}{\dh}
- \DeclareUnicodeCharacter{0112}{\=E}
- \DeclareUnicodeCharacter{0113}{\=e}
- \DeclareUnicodeCharacter{0114}{\u{E}}
- \DeclareUnicodeCharacter{0115}{\u{e}}
- \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
- \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
- \DeclareUnicodeCharacter{0118}{\ogonek{E}}
- \DeclareUnicodeCharacter{0119}{\ogonek{e}}
- \DeclareUnicodeCharacter{011A}{\v{E}}
- \DeclareUnicodeCharacter{011B}{\v{e}}
- \DeclareUnicodeCharacter{011C}{\^G}
- \DeclareUnicodeCharacter{011D}{\^g}
- \DeclareUnicodeCharacter{011E}{\u{G}}
- \DeclareUnicodeCharacter{011F}{\u{g}}
- %
- \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
- \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
- \DeclareUnicodeCharacter{0122}{\cedilla{G}}
- \DeclareUnicodeCharacter{0123}{\cedilla{g}}
- \DeclareUnicodeCharacter{0124}{\^H}
- \DeclareUnicodeCharacter{0125}{\^h}
- \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}
- \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}
- \DeclareUnicodeCharacter{0128}{\~I}
- \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
- \DeclareUnicodeCharacter{012A}{\=I}
- \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
- \DeclareUnicodeCharacter{012C}{\u{I}}
- \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
- \DeclareUnicodeCharacter{012E}{\ogonek{I}}
- \DeclareUnicodeCharacter{012F}{\ogonek{i}}
- %
- \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
- \DeclareUnicodeCharacter{0131}{\dotless{i}}
- \DeclareUnicodeCharacter{0132}{IJ}
- \DeclareUnicodeCharacter{0133}{ij}
- \DeclareUnicodeCharacter{0134}{\^J}
- \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
- \DeclareUnicodeCharacter{0136}{\cedilla{K}}
- \DeclareUnicodeCharacter{0137}{\cedilla{k}}
- \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}
- \DeclareUnicodeCharacter{0139}{\'L}
- \DeclareUnicodeCharacter{013A}{\'l}
- \DeclareUnicodeCharacter{013B}{\cedilla{L}}
- \DeclareUnicodeCharacter{013C}{\cedilla{l}}
+ \DeclareUnicodeCharacter{00A7}{\S}%
+ \DeclareUnicodeCharacter{00A8}{\"{ }}%
+ \DeclareUnicodeCharacter{00A9}{\copyright{}}%
+ \DeclareUnicodeCharacter{00AA}{\ordf}%
+ \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}%
+ \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
+ \DeclareUnicodeCharacter{00AD}{\-}%
+ \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
+ \DeclareUnicodeCharacter{00AF}{\={ }}%
+ %
+ \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
+ \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
+ \DeclareUnicodeCharacter{00B2}{$^2$}%
+ \DeclareUnicodeCharacter{00B3}{$^3$}%
+ \DeclareUnicodeCharacter{00B4}{\'{ }}%
+ \DeclareUnicodeCharacter{00B5}{$\mu$}%
+ \DeclareUnicodeCharacter{00B6}{\P}%
+ \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
+ \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
+ \DeclareUnicodeCharacter{00B9}{$^1$}%
+ \DeclareUnicodeCharacter{00BA}{\ordm}%
+ \DeclareUnicodeCharacter{00BB}{\guillemetright{}}%
+ \DeclareUnicodeCharacter{00BC}{$1\over4$}%
+ \DeclareUnicodeCharacter{00BD}{$1\over2$}%
+ \DeclareUnicodeCharacter{00BE}{$3\over4$}%
+ \DeclareUnicodeCharacter{00BF}{\questiondown}%
+ %
+ \DeclareUnicodeCharacter{00C0}{\`A}%
+ \DeclareUnicodeCharacter{00C1}{\'A}%
+ \DeclareUnicodeCharacter{00C2}{\^A}%
+ \DeclareUnicodeCharacter{00C3}{\~A}%
+ \DeclareUnicodeCharacter{00C4}{\"A}%
+ \DeclareUnicodeCharacter{00C5}{\AA}%
+ \DeclareUnicodeCharacter{00C6}{\AE}%
+ \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
+ \DeclareUnicodeCharacter{00C8}{\`E}%
+ \DeclareUnicodeCharacter{00C9}{\'E}%
+ \DeclareUnicodeCharacter{00CA}{\^E}%
+ \DeclareUnicodeCharacter{00CB}{\"E}%
+ \DeclareUnicodeCharacter{00CC}{\`I}%
+ \DeclareUnicodeCharacter{00CD}{\'I}%
+ \DeclareUnicodeCharacter{00CE}{\^I}%
+ \DeclareUnicodeCharacter{00CF}{\"I}%
+ %
+ \DeclareUnicodeCharacter{00D0}{\DH}%
+ \DeclareUnicodeCharacter{00D1}{\~N}%
+ \DeclareUnicodeCharacter{00D2}{\`O}%
+ \DeclareUnicodeCharacter{00D3}{\'O}%
+ \DeclareUnicodeCharacter{00D4}{\^O}%
+ \DeclareUnicodeCharacter{00D5}{\~O}%
+ \DeclareUnicodeCharacter{00D6}{\"O}%
+ \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
+ \DeclareUnicodeCharacter{00D8}{\O}%
+ \DeclareUnicodeCharacter{00D9}{\`U}%
+ \DeclareUnicodeCharacter{00DA}{\'U}%
+ \DeclareUnicodeCharacter{00DB}{\^U}%
+ \DeclareUnicodeCharacter{00DC}{\"U}%
+ \DeclareUnicodeCharacter{00DD}{\'Y}%
+ \DeclareUnicodeCharacter{00DE}{\TH}%
+ \DeclareUnicodeCharacter{00DF}{\ss}%
+ %
+ \DeclareUnicodeCharacter{00E0}{\`a}%
+ \DeclareUnicodeCharacter{00E1}{\'a}%
+ \DeclareUnicodeCharacter{00E2}{\^a}%
+ \DeclareUnicodeCharacter{00E3}{\~a}%
+ \DeclareUnicodeCharacter{00E4}{\"a}%
+ \DeclareUnicodeCharacter{00E5}{\aa}%
+ \DeclareUnicodeCharacter{00E6}{\ae}%
+ \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
+ \DeclareUnicodeCharacter{00E8}{\`e}%
+ \DeclareUnicodeCharacter{00E9}{\'e}%
+ \DeclareUnicodeCharacter{00EA}{\^e}%
+ \DeclareUnicodeCharacter{00EB}{\"e}%
+ \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
+ \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
+ \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
+ \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
+ %
+ \DeclareUnicodeCharacter{00F0}{\dh}%
+ \DeclareUnicodeCharacter{00F1}{\~n}%
+ \DeclareUnicodeCharacter{00F2}{\`o}%
+ \DeclareUnicodeCharacter{00F3}{\'o}%
+ \DeclareUnicodeCharacter{00F4}{\^o}%
+ \DeclareUnicodeCharacter{00F5}{\~o}%
+ \DeclareUnicodeCharacter{00F6}{\"o}%
+ \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
+ \DeclareUnicodeCharacter{00F8}{\o}%
+ \DeclareUnicodeCharacter{00F9}{\`u}%
+ \DeclareUnicodeCharacter{00FA}{\'u}%
+ \DeclareUnicodeCharacter{00FB}{\^u}%
+ \DeclareUnicodeCharacter{00FC}{\"u}%
+ \DeclareUnicodeCharacter{00FD}{\'y}%
+ \DeclareUnicodeCharacter{00FE}{\th}%
+ \DeclareUnicodeCharacter{00FF}{\"y}%
+ %
+ \DeclareUnicodeCharacter{0100}{\=A}%
+ \DeclareUnicodeCharacter{0101}{\=a}%
+ \DeclareUnicodeCharacter{0102}{\u{A}}%
+ \DeclareUnicodeCharacter{0103}{\u{a}}%
+ \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
+ \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
+ \DeclareUnicodeCharacter{0106}{\'C}%
+ \DeclareUnicodeCharacter{0107}{\'c}%
+ \DeclareUnicodeCharacter{0108}{\^C}%
+ \DeclareUnicodeCharacter{0109}{\^c}%
+ \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
+ \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
+ \DeclareUnicodeCharacter{010C}{\v{C}}%
+ \DeclareUnicodeCharacter{010D}{\v{c}}%
+ \DeclareUnicodeCharacter{010E}{\v{D}}%
+ \DeclareUnicodeCharacter{010F}{d'}%
+ %
+ \DeclareUnicodeCharacter{0110}{\DH}%
+ \DeclareUnicodeCharacter{0111}{\dh}%
+ \DeclareUnicodeCharacter{0112}{\=E}%
+ \DeclareUnicodeCharacter{0113}{\=e}%
+ \DeclareUnicodeCharacter{0114}{\u{E}}%
+ \DeclareUnicodeCharacter{0115}{\u{e}}%
+ \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
+ \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
+ \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
+ \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
+ \DeclareUnicodeCharacter{011A}{\v{E}}%
+ \DeclareUnicodeCharacter{011B}{\v{e}}%
+ \DeclareUnicodeCharacter{011C}{\^G}%
+ \DeclareUnicodeCharacter{011D}{\^g}%
+ \DeclareUnicodeCharacter{011E}{\u{G}}%
+ \DeclareUnicodeCharacter{011F}{\u{g}}%
+ %
+ \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
+ \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
+ \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
+ \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
+ \DeclareUnicodeCharacter{0124}{\^H}%
+ \DeclareUnicodeCharacter{0125}{\^h}%
+ \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
+ \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
+ \DeclareUnicodeCharacter{0128}{\~I}%
+ \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
+ \DeclareUnicodeCharacter{012A}{\=I}%
+ \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
+ \DeclareUnicodeCharacter{012C}{\u{I}}%
+ \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
+ \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
+ \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
+ %
+ \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
+ \DeclareUnicodeCharacter{0131}{\dotless{i}}%
+ \DeclareUnicodeCharacter{0132}{IJ}%
+ \DeclareUnicodeCharacter{0133}{ij}%
+ \DeclareUnicodeCharacter{0134}{\^J}%
+ \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
+ \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
+ \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
+ \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
+ \DeclareUnicodeCharacter{0139}{\'L}%
+ \DeclareUnicodeCharacter{013A}{\'l}%
+ \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
+ \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
\DeclareUnicodeCharacter{013D}{L'}% should kern
\DeclareUnicodeCharacter{013E}{l'}% should kern
- \DeclareUnicodeCharacter{013F}{L\U{00B7}}
- %
- \DeclareUnicodeCharacter{0140}{l\U{00B7}}
- \DeclareUnicodeCharacter{0141}{\L}
- \DeclareUnicodeCharacter{0142}{\l}
- \DeclareUnicodeCharacter{0143}{\'N}
- \DeclareUnicodeCharacter{0144}{\'n}
- \DeclareUnicodeCharacter{0145}{\cedilla{N}}
- \DeclareUnicodeCharacter{0146}{\cedilla{n}}
- \DeclareUnicodeCharacter{0147}{\v{N}}
- \DeclareUnicodeCharacter{0148}{\v{n}}
- \DeclareUnicodeCharacter{0149}{'n}
- \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}
- \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}
- \DeclareUnicodeCharacter{014C}{\=O}
- \DeclareUnicodeCharacter{014D}{\=o}
- \DeclareUnicodeCharacter{014E}{\u{O}}
- \DeclareUnicodeCharacter{014F}{\u{o}}
- %
- \DeclareUnicodeCharacter{0150}{\H{O}}
- \DeclareUnicodeCharacter{0151}{\H{o}}
- \DeclareUnicodeCharacter{0152}{\OE}
- \DeclareUnicodeCharacter{0153}{\oe}
- \DeclareUnicodeCharacter{0154}{\'R}
- \DeclareUnicodeCharacter{0155}{\'r}
- \DeclareUnicodeCharacter{0156}{\cedilla{R}}
- \DeclareUnicodeCharacter{0157}{\cedilla{r}}
- \DeclareUnicodeCharacter{0158}{\v{R}}
- \DeclareUnicodeCharacter{0159}{\v{r}}
- \DeclareUnicodeCharacter{015A}{\'S}
- \DeclareUnicodeCharacter{015B}{\'s}
- \DeclareUnicodeCharacter{015C}{\^S}
- \DeclareUnicodeCharacter{015D}{\^s}
- \DeclareUnicodeCharacter{015E}{\cedilla{S}}
- \DeclareUnicodeCharacter{015F}{\cedilla{s}}
- %
- \DeclareUnicodeCharacter{0160}{\v{S}}
- \DeclareUnicodeCharacter{0161}{\v{s}}
- \DeclareUnicodeCharacter{0162}{\cedilla{T}}
- \DeclareUnicodeCharacter{0163}{\cedilla{t}}
- \DeclareUnicodeCharacter{0164}{\v{T}}
- \DeclareUnicodeCharacter{0165}{\v{t}}
- \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}
- \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}
- \DeclareUnicodeCharacter{0168}{\~U}
- \DeclareUnicodeCharacter{0169}{\~u}
- \DeclareUnicodeCharacter{016A}{\=U}
- \DeclareUnicodeCharacter{016B}{\=u}
- \DeclareUnicodeCharacter{016C}{\u{U}}
- \DeclareUnicodeCharacter{016D}{\u{u}}
- \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
- \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
- %
- \DeclareUnicodeCharacter{0170}{\H{U}}
- \DeclareUnicodeCharacter{0171}{\H{u}}
- \DeclareUnicodeCharacter{0172}{\ogonek{U}}
- \DeclareUnicodeCharacter{0173}{\ogonek{u}}
- \DeclareUnicodeCharacter{0174}{\^W}
- \DeclareUnicodeCharacter{0175}{\^w}
- \DeclareUnicodeCharacter{0176}{\^Y}
- \DeclareUnicodeCharacter{0177}{\^y}
- \DeclareUnicodeCharacter{0178}{\"Y}
- \DeclareUnicodeCharacter{0179}{\'Z}
- \DeclareUnicodeCharacter{017A}{\'z}
- \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
- \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
- \DeclareUnicodeCharacter{017D}{\v{Z}}
- \DeclareUnicodeCharacter{017E}{\v{z}}
- \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}
- %
- \DeclareUnicodeCharacter{01C4}{D\v{Z}}
- \DeclareUnicodeCharacter{01C5}{D\v{z}}
- \DeclareUnicodeCharacter{01C6}{d\v{z}}
- \DeclareUnicodeCharacter{01C7}{LJ}
- \DeclareUnicodeCharacter{01C8}{Lj}
- \DeclareUnicodeCharacter{01C9}{lj}
- \DeclareUnicodeCharacter{01CA}{NJ}
- \DeclareUnicodeCharacter{01CB}{Nj}
- \DeclareUnicodeCharacter{01CC}{nj}
- \DeclareUnicodeCharacter{01CD}{\v{A}}
- \DeclareUnicodeCharacter{01CE}{\v{a}}
- \DeclareUnicodeCharacter{01CF}{\v{I}}
- %
- \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
- \DeclareUnicodeCharacter{01D1}{\v{O}}
- \DeclareUnicodeCharacter{01D2}{\v{o}}
- \DeclareUnicodeCharacter{01D3}{\v{U}}
- \DeclareUnicodeCharacter{01D4}{\v{u}}
- %
- \DeclareUnicodeCharacter{01E2}{\={\AE}}
- \DeclareUnicodeCharacter{01E3}{\={\ae}}
- \DeclareUnicodeCharacter{01E6}{\v{G}}
- \DeclareUnicodeCharacter{01E7}{\v{g}}
- \DeclareUnicodeCharacter{01E8}{\v{K}}
- \DeclareUnicodeCharacter{01E9}{\v{k}}
- %
- \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
- \DeclareUnicodeCharacter{01F1}{DZ}
- \DeclareUnicodeCharacter{01F2}{Dz}
- \DeclareUnicodeCharacter{01F3}{dz}
- \DeclareUnicodeCharacter{01F4}{\'G}
- \DeclareUnicodeCharacter{01F5}{\'g}
- \DeclareUnicodeCharacter{01F8}{\`N}
- \DeclareUnicodeCharacter{01F9}{\`n}
- \DeclareUnicodeCharacter{01FC}{\'{\AE}}
- \DeclareUnicodeCharacter{01FD}{\'{\ae}}
- \DeclareUnicodeCharacter{01FE}{\'{\O}}
- \DeclareUnicodeCharacter{01FF}{\'{\o}}
- %
- \DeclareUnicodeCharacter{021E}{\v{H}}
- \DeclareUnicodeCharacter{021F}{\v{h}}
- %
- \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
- \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
- \DeclareUnicodeCharacter{0228}{\cedilla{E}}
- \DeclareUnicodeCharacter{0229}{\cedilla{e}}
- \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
- \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
- %
- \DeclareUnicodeCharacter{0232}{\=Y}
- \DeclareUnicodeCharacter{0233}{\=y}
- \DeclareUnicodeCharacter{0237}{\dotless{j}}
- %
- \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
+ \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
+ %
+ \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
+ \DeclareUnicodeCharacter{0141}{\L}%
+ \DeclareUnicodeCharacter{0142}{\l}%
+ \DeclareUnicodeCharacter{0143}{\'N}%
+ \DeclareUnicodeCharacter{0144}{\'n}%
+ \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
+ \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
+ \DeclareUnicodeCharacter{0147}{\v{N}}%
+ \DeclareUnicodeCharacter{0148}{\v{n}}%
+ \DeclareUnicodeCharacter{0149}{'n}%
+ \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
+ \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
+ \DeclareUnicodeCharacter{014C}{\=O}%
+ \DeclareUnicodeCharacter{014D}{\=o}%
+ \DeclareUnicodeCharacter{014E}{\u{O}}%
+ \DeclareUnicodeCharacter{014F}{\u{o}}%
+ %
+ \DeclareUnicodeCharacter{0150}{\H{O}}%
+ \DeclareUnicodeCharacter{0151}{\H{o}}%
+ \DeclareUnicodeCharacter{0152}{\OE}%
+ \DeclareUnicodeCharacter{0153}{\oe}%
+ \DeclareUnicodeCharacter{0154}{\'R}%
+ \DeclareUnicodeCharacter{0155}{\'r}%
+ \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
+ \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
+ \DeclareUnicodeCharacter{0158}{\v{R}}%
+ \DeclareUnicodeCharacter{0159}{\v{r}}%
+ \DeclareUnicodeCharacter{015A}{\'S}%
+ \DeclareUnicodeCharacter{015B}{\'s}%
+ \DeclareUnicodeCharacter{015C}{\^S}%
+ \DeclareUnicodeCharacter{015D}{\^s}%
+ \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
+ \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
+ %
+ \DeclareUnicodeCharacter{0160}{\v{S}}%
+ \DeclareUnicodeCharacter{0161}{\v{s}}%
+ \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
+ \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
+ \DeclareUnicodeCharacter{0164}{\v{T}}%
+ \DeclareUnicodeCharacter{0165}{\v{t}}%
+ \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
+ \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
+ \DeclareUnicodeCharacter{0168}{\~U}%
+ \DeclareUnicodeCharacter{0169}{\~u}%
+ \DeclareUnicodeCharacter{016A}{\=U}%
+ \DeclareUnicodeCharacter{016B}{\=u}%
+ \DeclareUnicodeCharacter{016C}{\u{U}}%
+ \DeclareUnicodeCharacter{016D}{\u{u}}%
+ \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
+ \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
+ %
+ \DeclareUnicodeCharacter{0170}{\H{U}}%
+ \DeclareUnicodeCharacter{0171}{\H{u}}%
+ \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
+ \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
+ \DeclareUnicodeCharacter{0174}{\^W}%
+ \DeclareUnicodeCharacter{0175}{\^w}%
+ \DeclareUnicodeCharacter{0176}{\^Y}%
+ \DeclareUnicodeCharacter{0177}{\^y}%
+ \DeclareUnicodeCharacter{0178}{\"Y}%
+ \DeclareUnicodeCharacter{0179}{\'Z}%
+ \DeclareUnicodeCharacter{017A}{\'z}%
+ \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
+ \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
+ \DeclareUnicodeCharacter{017D}{\v{Z}}%
+ \DeclareUnicodeCharacter{017E}{\v{z}}%
+ \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
+ %
+ \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
+ \DeclareUnicodeCharacter{01C5}{D\v{z}}%
+ \DeclareUnicodeCharacter{01C6}{d\v{z}}%
+ \DeclareUnicodeCharacter{01C7}{LJ}%
+ \DeclareUnicodeCharacter{01C8}{Lj}%
+ \DeclareUnicodeCharacter{01C9}{lj}%
+ \DeclareUnicodeCharacter{01CA}{NJ}%
+ \DeclareUnicodeCharacter{01CB}{Nj}%
+ \DeclareUnicodeCharacter{01CC}{nj}%
+ \DeclareUnicodeCharacter{01CD}{\v{A}}%
+ \DeclareUnicodeCharacter{01CE}{\v{a}}%
+ \DeclareUnicodeCharacter{01CF}{\v{I}}%
+ %
+ \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
+ \DeclareUnicodeCharacter{01D1}{\v{O}}%
+ \DeclareUnicodeCharacter{01D2}{\v{o}}%
+ \DeclareUnicodeCharacter{01D3}{\v{U}}%
+ \DeclareUnicodeCharacter{01D4}{\v{u}}%
+ %
+ \DeclareUnicodeCharacter{01E2}{\={\AE}}%
+ \DeclareUnicodeCharacter{01E3}{\={\ae}}%
+ \DeclareUnicodeCharacter{01E6}{\v{G}}%
+ \DeclareUnicodeCharacter{01E7}{\v{g}}%
+ \DeclareUnicodeCharacter{01E8}{\v{K}}%
+ \DeclareUnicodeCharacter{01E9}{\v{k}}%
+ %
+ \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
+ \DeclareUnicodeCharacter{01F1}{DZ}%
+ \DeclareUnicodeCharacter{01F2}{Dz}%
+ \DeclareUnicodeCharacter{01F3}{dz}%
+ \DeclareUnicodeCharacter{01F4}{\'G}%
+ \DeclareUnicodeCharacter{01F5}{\'g}%
+ \DeclareUnicodeCharacter{01F8}{\`N}%
+ \DeclareUnicodeCharacter{01F9}{\`n}%
+ \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
+ \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
+ \DeclareUnicodeCharacter{01FE}{\'{\O}}%
+ \DeclareUnicodeCharacter{01FF}{\'{\o}}%
+ %
+ \DeclareUnicodeCharacter{021E}{\v{H}}%
+ \DeclareUnicodeCharacter{021F}{\v{h}}%
+ %
+ \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
+ \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
+ \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
+ \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
+ \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
+ \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
+ %
+ \DeclareUnicodeCharacter{0232}{\=Y}%
+ \DeclareUnicodeCharacter{0233}{\=y}%
+ \DeclareUnicodeCharacter{0237}{\dotless{j}}%
+ %
+ \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
%
% Greek letters upper case
- \DeclareUnicodeCharacter{0391}{{\it A}}
- \DeclareUnicodeCharacter{0392}{{\it B}}
- \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}
- \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}
- \DeclareUnicodeCharacter{0395}{{\it E}}
- \DeclareUnicodeCharacter{0396}{{\it Z}}
- \DeclareUnicodeCharacter{0397}{{\it H}}
- \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}
- \DeclareUnicodeCharacter{0399}{{\it I}}
- \DeclareUnicodeCharacter{039A}{{\it K}}
- \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}
- \DeclareUnicodeCharacter{039C}{{\it M}}
- \DeclareUnicodeCharacter{039D}{{\it N}}
- \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}
- \DeclareUnicodeCharacter{039F}{{\it O}}
- \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}
- \DeclareUnicodeCharacter{03A1}{{\it P}}
+ \DeclareUnicodeCharacter{0391}{{\it A}}%
+ \DeclareUnicodeCharacter{0392}{{\it B}}%
+ \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
+ \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
+ \DeclareUnicodeCharacter{0395}{{\it E}}%
+ \DeclareUnicodeCharacter{0396}{{\it Z}}%
+ \DeclareUnicodeCharacter{0397}{{\it H}}%
+ \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
+ \DeclareUnicodeCharacter{0399}{{\it I}}%
+ \DeclareUnicodeCharacter{039A}{{\it K}}%
+ \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
+ \DeclareUnicodeCharacter{039C}{{\it M}}%
+ \DeclareUnicodeCharacter{039D}{{\it N}}%
+ \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
+ \DeclareUnicodeCharacter{039F}{{\it O}}%
+ \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
+ \DeclareUnicodeCharacter{03A1}{{\it P}}%
%\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
- \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}
- \DeclareUnicodeCharacter{03A4}{{\it T}}
- \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}
- \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}
- \DeclareUnicodeCharacter{03A7}{{\it X}}
- \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}
- \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}
+ \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
+ \DeclareUnicodeCharacter{03A4}{{\it T}}%
+ \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
+ \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
+ \DeclareUnicodeCharacter{03A7}{{\it X}}%
+ \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
+ \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
%
% Vowels with accents
- \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}
- \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}
- \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}
- \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}
- \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}
- \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}
+ \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
+ \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
+ \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
+ \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
+ \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
+ \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
%
% Standalone accent
- \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}
+ \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
%
% Greek letters lower case
- \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}
- \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}
- \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}
- \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}
- \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}
- \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}
- \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}
- \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}
- \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}
- \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}
- \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}
- \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}
- \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}
- \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}
- \DeclareUnicodeCharacter{03BF}{{\it o}} % omicron
- \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}
- \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}
- \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}
- \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}
- \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}
- \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}
- \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}
- \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}
- \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}
- \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}
+ \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
+ \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
+ \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
+ \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
+ \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
+ \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
+ \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
+ \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
+ \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
+ \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
+ \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
+ \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
+ \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
+ \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
+ \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
+ \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
+ \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
+ \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
+ \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
+ \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
+ \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
+ \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
+ \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
+ \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
+ \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
%
% More Greek vowels with accents
- \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}
- \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}
- \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}
- \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}
- \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}
+ \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
+ \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
+ \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
+ \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
+ \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
%
% Variant Greek letters
- \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}
- \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}
- \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}
- %
- \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
- \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
- \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
- \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
- \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
- \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
- \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
- \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
- \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
- \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
- \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
- \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
- %
- \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
- \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
- %
- \DeclareUnicodeCharacter{1E20}{\=G}
- \DeclareUnicodeCharacter{1E21}{\=g}
- \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
- \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
- \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
- \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
- \DeclareUnicodeCharacter{1E26}{\"H}
- \DeclareUnicodeCharacter{1E27}{\"h}
- %
- \DeclareUnicodeCharacter{1E30}{\'K}
- \DeclareUnicodeCharacter{1E31}{\'k}
- \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
- \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
- \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
- \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
- \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
- \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
- \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
- \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
- \DeclareUnicodeCharacter{1E3E}{\'M}
- \DeclareUnicodeCharacter{1E3F}{\'m}
- %
- \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
- \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
- \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
- \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
- \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
- \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
- \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
- \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
- \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
- \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
- %
- \DeclareUnicodeCharacter{1E54}{\'P}
- \DeclareUnicodeCharacter{1E55}{\'p}
- \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
- \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
- \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
- \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
- \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
- \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
- \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
- \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
- %
- \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
- \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
- \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
- \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
- \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
- \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
- \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
- \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
- \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
- \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
- %
- \DeclareUnicodeCharacter{1E7C}{\~V}
- \DeclareUnicodeCharacter{1E7D}{\~v}
- \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
- \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
- %
- \DeclareUnicodeCharacter{1E80}{\`W}
- \DeclareUnicodeCharacter{1E81}{\`w}
- \DeclareUnicodeCharacter{1E82}{\'W}
- \DeclareUnicodeCharacter{1E83}{\'w}
- \DeclareUnicodeCharacter{1E84}{\"W}
- \DeclareUnicodeCharacter{1E85}{\"w}
- \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
- \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
- \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
- \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
- \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
- \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
- \DeclareUnicodeCharacter{1E8C}{\"X}
- \DeclareUnicodeCharacter{1E8D}{\"x}
- \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
- \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
- %
- \DeclareUnicodeCharacter{1E90}{\^Z}
- \DeclareUnicodeCharacter{1E91}{\^z}
- \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
- \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
- \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
- \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
- \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
- \DeclareUnicodeCharacter{1E97}{\"t}
- \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
- \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
- %
- \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
- \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
- %
- \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
- \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
- \DeclareUnicodeCharacter{1EBC}{\~E}
- \DeclareUnicodeCharacter{1EBD}{\~e}
- %
- \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
- \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
- \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
- \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
- %
- \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
- \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
- %
- \DeclareUnicodeCharacter{1EF2}{\`Y}
- \DeclareUnicodeCharacter{1EF3}{\`y}
- \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
- %
- \DeclareUnicodeCharacter{1EF8}{\~Y}
- \DeclareUnicodeCharacter{1EF9}{\~y}
+ \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
+ \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
+ \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
+ %
+ \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
+ \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
+ \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
+ \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
+ \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
+ \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
+ \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
+ \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
+ \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
+ \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
+ \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
+ \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
+ %
+ \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
+ \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
+ %
+ \DeclareUnicodeCharacter{1E20}{\=G}%
+ \DeclareUnicodeCharacter{1E21}{\=g}%
+ \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
+ \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
+ \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
+ \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
+ \DeclareUnicodeCharacter{1E26}{\"H}%
+ \DeclareUnicodeCharacter{1E27}{\"h}%
+ %
+ \DeclareUnicodeCharacter{1E30}{\'K}%
+ \DeclareUnicodeCharacter{1E31}{\'k}%
+ \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
+ \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
+ \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
+ \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
+ \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
+ \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
+ \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
+ \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
+ \DeclareUnicodeCharacter{1E3E}{\'M}%
+ \DeclareUnicodeCharacter{1E3F}{\'m}%
+ %
+ \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
+ \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
+ \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
+ \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
+ \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
+ \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
+ \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
+ \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
+ \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
+ \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
+ %
+ \DeclareUnicodeCharacter{1E54}{\'P}%
+ \DeclareUnicodeCharacter{1E55}{\'p}%
+ \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
+ \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
+ \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
+ \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
+ \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
+ \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
+ \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
+ \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
+ %
+ \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
+ \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
+ \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
+ \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
+ \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
+ \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
+ \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
+ \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
+ \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
+ \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
+ %
+ \DeclareUnicodeCharacter{1E7C}{\~V}%
+ \DeclareUnicodeCharacter{1E7D}{\~v}%
+ \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
+ \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
+ %
+ \DeclareUnicodeCharacter{1E80}{\`W}%
+ \DeclareUnicodeCharacter{1E81}{\`w}%
+ \DeclareUnicodeCharacter{1E82}{\'W}%
+ \DeclareUnicodeCharacter{1E83}{\'w}%
+ \DeclareUnicodeCharacter{1E84}{\"W}%
+ \DeclareUnicodeCharacter{1E85}{\"w}%
+ \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
+ \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
+ \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
+ \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
+ \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
+ \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
+ \DeclareUnicodeCharacter{1E8C}{\"X}%
+ \DeclareUnicodeCharacter{1E8D}{\"x}%
+ \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
+ \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
+ %
+ \DeclareUnicodeCharacter{1E90}{\^Z}%
+ \DeclareUnicodeCharacter{1E91}{\^z}%
+ \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
+ \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
+ \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
+ \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
+ \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
+ \DeclareUnicodeCharacter{1E97}{\"t}%
+ \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
+ \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
+ %
+ \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
+ \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
+ %
+ \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
+ \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
+ \DeclareUnicodeCharacter{1EBC}{\~E}%
+ \DeclareUnicodeCharacter{1EBD}{\~e}%
+ %
+ \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
+ \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
+ \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
+ \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
+ %
+ \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
+ \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
+ %
+ \DeclareUnicodeCharacter{1EF2}{\`Y}%
+ \DeclareUnicodeCharacter{1EF3}{\`y}%
+ \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
+ %
+ \DeclareUnicodeCharacter{1EF8}{\~Y}%
+ \DeclareUnicodeCharacter{1EF9}{\~y}%
%
% Punctuation
- \DeclareUnicodeCharacter{2013}{--}
- \DeclareUnicodeCharacter{2014}{---}
- \DeclareUnicodeCharacter{2018}{\quoteleft}
- \DeclareUnicodeCharacter{2019}{\quoteright}
- \DeclareUnicodeCharacter{201A}{\quotesinglbase}
- \DeclareUnicodeCharacter{201C}{\quotedblleft}
- \DeclareUnicodeCharacter{201D}{\quotedblright}
- \DeclareUnicodeCharacter{201E}{\quotedblbase}
- \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}
- \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}
- \DeclareUnicodeCharacter{2022}{\bullet}
- \DeclareUnicodeCharacter{202F}{\thinspace}
- \DeclareUnicodeCharacter{2026}{\dots}
- \DeclareUnicodeCharacter{2039}{\guilsinglleft}
- \DeclareUnicodeCharacter{203A}{\guilsinglright}
- %
- \DeclareUnicodeCharacter{20AC}{\euro}
- %
- \DeclareUnicodeCharacter{2192}{\expansion}
- \DeclareUnicodeCharacter{21D2}{\result}
+ \DeclareUnicodeCharacter{2013}{--}%
+ \DeclareUnicodeCharacter{2014}{---}%
+ \DeclareUnicodeCharacter{2018}{\quoteleft{}}%
+ \DeclareUnicodeCharacter{2019}{\quoteright{}}%
+ \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
+ \DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
+ \DeclareUnicodeCharacter{201D}{\quotedblright{}}%
+ \DeclareUnicodeCharacter{201E}{\quotedblbase{}}%
+ \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
+ \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
+ \DeclareUnicodeCharacter{2022}{\bullet{}}%
+ \DeclareUnicodeCharacter{202F}{\thinspace}%
+ \DeclareUnicodeCharacter{2026}{\dots{}}%
+ \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}%
+ \DeclareUnicodeCharacter{203A}{\guilsinglright{}}%
+ %
+ \DeclareUnicodeCharacter{20AC}{\euro{}}%
+ %
+ \DeclareUnicodeCharacter{2192}{\expansion{}}%
+ \DeclareUnicodeCharacter{21D2}{\result{}}%
%
% Mathematical symbols
- \DeclareUnicodeCharacter{2200}{\ensuremath\forall}
- \DeclareUnicodeCharacter{2203}{\ensuremath\exists}
- \DeclareUnicodeCharacter{2208}{\ensuremath\in}
- \DeclareUnicodeCharacter{2212}{\minus}
- \DeclareUnicodeCharacter{2217}{\ast}
- \DeclareUnicodeCharacter{221E}{\ensuremath\infty}
- \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}
- \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}
- \DeclareUnicodeCharacter{2229}{\ensuremath\cap}
- \DeclareUnicodeCharacter{2261}{\equiv}
- \DeclareUnicodeCharacter{2264}{\ensuremath\leq}
- \DeclareUnicodeCharacter{2265}{\ensuremath\geq}
- \DeclareUnicodeCharacter{2282}{\ensuremath\subset}
- \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}
- %
- \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}
- \DeclareUnicodeCharacter{2032}{\ensuremath\prime}
- \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}
- \DeclareUnicodeCharacter{2111}{\ensuremath\Im}
- \DeclareUnicodeCharacter{2113}{\ensuremath\ell}
- \DeclareUnicodeCharacter{2118}{\ensuremath\wp}
- \DeclareUnicodeCharacter{211C}{\ensuremath\Re}
- \DeclareUnicodeCharacter{2127}{\ensuremath\mho}
- \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}
- \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}
- \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}
- \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}
- \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}
- \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}
- \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}
- \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}
- \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}
- \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}
- \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}
- \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}
- \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}
- \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}
- \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}
- \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}
- \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}
- \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}
- \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}
- \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}
- \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}
- \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}
- \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}
- \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}
- \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}
- \DeclareUnicodeCharacter{2201}{\ensuremath\complement}
- \DeclareUnicodeCharacter{2202}{\ensuremath\partial}
- \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}
- \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}
- \DeclareUnicodeCharacter{2209}{\ensuremath\notin}
- \DeclareUnicodeCharacter{220B}{\ensuremath\owns}
- \DeclareUnicodeCharacter{220F}{\ensuremath\prod}
- \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}
- \DeclareUnicodeCharacter{2211}{\ensuremath\sum}
- \DeclareUnicodeCharacter{2213}{\ensuremath\mp}
- \DeclareUnicodeCharacter{2218}{\ensuremath\circ}
- \DeclareUnicodeCharacter{221A}{\ensuremath\surd}
- \DeclareUnicodeCharacter{221D}{\ensuremath\propto}
- \DeclareUnicodeCharacter{2220}{\ensuremath\angle}
- \DeclareUnicodeCharacter{2223}{\ensuremath\mid}
- \DeclareUnicodeCharacter{2228}{\ensuremath\vee}
- \DeclareUnicodeCharacter{222A}{\ensuremath\cup}
- \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}
- \DeclareUnicodeCharacter{222E}{\ensuremath\oint}
- \DeclareUnicodeCharacter{223C}{\ensuremath\sim}
- \DeclareUnicodeCharacter{2240}{\ensuremath\wr}
- \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}
- \DeclareUnicodeCharacter{2245}{\ensuremath\cong}
- \DeclareUnicodeCharacter{2248}{\ensuremath\approx}
- \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}
- \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}
- \DeclareUnicodeCharacter{2260}{\ensuremath\neq}
- \DeclareUnicodeCharacter{226A}{\ensuremath\ll}
- \DeclareUnicodeCharacter{226B}{\ensuremath\gg}
- \DeclareUnicodeCharacter{227A}{\ensuremath\prec}
- \DeclareUnicodeCharacter{227B}{\ensuremath\succ}
- \DeclareUnicodeCharacter{2283}{\ensuremath\supset}
- \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}
- \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}
- \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}
- \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}
- \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}
- \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}
- \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}
- \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}
- \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}
- \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}
- \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}
- \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}
- \DeclareUnicodeCharacter{2299}{\ensuremath\odot}
- \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}
- \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}
- \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}
- \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}
- \DeclareUnicodeCharacter{22A8}{\ensuremath\models}
- \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}
- \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}
- \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}
- \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}
- \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}
- \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}
- \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}
- \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}
- \DeclareUnicodeCharacter{22C6}{\ensuremath\star}
- \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}
- \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}
- \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}
- \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}
- \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}
- \DeclareUnicodeCharacter{2322}{\ensuremath\frown}
- \DeclareUnicodeCharacter{2323}{\ensuremath\smile}
- %
- \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}
- \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}
- \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}
- \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}
- \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}
- \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}
- \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}
- \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}
- \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}
- \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}
- \DeclareUnicodeCharacter{266D}{\ensuremath\flat}
- \DeclareUnicodeCharacter{266E}{\ensuremath\natural}
- \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}
- \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}
- \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}
- \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}
- \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}
- \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}
- \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}
- \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}
- \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}
- \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}
- \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}
- \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}
- \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}
- \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}
- \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}
- \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}
- \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}
- \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}
- \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}
- %
- \global\mathchardef\checkmark="1370 % actually the square root sign
- \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}
-}% end of \utfeightchardefs
+ \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
+ \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
+ \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
+ \DeclareUnicodeCharacter{2212}{\minus{}}%
+ \DeclareUnicodeCharacter{2217}{\ast}%
+ \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
+ \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
+ \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
+ \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
+ \DeclareUnicodeCharacter{2261}{\equiv{}}%
+ \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
+ \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
+ \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
+ \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
+ %
+ \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
+ \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
+ \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
+ \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
+ \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
+ \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
+ \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
+ \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
+ \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
+ \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
+ \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
+ \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
+ \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
+ \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
+ \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
+ \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
+ \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
+ \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
+ \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
+ \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
+ \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
+ \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
+ \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
+ \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
+ \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
+ \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
+ \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
+ \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
+ \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
+ \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
+ \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
+ \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
+ \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
+ \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
+ \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
+ \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
+ \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
+ \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
+ \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
+ \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
+ \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
+ \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
+ \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
+ \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
+ \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
+ \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
+ \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
+ \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
+ \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
+ \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
+ \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
+ \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
+ \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
+ \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
+ \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
+ \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
+ \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
+ \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
+ \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
+ \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
+ \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
+ \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
+ \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
+ \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
+ \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
+ \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
+ \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
+ \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
+ \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
+ \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
+ \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
+ \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
+ \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
+ \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
+ \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
+ \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
+ \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
+ \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
+ \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
+ \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
+ \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
+ \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
+ \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
+ \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
+ \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
+ \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
+ \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
+ \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
+ \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
+ \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
+ \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
+ %
+ \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
+ \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
+ \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
+ \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
+ \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
+ \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
+ \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
+ \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
+ \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
+ \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
+ \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
+ \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
+ \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
+ \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
+ \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
+ \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
+ \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
+ \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
+ \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
+ \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
+ \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
+ \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
+ \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
+ \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
+ \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
+ \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
+ \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
+ \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
+ \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
+ %
+ \global\mathchardef\checkmark="1370% actually the square root sign
+ \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
+}% end of \unicodechardefs
+
+% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
+% It makes the setting that replace UTF-8 byte sequence.
+\def\utfeightchardefs{%
+ \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
+ \unicodechardefs
+}
-% US-ASCII character definitions.
-\def\asciichardefs{% nothing need be done
- \relax
+% Whether the active definitions of non-ASCII characters expand to
+% non-active tokens with the same character code. This is used to
+% write characters literally, instead of using active definitions for
+% printing the correct glyphs.
+\newif\ifpassthroughchars
+\passthroughcharsfalse
+
+% For native Unicode handling (XeTeX and LuaTeX),
+% provide a definition macro to replace/pass-through a Unicode character
+%
+\def\DeclareUnicodeCharacterNative#1#2{%
+ \catcode"#1=\active
+ \def\dodeclareunicodecharacternative##1##2##3{%
+ \begingroup
+ \uccode`\~="##2\relax
+ \uppercase{\gdef~}{%
+ \ifpassthroughchars
+ ##1%
+ \else
+ ##3%
+ \fi
+ }
+ \endgroup
+ }
+ \begingroup
+ \uccode`\.="#1\relax
+ \uppercase{\def\UTFNativeTmp{.}}%
+ \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
+ \endgroup
}
-% Latin1 (ISO-8859-1) character definitions.
-\def\nonasciistringdefs{%
- \setnonasciicharscatcode\active
- \def\defstringchar##1{\def##1{\string##1}}%
- %
- \defstringchar^^80\defstringchar^^81\defstringchar^^82\defstringchar^^83%
- \defstringchar^^84\defstringchar^^85\defstringchar^^86\defstringchar^^87%
- \defstringchar^^88\defstringchar^^89\defstringchar^^8a\defstringchar^^8b%
- \defstringchar^^8c\defstringchar^^8d\defstringchar^^8e\defstringchar^^8f%
- %
- \defstringchar^^90\defstringchar^^91\defstringchar^^92\defstringchar^^93%
- \defstringchar^^94\defstringchar^^95\defstringchar^^96\defstringchar^^97%
- \defstringchar^^98\defstringchar^^99\defstringchar^^9a\defstringchar^^9b%
- \defstringchar^^9c\defstringchar^^9d\defstringchar^^9e\defstringchar^^9f%
- %
- \defstringchar^^a0\defstringchar^^a1\defstringchar^^a2\defstringchar^^a3%
- \defstringchar^^a4\defstringchar^^a5\defstringchar^^a6\defstringchar^^a7%
- \defstringchar^^a8\defstringchar^^a9\defstringchar^^aa\defstringchar^^ab%
- \defstringchar^^ac\defstringchar^^ad\defstringchar^^ae\defstringchar^^af%
- %
- \defstringchar^^b0\defstringchar^^b1\defstringchar^^b2\defstringchar^^b3%
- \defstringchar^^b4\defstringchar^^b5\defstringchar^^b6\defstringchar^^b7%
- \defstringchar^^b8\defstringchar^^b9\defstringchar^^ba\defstringchar^^bb%
- \defstringchar^^bc\defstringchar^^bd\defstringchar^^be\defstringchar^^bf%
- %
- \defstringchar^^c0\defstringchar^^c1\defstringchar^^c2\defstringchar^^c3%
- \defstringchar^^c4\defstringchar^^c5\defstringchar^^c6\defstringchar^^c7%
- \defstringchar^^c8\defstringchar^^c9\defstringchar^^ca\defstringchar^^cb%
- \defstringchar^^cc\defstringchar^^cd\defstringchar^^ce\defstringchar^^cf%
- %
- \defstringchar^^d0\defstringchar^^d1\defstringchar^^d2\defstringchar^^d3%
- \defstringchar^^d4\defstringchar^^d5\defstringchar^^d6\defstringchar^^d7%
- \defstringchar^^d8\defstringchar^^d9\defstringchar^^da\defstringchar^^db%
- \defstringchar^^dc\defstringchar^^dd\defstringchar^^de\defstringchar^^df%
- %
- \defstringchar^^e0\defstringchar^^e1\defstringchar^^e2\defstringchar^^e3%
- \defstringchar^^e4\defstringchar^^e5\defstringchar^^e6\defstringchar^^e7%
- \defstringchar^^e8\defstringchar^^e9\defstringchar^^ea\defstringchar^^eb%
- \defstringchar^^ec\defstringchar^^ed\defstringchar^^ee\defstringchar^^ef%
- %
- \defstringchar^^f0\defstringchar^^f1\defstringchar^^f2\defstringchar^^f3%
- \defstringchar^^f4\defstringchar^^f5\defstringchar^^f6\defstringchar^^f7%
- \defstringchar^^f8\defstringchar^^f9\defstringchar^^fa\defstringchar^^fb%
- \defstringchar^^fc\defstringchar^^fd\defstringchar^^fe\defstringchar^^ff%
+% Native Unicode handling (XeTeX and LuaTeX) character replacing definition.
+% It activates the setting that replaces Unicode characters.
+\def\nativeunicodechardefs{%
+ \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
+ \unicodechardefs
}
+% For native Unicode handling (XeTeX and LuaTeX),
+% make the character token expand
+% to the sequences given in \unicodechardefs for printing.
+\def\DeclareUnicodeCharacterNativeAtU#1#2{%
+ \def\UTFAtUTmp{#2}
+ \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
+}
+
+% @U command definitions for native Unicode handling (XeTeX and LuaTeX).
+\def\nativeunicodechardefsatu{%
+ \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
+ \unicodechardefs
+}
+
+% US-ASCII character definitions.
+\def\asciichardefs{% nothing need be done
+ \relax
+}
-% define all the unicode characters we know about, for the sake of @U.
-\utfeightchardefs
+% define all Unicode characters we know about, for the sake of @U.
+\iftxinativeunicodecapable
+ \nativeunicodechardefsatu
+\else
+ \utfeightchardefs
+\fi
% Make non-ASCII characters printable again for compatibility with
@@ -10801,12 +11319,12 @@ callback.register("process_output_buffer", convert_line_out)
\advance\vsize by \topskip
\outervsize = \vsize
\advance\outervsize by 2\topandbottommargin
- \pageheight = \vsize
+ \txipageheight = \vsize
%
\hsize = #2\relax
\outerhsize = \hsize
\advance\outerhsize by 0.5in
- \pagewidth = \hsize
+ \txipagewidth = \hsize
%
\normaloffset = #4\relax
\bindingoffset = #5\relax
@@ -10818,6 +11336,14 @@ callback.register("process_output_buffer", convert_line_out)
% whatever layout pdftex was dumped with.
\pdfhorigin = 1 true in
\pdfvorigin = 1 true in
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \special{papersize=#8,#7}%
+ \else
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ % XeTeX does not have \pdfhorigin and \pdfvorigin.
+ \fi
\fi
%
\setleading{\textleading}
@@ -10850,7 +11376,6 @@ callback.register("process_output_buffer", convert_line_out)
%
\lispnarrowing = 0.3in
\tolerance = 700
- \hfuzz = 1pt
\contentsrightmargin = 0pt
\defbodyindent = .5cm
}}
@@ -10868,7 +11393,6 @@ callback.register("process_output_buffer", convert_line_out)
%
\lispnarrowing = 0.25in
\tolerance = 700
- \hfuzz = 1pt
\contentsrightmargin = 0pt
\defbodyindent = .4cm
}}
@@ -10894,7 +11418,6 @@ callback.register("process_output_buffer", convert_line_out)
{297mm}{210mm}%
%
\tolerance = 700
- \hfuzz = 1pt
\contentsrightmargin = 0pt
\defbodyindent = 5mm
}}
@@ -10913,7 +11436,6 @@ callback.register("process_output_buffer", convert_line_out)
%
\lispnarrowing = 0.2in
\tolerance = 800
- \hfuzz = 1.2pt
\contentsrightmargin = 0pt
\defbodyindent = 2mm
\tableindent = 12mm
@@ -10974,9 +11496,11 @@ callback.register("process_output_buffer", convert_line_out)
%
\dimen0 = #1\relax
\advance\dimen0 by \voffset
+ \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page
%
\dimen2 = \hsize
\advance\dimen2 by \normaloffset
+ \advance\dimen2 by 1in % reference point is 1 inch from left edge of page
%
\internalpagesizes{#1}{\hsize}%
{\voffset}{\normaloffset}%
@@ -10988,6 +11512,9 @@ callback.register("process_output_buffer", convert_line_out)
%
\letterpaper
+% Default value of \hfuzz, for suppressing warnings about overfull hboxes.
+\hfuzz = 1pt
+
\message{and turning on texinfo input format.}
@@ -11111,7 +11638,7 @@ callback.register("process_output_buffer", convert_line_out)
%
{@catcode`- = @active
@gdef@normalturnoffactive{%
- @nonasciistringdefs
+ @passthroughcharstrue
@let-=@normaldash
@let"=@normaldoublequote
@let$=@normaldollar %$ font-lock fix
@@ -11149,9 +11676,13 @@ callback.register("process_output_buffer", convert_line_out)
@global@let\ = @eatinput%
@catcode`@^^M=13%
@def@c{@fixbackslash@c}%
+ % Definition for the newline at the end of this file.
@def ^^M{@let^^M@secondlinenl}%
- @gdef @secondlinenl{@let^^M@thirdlinenl}%
- @gdef @thirdlinenl{@fixbackslash}%
+ % Definition for a newline in the main Texinfo file.
+ @gdef @secondlinenl{@fixbackslash}%
+ % In case the first line has a whole-line command on it
+ @let@originalparsearg@parsearg
+ @def@parsearg{@fixbackslash@originalparsearg}
}}
{@catcode`@^=7 @catcode`@^^M=13%
@@ -11172,6 +11703,7 @@ callback.register("process_output_buffer", convert_line_out)
@catcode13=5 % regular end of line
@enableemergencynewline
@let@c=@texinfoc
+ @let@parsearg@originalparsearg
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
@catcode`+=@active
@@ -11216,7 +11748,7 @@ callback.register("process_output_buffer", convert_line_out)
@markupsetuprqdefault
@c Local variables:
-@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c eval: (add-hook 'before-save-hook 'time-stamp)
@c page-delimiter: "^\\\\message\\|emacs-page"
@c time-stamp-start: "def\\\\texinfoversion{"
@c time-stamp-format: "%:y-%02m-%02d.%02H"
@@ -11225,7 +11757,4 @@ callback.register("process_output_buffer", convert_line_out)
@c vim:sw=2:
-@ignore
- arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
-@end ignore
@enablebackslashhack
diff --git a/extension/ChangeLog b/extension/ChangeLog
index f65df4de..b0def543 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -47,6 +47,10 @@
* intdiv.c (do_intdiv): Print a warning about loss of precision if
MPFR arguments are received when not compiled with MPFR support.
+2018-02-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.3am: Fix some typos.
+
2018-02-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
* configure.ac (pkgextensiondir): This must be set to
@@ -62,6 +66,13 @@
revtwoway.3am, rwarray.3am, time.3am: Add vim modeline at the
bottom to set the file type for syntax coloring.
+2018-02-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (FTS_SKIP): New constant.
+ (process): Additional arg skipset. When true (based on if
+ FTS_SKIP was passed) and at level 0, use fts_set to set
+ FTS_SKIP on the directory.
+
2018-01-11 Arnold D. Robbins <arnold@skeeve.com>
* compile, config.guess, config.rpath, config.sub,
diff --git a/extension/filefuncs.3am b/extension/filefuncs.3am
index 36acf649..571fdea9 100644
--- a/extension/filefuncs.3am
+++ b/extension/filefuncs.3am
@@ -230,6 +230,9 @@ This option causes entries for ``..'' to also be included.
.TP
.B FTS_XDEV
During a traversal, do not cross onto a different mounted filesystem.
+.TP
+.B FTS_SKIP
+When set, causes top level directories to not be descended into.
.RE
.TP
.B filedata
@@ -321,6 +324,10 @@ the changed values are passed to
.SH BUGS
There are many more file-related functions for which AWK
interfaces would be desirable.
+.PP
+It's not clear why I thought adding
+.B FTS_SKIP
+was a good idea.
.SH EXAMPLE
See
.B test/fts.awk
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index 1cf37453..1ea25dbc 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -575,6 +575,7 @@ init_filefuncs(void)
ENTRY(FTS_PHYSICAL),
ENTRY(FTS_SEEDOT),
ENTRY(FTS_XDEV),
+ ENTRY(FTS_SKIP),
{ NULL, 0 }
};
@@ -690,7 +691,7 @@ fill_default_elements(awk_array_t element_array, const FTSENT *const fentry, awk
/* process --- process the hierarchy */
static void
-process(FTS *hierarchy, awk_array_t destarray, int seedot)
+process(FTS *hierarchy, awk_array_t destarray, int seedot, int skipset)
{
FTSENT *fentry;
awk_value_t index, value;
@@ -705,7 +706,12 @@ process(FTS *hierarchy, awk_array_t destarray, int seedot)
switch (fentry->fts_info) {
case FTS_D:
/* directory */
+
+ if (skipset && fentry->fts_level == 0)
+ fts_set(hierarchy, fentry, FTS_SKIP);
+
/* create array to hold entries */
+ /* this will be empty if doing FTS_SKIP */
newdir_array = create_array();
if (newdir_array == NULL) {
warning(ext_id, _("fts-process: could not create array"));
@@ -826,7 +832,7 @@ do_fts(int nargs, awk_value_t *result, struct awk_ext_func *unused)
int ret = -1;
static const int mask = (
FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOCHDIR | FTS_PHYSICAL
- | FTS_SEEDOT | FTS_XDEV);
+ | FTS_SEEDOT | FTS_XDEV | FTS_SKIP);
assert(result != NULL);
fts_errors = 0; /* ensure a fresh start */
@@ -894,7 +900,7 @@ do_fts(int nargs, awk_value_t *result, struct awk_ext_func *unused)
/* let's do it! */
if ((hierarchy = fts_open(pathvector, flags, NULL)) != NULL) {
- process(hierarchy, dest.array_cookie, (flags & FTS_SEEDOT) != 0);
+ process(hierarchy, dest.array_cookie, (flags & FTS_SEEDOT) != 0, (flags & FTS_SKIP) != 0);
fts_close(hierarchy);
if (fts_errors == 0)
diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog
index a5838ccc..f4e02638 100644
--- a/missing_d/ChangeLog
+++ b/missing_d/ChangeLog
@@ -14,6 +14,10 @@
* 4.2.0: Release tar ball made.
+2017-10-13 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkbool.h: Removed.
+
2017-10-08 Arnold D. Robbins <arnold@skeeve.com>
* strncasecmp.c: Fix FSF's address.
diff --git a/missing_d/gawkbool.h b/missing_d/gawkbool.h
deleted file mode 100644
index c75a5a10..00000000
--- a/missing_d/gawkbool.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * gawkbool.h -- replacement definitions for bool.
- */
-
-/*
- * Copyright (C) 2012 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-/* This stuff largely taken from the Autoconf doc. */
-
-#ifndef __bool_true_false_are_defined
-# ifndef HAVE__BOOL
-# ifdef __cplusplus
-typedef bool _Bool;
-# else
-# define _Bool signed char
-# endif
-# endif
-# define bool _Bool
-# define false 0
-# define true 1
-# define __bool_true_false_are_defined 1
-#endif
diff --git a/pc/config.h b/pc/config.h
index 62c13f22..e2a388a4 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -462,7 +462,7 @@
#define PACKAGE_NAME "GNU Awk"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "GNU Awk 4.2.1a"
+#define PACKAGE_STRING "GNU Awk 4.2.60"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gawk"
@@ -471,7 +471,7 @@
#define PACKAGE_URL "http://www.gnu.org/software/gawk/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.2.1a"
+#define PACKAGE_VERSION "4.2.60"
/* Define to 1 if *printf supports %a format */
#define PRINTF_HAS_A_FORMAT 1
@@ -531,7 +531,7 @@
/* Version number of package */
-#define VERSION "4.2.1a"
+#define VERSION "4.2.60"
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
diff --git a/support/ChangeLog b/support/ChangeLog
index e2168aea..68d10092 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -55,6 +55,8 @@
* intprops.h: Sync with GNULIB.
* regcomp.c (init_word): Move general_case label inside ifdef.
* regex.h: Don't define __USE_GNU. Brings closer to GLIBC regex.
+ * regex.c: Don't include gawkbool.h, we don't use it anymore.
+ * dfa.h: Ditto.
2017-11-26 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/support/dfa.h b/support/dfa.h
index 7d11f05d..79ada1e2 100644
--- a/support/dfa.h
+++ b/support/dfa.h
@@ -19,11 +19,7 @@
/* Written June, 1988 by Mike Haertel */
#include <regex.h>
-#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
-#else
-#include "missing_d/gawkbool.h"
-#endif /* HAVE_STDBOOL_H */
#include <stddef.h>
#if 3 <= __GNUC__
diff --git a/support/regex.c b/support/regex.c
index d3a44851..dc8caf69 100644
--- a/support/regex.c
+++ b/support/regex.c
@@ -69,9 +69,6 @@
#include "regex_internal.h"
#include "regex_internal.c"
-#ifndef HAVE_STDBOOL_H
-#include "missing_d/gawkbool.h"
-#endif
#include "regcomp.c"
#include "regexec.c"