Changeset 055e668 in rtems
- Timestamp:
- 12/13/11 04:59:22 (12 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 6649644
- Parents:
- c444d1e
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rc444d1e r055e668 1 2011-12-13 Ralf Corsépius <ralf.corsepius@rtems.org> 2 3 * compile, depcomp, mdate-sh, texinfo.tex: 4 Update from automake-1.11.1b. 5 1 6 2011-11-09 Joel Sherrill <joel.sherrill@oarcorp.com> 2 7 -
compile
rc444d1e r055e668 2 2 # Wrapper for compilers which do not understand `-c -o'. 3 3 4 scriptversion=20 09-10-06.20; # UTC5 6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 4 scriptversion=2010-11-15.09; # UTC 5 6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software 7 7 # Foundation, Inc. 8 8 # Written by Tom Tromey <tromey@cygnus.com>. … … 30 30 # <automake-patches@gnu.org>. 31 31 32 nl=' 33 ' 34 35 # We need space, tab and new line, in precisely that order. Quoting is 36 # there to prevent tools from complaining about whitespace usage. 37 IFS=" "" $nl" 38 39 file_conv= 40 41 # func_file_conv build_file lazy 42 # Convert a $build file to $host form and store it in $file 43 # Currently only supports Win32 hosts. If the determined conversion 44 # type is listed in (the comma separated) LAZY, no conversion will 45 # take place. 46 func_file_conv () 47 { 48 file=$1 49 case $file in 50 / | /[!/]*) # absolute file, and not a UNC file 51 if test -z "$file_conv"; then 52 # lazily determine how to convert abs files 53 case `uname -s` in 54 MINGW*) 55 file_conv=mingw 56 ;; 57 CYGWIN*) 58 file_conv=cygwin 59 ;; 60 *) 61 file_conv=wine 62 ;; 63 esac 64 fi 65 case $file_conv/,$2, in 66 *,$file_conv,*) 67 ;; 68 mingw/*) 69 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 70 ;; 71 cygwin/*) 72 file=`cygpath -m "$file" || echo "$file"` 73 ;; 74 wine/*) 75 file=`winepath -w "$file" || echo "$file"` 76 ;; 77 esac 78 ;; 79 esac 80 } 81 82 # func_cl_wrapper cl arg... 83 # Adjust compile command to suit cl 84 func_cl_wrapper () 85 { 86 # Assume a capable shell 87 lib_path= 88 shared=: 89 linker_opts= 90 for arg 91 do 92 if test -n "$eat"; then 93 eat= 94 else 95 case $1 in 96 -o) 97 # configure might choose to run compile as `compile cc -o foo foo.c'. 98 eat=1 99 case $2 in 100 *.o | *.[oO][bB][jJ]) 101 func_file_conv "$2" 102 set x "$@" -Fo"$file" 103 shift 104 ;; 105 *) 106 func_file_conv "$2" 107 set x "$@" -Fe"$file" 108 shift 109 ;; 110 esac 111 ;; 112 -I*) 113 func_file_conv "${1#-I}" mingw 114 set x "$@" -I"$file" 115 shift 116 ;; 117 -l*) 118 lib=${1#-l} 119 found=no 120 save_IFS=$IFS 121 IFS=';' 122 for dir in $lib_path $LIB 123 do 124 IFS=$save_IFS 125 if $shared && test -f "$dir/$lib.dll.lib"; then 126 found=yes 127 set x "$@" "$dir/$lib.dll.lib" 128 break 129 fi 130 if test -f "$dir/$lib.lib"; then 131 found=yes 132 set x "$@" "$dir/$lib.lib" 133 break 134 fi 135 done 136 IFS=$save_IFS 137 138 test "$found" != yes && set x "$@" "$lib.lib" 139 shift 140 ;; 141 -L*) 142 func_file_conv "${1#-L}" 143 if test -z "$lib_path"; then 144 lib_path=$file 145 else 146 lib_path="$lib_path;$file" 147 fi 148 linker_opts="$linker_opts -LIBPATH:$file" 149 ;; 150 -static) 151 shared=false 152 ;; 153 -Wl,*) 154 arg=${1#-Wl,} 155 save_ifs="$IFS"; IFS=',' 156 for flag in $arg; do 157 IFS="$save_ifs" 158 linker_opts="$linker_opts $flag" 159 done 160 IFS="$save_ifs" 161 ;; 162 -Xlinker) 163 eat=1 164 linker_opts="$linker_opts $2" 165 ;; 166 -*) 167 set x "$@" "$1" 168 shift 169 ;; 170 *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) 171 func_file_conv "$1" 172 set x "$@" -Tp"$file" 173 shift 174 ;; 175 *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) 176 func_file_conv "$1" mingw 177 set x "$@" "$file" 178 shift 179 ;; 180 *) 181 set x "$@" "$1" 182 shift 183 ;; 184 esac 185 fi 186 shift 187 done 188 if test -n "$linker_opts"; then 189 linker_opts="-link$linker_opts" 190 fi 191 exec "$@" $linker_opts 192 exit 1 193 } 194 195 eat= 196 32 197 case $1 in 33 198 '') … … 54 219 exit $? 55 220 ;; 221 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 222 func_cl_wrapper "$@" # Doesn't return... 223 ;; 56 224 esac 57 225 58 226 ofile= 59 227 cfile= 60 eat=61 228 62 229 for arg -
depcomp
rc444d1e r055e668 2 2 # depcomp - compile a program generating dependencies as side-effects 3 3 4 scriptversion=20 09-04-28.21; # UTC5 6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free7 # Software Foundation, Inc.4 scriptversion=2011-12-04.11; # UTC 5 6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 7 # 2011 Free Software Foundation, Inc. 8 8 9 9 # This program is free software; you can redistribute it and/or modify … … 45 45 DEPDIR directory where to store dependencies. 46 46 depfile Dependency file to output. 47 tmpdepfile Temporary file to use when output ing dependencies.47 tmpdepfile Temporary file to use when outputting dependencies. 48 48 libtool Whether libtool is used (yes/no). 49 49 … … 91 91 # Just convert the backslash-escaped backslashes to single forward 92 92 # slashes to satisfy depend.m4 93 cygpath_u= "sed s,\\\\\\\\,/,g"93 cygpath_u='sed s,\\\\,/,g' 94 94 depmode=msvisualcpp 95 fi 96 97 if test "$depmode" = msvc7msys; then 98 # This is just like msvc7 but w/o cygpath translation. 99 # Just convert the backslash-escaped backslashes to single forward 100 # slashes to satisfy depend.m4 101 cygpath_u='sed s,\\\\,/,g' 102 depmode=msvc7 95 103 fi 96 104 … … 159 167 ## Some versions of gcc put a space before the `:'. On the theory 160 168 ## that the space means something, we add a space to the output as 161 ## well. 169 ## well. hp depmode also adds that space, but also prefixes the VPATH 170 ## to the object. Take care to not repeat it in the output. 162 171 ## Some versions of the HPUX 10.20 sed can't process this invocation 163 172 ## correctly. Breaking it into two sed invocations is a workaround. 164 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 173 sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ 174 | sed -e 's/$/ :/' >> "$depfile" 165 175 rm -f "$tmpdepfile" 166 176 ;; … … 406 416 ;; 407 417 418 msvc7) 419 if test "$libtool" = yes; then 420 showIncludes=-Wc,-showIncludes 421 else 422 showIncludes=-showIncludes 423 fi 424 "$@" $showIncludes > "$tmpdepfile" 425 stat=$? 426 grep -v '^Note: including file: ' "$tmpdepfile" 427 if test "$stat" = 0; then : 428 else 429 rm -f "$tmpdepfile" 430 exit $stat 431 fi 432 rm -f "$depfile" 433 echo "$object : \\" > "$depfile" 434 # The first sed program below extracts the file names and escapes 435 # backslashes for cygpath. The second sed program outputs the file 436 # name when reading, but also accumulates all include files in the 437 # hold buffer in order to output them again at the end. This only 438 # works with sed implementations that can handle large buffers. 439 sed < "$tmpdepfile" -n ' 440 /^Note: including file: *\(.*\)/ { 441 s//\1/ 442 s/\\/\\\\/g 443 p 444 }' | $cygpath_u | sort -u | sed -n ' 445 s/ /\\ /g 446 s/\(.*\)/ \1 \\/p 447 s/.\(.*\) \\/\1:/ 448 H 449 $ { 450 s/.*/ / 451 G 452 p 453 }' >> "$depfile" 454 rm -f "$tmpdepfile" 455 ;; 456 457 msvc7msys) 458 # This case exists only to let depend.m4 do its work. It works by 459 # looking at the text of this script. This case will never be run, 460 # since it is checked for above. 461 exit 1 462 ;; 463 408 464 #nosideeffect) 409 465 # This comment above is used by automake to tell side-effect … … 504 560 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 505 561 rm -f "$depfile" 506 cat < "$tmpdepfile" > "$depfile" 562 # makedepend may prepend the VPATH from the source file name to the object. 563 # No need to regex-escape $object, excess matching of '.' is harmless. 564 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" 507 565 sed '1,2d' "$tmpdepfile" | tr ' ' ' 508 566 ' | \ -
mdate-sh
rc444d1e r055e668 2 2 # Get modification time of a file or directory and pretty-print it. 3 3 4 scriptversion=20 09-04-28.21; # UTC5 6 # Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009 Free7 # Software Foundation, Inc.4 scriptversion=2010-08-21.06; # UTC 5 6 # Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009, 2010 7 # Free Software Foundation, Inc. 8 8 # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995 9 9 # … … 29 29 # bugs to <bug-automake@gnu.org> or send patches to 30 30 # <automake-patches@gnu.org>. 31 32 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 33 emulate sh 34 NULLCMD=: 35 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which 36 # is contrary to our usage. Disable this feature. 37 alias -g '${1+"$@"}'='"$@"' 38 setopt NO_GLOB_SUBST 39 fi 31 40 32 41 case $1 in … … 39 48 Usage: mdate-sh [--help] [--version] FILE 40 49 41 Pretty-print the modification time of FILE. 50 Pretty-print the modification day of FILE, in the format: 51 1 January 1970 42 52 43 53 Report bugs to <bug-automake@gnu.org>. … … 51 61 esac 52 62 63 error () 64 { 65 echo "$0: $1" >&2 66 exit 1 67 } 68 69 53 70 # Prevent date giving response in another language. 54 71 LANG=C … … 100 117 until test $month 101 118 do 119 test $# -gt 0 || error "failed parsing \`$ls_command /' output" 102 120 shift 103 121 # Add another shift to the command. … … 119 137 done 120 138 139 test -n "$month" || error "failed parsing \`$ls_command /' output" 140 121 141 # Get the extended ls output of the file or directory. 122 set dummy x`eval "$ls_command \"\ $save_arg1\""`142 set dummy x`eval "$ls_command \"\\\$save_arg1\""` 123 143 124 144 # Remove all preceding arguments -
texinfo.tex
rc444d1e r055e668 4 4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 5 5 % 6 \def\texinfoversion{20 09-08-14.15}6 \def\texinfoversion{2011-11-09.15} 7 7 % 8 8 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 9 9 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 10 % 2007, 2008, 2009 Free Software Foundation, Inc.10 % 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 11 11 % 12 12 % This texinfo.tex file is free software: you can redistribute it and/or … … 65 65 \everyjob{\message{[Texinfo version \texinfoversion]}% 66 66 \catcode`+=\active \catcode`\_=\active} 67 68 67 69 68 \chardef\other=12 … … 94 93 \let\ptexnoindent=\noindent 95 94 \let\ptexplus=+ 95 \let\ptexraggedright=\raggedright 96 96 \let\ptexrbrace=\} 97 97 \let\ptexslash=\/ … … 99 99 \let\ptext=\t 100 100 \let\ptextop=\top 101 {\catcode`\'=\active 102 \global\let\ptexquoteright'}% Math-mode def from plain.tex. 103 \let\ptexraggedright=\raggedright 101 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode 104 102 105 103 % If this character appears in an error message or help string, it … … 119 117 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi 120 118 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi 119 \ifx\putworderror\undefined \gdef\putworderror{error}\fi 121 120 \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi 122 121 \ifx\putwordin\undefined \gdef\putwordin{in}\fi 123 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi124 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi122 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi 123 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi 125 124 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi 126 125 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi … … 161 160 162 161 % sometimes characters are active, so we need control sequences. 162 \chardef\ampChar = `\& 163 163 \chardef\colonChar = `\: 164 164 \chardef\commaChar = `\, … … 166 166 \chardef\dotChar = `\. 167 167 \chardef\exclamChar= `\! 168 \chardef\hashChar = `\# 168 169 \chardef\lquoteChar= `\` 169 170 \chardef\questChar = `\? 170 171 \chardef\rquoteChar= `\' 171 172 \chardef\semiChar = `\; 173 \chardef\slashChar = `\/ 172 174 \chardef\underChar = `\_ 173 175 … … 200 202 % that the text looks ok even though it passes the margin). 201 203 % 202 \def\finalout{\overfullrule=0pt} 203 204 % @| inserts a changebar to the left of the current line. It should 205 % surround any changed text. This approach does *not* work if the 206 % change spans more than two lines of output. To handle that, we would 207 % have adopt a much more difficult approach (putting marks into the main 208 % vertical list for the beginning and end of each change). 209 % 210 \def\|{% 211 % \vadjust can only be used in horizontal mode. 212 \leavevmode 213 % 214 % Append this vertical mode material after the current line in the output. 215 \vadjust{% 216 % We want to insert a rule with the height and depth of the current 217 % leading; that is exactly what \strutbox is supposed to record. 218 \vskip-\baselineskip 219 % 220 % \vadjust-items are inserted at the left edge of the type. So 221 % the \llap here moves out into the left-hand margin. 222 \llap{% 223 % 224 % For a thicker or thinner bar, change the `1pt'. 225 \vrule height\baselineskip width1pt 226 % 227 % This is the space between the bar and the text. 228 \hskip 12pt 229 }% 230 }% 231 } 204 \def\finalout{\overfullrule=0pt } 232 205 233 206 % Sometimes it is convenient to have everything in the transcript file … … 247 220 \tracingrestores1 248 221 \showboxbreadth\maxdimen \showboxdepth\maxdimen 249 \ifx\eTeXversion\ undefined\else % etex gives us more logging222 \ifx\eTeXversion\thisisundefined\else % etex gives us more logging 250 223 \tracingscantokens1 251 224 \tracingifs1 … … 268 241 \removelastskip\penalty-200\bigskip\fi\fi} 269 242 270 % For @cropmarks command.271 243 % Do @cropmarks to get crop marks. 272 244 % … … 578 550 \def\inenvironment#1{% 579 551 \ifx#1\empty 580 out of any environment%552 outside of any environment% 581 553 \else 582 554 in environment \expandafter\string#1% … … 590 562 \if 1\csname iscond.#1\endcsname 591 563 \else 592 % The general wording of \badenverr may not be ideal , but... --kasal, 06nov03564 % The general wording of \badenverr may not be ideal. 593 565 \expandafter\checkenv\csname#1\endcsname 594 566 \csname E#1\endcsname … … 599 571 \newhelp\EMsimple{Press RETURN to continue.} 600 572 601 602 %% Simple single-character @ commands603 604 % @@ prints an @605 % Kludge this until the fonts are right (grr).606 \def\@{{\tt\char64}}607 608 % This is turned off because it was never documented609 % and you can use @w{...} around a quote to suppress ligatures.610 %% Define @` and @' to be the same as ` and '611 %% but suppressing ligatures.612 %\def\`{{`}}613 %\def\'{{'}}614 615 % Used to generate quoted braces.616 \def\mylbrace {{\tt\char123}}617 \def\myrbrace {{\tt\char125}}618 \let\{=\mylbrace619 \let\}=\myrbrace620 \begingroup621 % Definitions to produce \{ and \} commands for indices,622 % and @{ and @} for the aux/toc files.623 \catcode`\{ = \other \catcode`\} = \other624 \catcode`\[ = 1 \catcode`\] = 2625 \catcode`\! = 0 \catcode`\\ = \other626 !gdef!lbracecmd[\{]%627 !gdef!rbracecmd[\}]%628 !gdef!lbraceatcmd[@{]%629 !gdef!rbraceatcmd[@}]%630 !endgroup631 632 % @comma{} to avoid , parsing problems.633 \let\comma = ,634 635 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent636 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.637 \let\, = \c638 \let\dotaccent = \.639 \def\ringaccent#1{{\accent23 #1}}640 \let\tieaccent = \t641 \let\ubaraccent = \b642 \let\udotaccent = \d643 644 % Other special characters: @questiondown @exclamdown @ordf @ordm645 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.646 \def\questiondown{?`}647 \def\exclamdown{!`}648 \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}649 \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}650 651 % Dotless i and dotless j, used for accents.652 \def\imacro{i}653 \def\jmacro{j}654 \def\dotless#1{%655 \def\temp{#1}%656 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi657 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi658 \else \errmessage{@dotless can be used only with i or j}%659 \fi\fi660 }661 662 % The \TeX{} logo, as in plain, but resetting the spacing so that a663 % period following counts as ending a sentence. (Idea found in latex.)664 %665 \edef\TeX{\TeX \spacefactor=1000 }666 667 % @LaTeX{} logo. Not quite the same results as the definition in668 % latex.ltx, since we use a different font for the raised A; it's most669 % convenient for us to use an explicitly smaller font, rather than using670 % the \scriptstyle font (since we don't reset \scriptstyle and671 % \scriptscriptstyle).672 %673 \def\LaTeX{%674 L\kern-.36em675 {\setbox0=\hbox{T}%676 \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%677 \kern-.15em678 \TeX679 }680 573 681 574 % Be sure we're in horizontal mode when doing a tie, since we make space … … 720 613 \else 721 614 \errhelp = \EMsimple 722 \errmessage{Unknown @frenchspacing option `\temp', must be on /off}%615 \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% 723 616 \fi\fi 724 617 } … … 801 694 802 695 \newdimen\mil \mil=0.001in 803 804 % Old definition--didn't work.805 %\parseargdef\need{\par %806 %% This method tries to make TeX break the page naturally807 %% if the depth of the box does not fit.808 %{\baselineskip=0pt%809 %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak810 %\prevdepth=-1000pt811 %}}812 696 813 697 \parseargdef\need{% … … 874 758 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current 875 759 % paragraph. For more general purposes, use the \margin insertion 876 % class. WHICH is `l' or `r'. 760 % class. WHICH is `l' or `r'. Not documented, written for gawk manual. 877 761 % 878 762 \newskip\inmarginspacing \inmarginspacing=1cm … … 921 805 } 922 806 807 % @| inserts a changebar to the left of the current line. It should 808 % surround any changed text. This approach does *not* work if the 809 % change spans more than two lines of output. To handle that, we would 810 % have adopt a much more difficult approach (putting marks into the main 811 % vertical list for the beginning and end of each change). This command 812 % is not documented, not supported, and doesn't work. 813 % 814 \def\|{% 815 % \vadjust can only be used in horizontal mode. 816 \leavevmode 817 % 818 % Append this vertical mode material after the current line in the output. 819 \vadjust{% 820 % We want to insert a rule with the height and depth of the current 821 % leading; that is exactly what \strutbox is supposed to record. 822 \vskip-\baselineskip 823 % 824 % \vadjust-items are inserted at the left edge of the type. So 825 % the \llap here moves out into the left-hand margin. 826 \llap{% 827 % 828 % For a thicker or thinner bar, change the `1pt'. 829 \vrule height\baselineskip width1pt 830 % 831 % This is the space between the bar and the text. 832 \hskip 12pt 833 }% 834 }% 835 } 836 923 837 % @include FILE -- \input text of FILE. 924 838 % … … 931 845 \turnoffactive % and allow special characters in the expansion 932 846 \indexnofonts % Allow `@@' and other weird things in file names. 847 \wlog{texinfo.tex: doing @include of #1^^J}% 933 848 \edef\temp{\noexpand\input #1 }% 934 849 % … … 1095 1010 } 1096 1011 1097 1098 % @asis just yields its argument. Used with @table, for example.1099 %1100 \def\asis#1{#1}1101 1102 % @math outputs its argument in math mode.1103 %1104 % One complication: _ usually means subscripts, but it could also mean1105 % an actual _ character, as in @math{@var{some_variable} + 1}. So make1106 % _ active, and distinguish by seeing if the current family is \slfam,1107 % which is what @var uses.1108 {1109 \catcode`\_ = \active1110 \gdef\mathunderscore{%1111 \catcode`\_=\active1112 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%1113 }1114 }1115 % Another complication: we want \\ (and @\) to output a \ character.1116 % FYI, plain.tex uses \\ as a temporary control sequence (why?), but1117 % this is not advertised and we don't care. Texinfo does not1118 % otherwise define @\.1119 %1120 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.1121 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}1122 %1123 \def\math{%1124 \tex1125 \mathunderscore1126 \let\\ = \mathbackslash1127 \mathactive1128 % make the texinfo accent commands work in math mode1129 \let\"=\ddot1130 \let\'=\acute1131 \let\==\bar1132 \let\^=\hat1133 \let\`=\grave1134 \let\u=\breve1135 \let\v=\check1136 \let\~=\tilde1137 \let\dotaccent=\dot1138 $\finishmath1139 }1140 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.1141 1142 % Some active characters (such as <) are spaced differently in math.1143 % We have to reset their definitions in case the @math was an argument1144 % to a command which sets the catcodes (such as @item or @section).1145 %1146 {1147 \catcode`^ = \active1148 \catcode`< = \active1149 \catcode`> = \active1150 \catcode`+ = \active1151 \catcode`' = \active1152 \gdef\mathactive{%1153 \let^ = \ptexhat1154 \let< = \ptexless1155 \let> = \ptexgtr1156 \let+ = \ptexplus1157 \let' = \ptexquoteright1158 }1159 }1160 1161 % Some math mode symbols.1162 \def\bullet{$\ptexbullet$}1163 \def\geq{\ifmmode \ge\else $\ge$\fi}1164 \def\leq{\ifmmode \le\else $\le$\fi}1165 \def\minus{\ifmmode -\else $-$\fi}1166 1167 % @dots{} outputs an ellipsis using the current font.1168 % We do .5em per period so that it has the same spacing in the cm1169 % typewriter fonts as three actual period characters; on the other hand,1170 % in other typewriter fonts three periods are wider than 1.5em. So do1171 % whichever is larger.1172 %1173 \def\dots{%1174 \leavevmode1175 \setbox0=\hbox{...}% get width of three periods1176 \ifdim\wd0 > 1.5em1177 \dimen0 = \wd01178 \else1179 \dimen0 = 1.5em1180 \fi1181 \hbox to \dimen0{%1182 \hskip 0pt plus.25fil1183 .\hskip 0pt plus1fil1184 .\hskip 0pt plus1fil1185 .\hskip 0pt plus.5fil1186 }%1187 }1188 1189 % @enddots{} is an end-of-sentence ellipsis.1190 %1191 \def\enddots{%1192 \dots1193 \spacefactor=\endofsentencespacefactor1194 }1195 1196 % @comma{} is so commas can be inserted into text without messing up1197 % Texinfo's parsing.1198 %1199 \let\comma = ,1200 1012 1201 1013 % @refill is a no-op. … … 1263 1075 1264 1076 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 1265 % can be set). So we test for \relax and 0 as well as \undefined, 1266 % borrowed from ifpdf.sty. 1267 \ifx\pdfoutput\undefined 1077 % can be set). So we test for \relax and 0 as well as being undefined. 1078 \ifx\pdfoutput\thisisundefined 1268 1079 \else 1269 1080 \ifx\pdfoutput\relax … … 1385 1196 \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% 1386 1197 % 1387 % pdftex (and the PDF format) support .png, .jpg, .pdf (among 1388 % others). Let's try in that order. 1198 % pdftex (and the PDF format) support .pdf, .png, .jpg (among 1199 % others). Let's try in that order, PDF first since if 1200 % someone has a scalable image, presumably better to use that than a 1201 % bitmap. 1389 1202 \let\pdfimgext=\empty 1390 1203 \begingroup 1391 \openin 1 #1.p ng\ifeof 11392 \openin 1 #1. jpg\ifeof 11393 \openin 1 #1. jpeg \ifeof 11394 \openin 1 #1. JPG\ifeof 11395 \openin 1 #1. pdf\ifeof 11396 \openin 1 #1. PDF\ifeof 11204 \openin 1 #1.pdf \ifeof 1 1205 \openin 1 #1.PDF \ifeof 1 1206 \openin 1 #1.png \ifeof 1 1207 \openin 1 #1.jpg \ifeof 1 1208 \openin 1 #1.jpeg \ifeof 1 1209 \openin 1 #1.JPG \ifeof 1 1397 1210 \errhelp = \nopdfimagehelp 1398 1211 \errmessage{Could not find image file #1 for pdf}% 1399 \else \gdef\pdfimgext{ PDF}%1212 \else \gdef\pdfimgext{JPG}% 1400 1213 \fi 1401 \else \gdef\pdfimgext{ pdf}%1214 \else \gdef\pdfimgext{jpeg}% 1402 1215 \fi 1403 \else \gdef\pdfimgext{ JPG}%1216 \else \gdef\pdfimgext{jpg}% 1404 1217 \fi 1405 \else \gdef\pdfimgext{ jpeg}%1218 \else \gdef\pdfimgext{png}% 1406 1219 \fi 1407 \else \gdef\pdfimgext{ jpg}%1220 \else \gdef\pdfimgext{PDF}% 1408 1221 \fi 1409 \else \gdef\pdfimgext{p ng}%1222 \else \gdef\pdfimgext{pdf}% 1410 1223 \fi 1411 1224 \closein 1 … … 1493 1306 % 1494 1307 % Read toc silently, to get counts of subentries for \pdfoutline. 1308 \def\partentry##1##2##3##4{}% ignore parts in the outlines 1495 1309 \def\numchapentry##1##2##3##4{% 1496 1310 \def\thischapnum{##2}% … … 1696 1510 % (\pdffontattr was introduced many years ago, but people still run 1697 1511 % older pdftex's; it's easy to conditionalize, so we do.) 1698 \ifpdf \ifx\pdffontattr\ undefined \else1512 \ifpdf \ifx\pdffontattr\thisisundefined \else 1699 1513 \begingroup 1700 1514 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. … … 1963 1777 % To specify the font prefix, you must define \fontprefix 1964 1778 % before you read in texinfo.tex. 1965 \ifx\fontprefix\ undefined1779 \ifx\fontprefix\thisisundefined 1966 1780 \def\fontprefix{cm} 1967 1781 \fi … … 2106 1920 \def\reducedecsize{1000} 2107 1921 2108 % reset the current fonts 2109 \textfonts 1922 \textleading = 13.2pt % line spacing for 11pt CM 1923 \textfonts % reset the current fonts 2110 1924 \rm 2111 1925 } % end of 11pt text font size definitions … … 2237 2051 \def\reducedecsize{0900} 2238 2052 2239 % reduce space between paragraphs 2240 \divide\parskip by 2 2241 2242 % reset the current fonts 2243 \textfonts 2053 \divide\parskip by 2 % reduce space between paragraphs 2054 \textleading = 12pt % line spacing for 10pt CM 2055 \textfonts % reset the current fonts 2244 2056 \rm 2245 2057 } % end of 10pt text font size definitions … … 2250 2062 % (or 11) to redefine the text font size. pt is assumed. 2251 2063 % 2064 \def\xiword{11} 2252 2065 \def\xword{10} 2253 \def\x iword{11}2066 \def\xwordpt{10pt} 2254 2067 % 2255 2068 \parseargdef\fonttextsize{% 2256 2069 \def\textsizearg{#1}% 2257 \wlog{doing @fonttextsize \textsizearg}%2070 %\wlog{doing @fonttextsize \textsizearg}% 2258 2071 % 2259 2072 % Set \globaldefs so that documents can use this inside @tex, since … … 2309 2122 \def\curfontsize{title}% 2310 2123 \def\lsize{chap}\def\lllsize{subsec}% 2311 \resetmathfonts \setleading{2 5pt}}2124 \resetmathfonts \setleading{27pt}} 2312 2125 \def\titlefont#1{{\titlefonts\rmisbold #1}} 2313 2126 \def\chapfonts{% … … 2437 2250 % Markup style setup for left and right quotes. 2438 2251 \defmarkupstylesetup\markupsetuplq{% 2439 \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname 2252 \expandafter\let\expandafter \temp 2253 \csname markupsetuplq\currentmarkupstyle\endcsname 2440 2254 \ifx\temp\relax \markupsetuplqdefault \else \temp \fi 2441 2255 } 2442 2256 2443 2257 \defmarkupstylesetup\markupsetuprq{% 2444 \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname 2258 \expandafter\let\expandafter \temp 2259 \csname markupsetuprq\currentmarkupstyle\endcsname 2445 2260 \ifx\temp\relax \markupsetuprqdefault \else \temp \fi 2446 2261 } … … 2461 2276 \let\markupsetuplqcode \markupsetcodequoteleft 2462 2277 \let\markupsetuprqcode \markupsetcodequoteright 2278 % 2463 2279 \let\markupsetuplqexample \markupsetcodequoteleft 2464 2280 \let\markupsetuprqexample \markupsetcodequoteright 2281 % 2282 \let\markupsetuplqsamp \markupsetcodequoteleft 2283 \let\markupsetuprqsamp \markupsetcodequoteright 2284 % 2465 2285 \let\markupsetuplqverb \markupsetcodequoteleft 2466 2286 \let\markupsetuprqverb \markupsetcodequoteright 2287 % 2467 2288 \let\markupsetuplqverbatim \markupsetcodequoteleft 2468 2289 \let\markupsetuprqverbatim \markupsetcodequoteright 2469 2290 2470 \let\markupsetuplqsamp \markupsetnoligaturesquoteleft2471 2291 \let\markupsetuplqkbd \markupsetnoligaturesquoteleft 2472 2292 2473 % Allow an option to not replace quotes with a regular directed right 2474 % quote/apostrophe (char 0x27), but instead use the undirected quote 2475 % from cmtt (char 0x0d). The undirected quote is ugly, so don't make it 2476 % the default, but it works for pasting with more pdf viewers (at least 2477 % evince), the lilypond developers report. xpdf does work with the 2478 % regular 0x27. 2293 % Allow an option to not use regular directed right quote/apostrophe 2294 % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). 2295 % The undirected quote is ugly, so don't make it the default, but it 2296 % works for pasting with more pdf viewers (at least evince), the 2297 % lilypond developers report. xpdf does work with the regular 0x27. 2479 2298 % 2480 2299 \def\codequoteright{% … … 2500 2319 } 2501 2320 2321 % Commands to set the quote options. 2322 % 2323 \parseargdef\codequoteundirected{% 2324 \def\temp{#1}% 2325 \ifx\temp\onword 2326 \expandafter\let\csname SETtxicodequoteundirected\endcsname 2327 = t% 2328 \else\ifx\temp\offword 2329 \expandafter\let\csname SETtxicodequoteundirected\endcsname 2330 = \relax 2331 \else 2332 \errhelp = \EMsimple 2333 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% 2334 \fi\fi 2335 } 2336 % 2337 \parseargdef\codequotebacktick{% 2338 \def\temp{#1}% 2339 \ifx\temp\onword 2340 \expandafter\let\csname SETtxicodequotebacktick\endcsname 2341 = t% 2342 \else\ifx\temp\offword 2343 \expandafter\let\csname SETtxicodequotebacktick\endcsname 2344 = \relax 2345 \else 2346 \errhelp = \EMsimple 2347 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% 2348 \fi\fi 2349 } 2350 2502 2351 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. 2503 2352 \def\noligaturesquoteleft{\relax\lq} … … 2506 2355 \newcount\fontdepth \fontdepth=0 2507 2356 2508 %% Add scribe-like font environments, plus @l for inline lisp (usually sans 2509 %% serif) and @ii for TeX italic 2510 2511 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction 2512 % unless the following character is such as not to need one. 2513 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else 2514 \ptexslash\fi\fi\fi} 2515 \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} 2516 \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} 2517 2518 % like \smartslanted except unconditionally uses \ttsl. 2357 % Font commands. 2358 2359 % #1 is the font command (\sl or \it), #2 is the text to slant. 2360 % If we are in a monospaced environment, however, 1) always use \ttsl, 2361 % and 2) do not add an italic correction. 2362 \def\dosmartslant#1#2{% 2363 \ifusingtt 2364 {{\ttsl #2}\let\next=\relax}% 2365 {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% 2366 \next 2367 } 2368 \def\smartslanted{\dosmartslant\sl} 2369 \def\smartitalic{\dosmartslant\it} 2370 2371 % Output an italic correction unless \next (presumed to be the following 2372 % character) is such as not to need one. 2373 \def\smartitaliccorrection{% 2374 \ifx\next,% 2375 \else\ifx\next-% 2376 \else\ifx\next.% 2377 \else\ptexslash 2378 \fi\fi\fi 2379 \aftersmartic 2380 } 2381 2382 % like \smartslanted except unconditionally uses \ttsl, and no ic. 2519 2383 % @var is set to this for defun arguments. 2520 \def\ttslanted#1{{\ttsl #1} \futurelet\next\smartitalicx}2384 \def\ttslanted#1{{\ttsl #1}} 2521 2385 2522 2386 % @cite is like \smartslanted except unconditionally use \sl. We never want 2523 2387 % ttsl for book titles, do we? 2524 \def\cite#1{{\sl #1}\futurelet\next\smartitalicx} 2388 \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} 2389 2390 \def\aftersmartic{} 2391 \def\var#1{% 2392 \let\saveaftersmartic = \aftersmartic 2393 \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% 2394 \smartslanted{#1}% 2395 } 2525 2396 2526 2397 \let\i=\smartitalic 2527 2398 \let\slanted=\smartslanted 2528 \def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}2529 2399 \let\dfn=\smartslanted 2530 2400 \let\emph=\smartitalic … … 2622 2492 #1% 2623 2493 }% 2624 \null 2494 \null % reset spacefactor to 1000 2625 2495 } 2626 2496 … … 2654 2524 } 2655 2525 2526 \def\codex #1{\tclose{#1}\endgroup} 2527 2656 2528 \def\realdash{-} 2657 2529 \def\codedash{-\discretionary{}{}{}} … … 2667 2539 {\_}% 2668 2540 } 2669 \def\codex #1{\tclose{#1}\endgroup}2670 2541 2671 2542 % An additional complication: the above will allow breaks after, e.g., … … 2687 2558 \else 2688 2559 \errhelp = \EMsimple 2689 \errmessage{Unknown @allowcodebreaks option `\txiarg' }%2560 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% 2690 2561 \fi\fi 2691 2562 } 2692 2693 % @kbd is like @code, except that if the argument is just one @key command,2694 % then @kbd has no effect.2695 \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}2696 2697 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),2698 % `example' (@kbd uses ttsl only inside of @example and friends),2699 % or `code' (@kbd uses normal tty font always).2700 \parseargdef\kbdinputstyle{%2701 \def\txiarg{#1}%2702 \ifx\txiarg\worddistinct2703 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%2704 \else\ifx\txiarg\wordexample2705 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%2706 \else\ifx\txiarg\wordcode2707 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%2708 \else2709 \errhelp = \EMsimple2710 \errmessage{Unknown @kbdinputstyle option `\txiarg'}%2711 \fi\fi\fi2712 }2713 \def\worddistinct{distinct}2714 \def\wordexample{example}2715 \def\wordcode{code}2716 2717 % Default is `distinct'.2718 \kbdinputstyle distinct2719 2720 \def\xkey{\key}2721 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%2722 \ifx\one\xkey\ifx\threex\three \key{#2}%2723 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi2724 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}2725 2726 % For @indicateurl, @env, @command quotes seem unnecessary, so use \code.2727 \let\indicateurl=\code2728 \let\env=\code2729 \let\command=\code2730 2731 % @clicksequence{File @click{} Open ...}2732 \def\clicksequence#1{\begingroup #1\endgroup}2733 2734 % @clickstyle @arrow (by default)2735 \parseargdef\clickstyle{\def\click{#1}}2736 \def\click{\arrow}2737 2563 2738 2564 % @uref (abbreviation for `urlref') takes an optional (comma-separated) 2739 2565 % second argument specifying the text to display and an optional third 2740 2566 % arg as text to display instead of (rather than in addition to) the url 2741 % itself. First (mandatory) arg is the url. Perhaps eventually put in2742 % a hypertex \special here.2743 % 2744 \def\uref #1{\douref#1,,,\finish}2745 \def\douref #1,#2,#3,#4\finish{\begingroup2567 % itself. First (mandatory) arg is the url. 2568 % (This \urefnobreak definition isn't used now, leaving it for a while 2569 % for comparison.) 2570 \def\urefnobreak#1{\dourefnobreak #1,,,\finish} 2571 \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup 2746 2572 \unsepspaces 2747 2573 \pdfurl{#1}% … … 2764 2590 \endgroup} 2765 2591 2592 % This \urefbreak definition is the active one. 2593 \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} 2594 \let\uref=\urefbreak 2595 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} 2596 \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example 2597 \unsepspaces 2598 \pdfurl{#1}% 2599 \setbox0 = \hbox{\ignorespaces #3}% 2600 \ifdim\wd0 > 0pt 2601 \unhbox0 % third arg given, show only that 2602 \else 2603 \setbox0 = \hbox{\ignorespaces #2}% 2604 \ifdim\wd0 > 0pt 2605 \ifpdf 2606 \unhbox0 % PDF: 2nd arg given, show only it 2607 \else 2608 \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url 2609 \fi 2610 \else 2611 \urefcode{#1}% only url given, so show it 2612 \fi 2613 \fi 2614 \endlink 2615 \endgroup} 2616 2617 % Allow line breaks around only a few characters (only). 2618 \def\urefcatcodes{% 2619 \catcode\ampChar=\active \catcode\dotChar=\active 2620 \catcode\hashChar=\active \catcode\questChar=\active 2621 \catcode\slashChar=\active 2622 } 2623 { 2624 \urefcatcodes 2625 % 2626 \global\def\urefcode{\begingroup 2627 \setupmarkupstyle{code}% 2628 \urefcatcodes 2629 \let&\urefcodeamp 2630 \let.\urefcodedot 2631 \let#\urefcodehash 2632 \let?\urefcodequest 2633 \let/\urefcodeslash 2634 \codex 2635 } 2636 % 2637 % By default, they are just regular characters. 2638 \global\def&{\normalamp} 2639 \global\def.{\normaldot} 2640 \global\def#{\normalhash} 2641 \global\def?{\normalquest} 2642 \global\def/{\normalslash} 2643 } 2644 2645 % we put a little stretch before and after the breakable chars, to help 2646 % line breaking of long url's. The unequal skips make look better in 2647 % cmtt at least, especially for dots. 2648 \def\urefprestretch{\urefprebreak \hskip0pt plus.13em } 2649 \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } 2650 % 2651 \def\urefcodeamp{\urefprestretch \&\urefpoststretch} 2652 \def\urefcodedot{\urefprestretch .\urefpoststretch} 2653 \def\urefcodehash{\urefprestretch \#\urefpoststretch} 2654 \def\urefcodequest{\urefprestretch ?\urefpoststretch} 2655 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} 2656 { 2657 \catcode`\/=\active 2658 \global\def\urefcodeslashfinish{% 2659 \urefprestretch \slashChar 2660 % Allow line break only after the final / in a sequence of 2661 % slashes, to avoid line break between the slashes in http://. 2662 \ifx\next/\else \urefpoststretch \fi 2663 } 2664 } 2665 2666 % One more complication: by default we'll break after the special 2667 % characters, but some people like to break before the special chars, so 2668 % allow that. Also allow no breaking at all, for manual control. 2669 % 2670 \parseargdef\urefbreakstyle{% 2671 \def\txiarg{#1}% 2672 \ifx\txiarg\wordnone 2673 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} 2674 \else\ifx\txiarg\wordbefore 2675 \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} 2676 \else\ifx\txiarg\wordafter 2677 \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} 2678 \else 2679 \errhelp = \EMsimple 2680 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% 2681 \fi\fi\fi 2682 } 2683 \def\wordafter{after} 2684 \def\wordbefore{before} 2685 \def\wordnone{none} 2686 2687 \urefbreakstyle after 2688 2766 2689 % @url synonym for @uref, since that's how everyone uses it. 2767 2690 % … … 2785 2708 \fi 2786 2709 2710 % @kbd is like @code, except that if the argument is just one @key command, 2711 % then @kbd has no effect. 2712 \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} 2713 2714 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), 2715 % `example' (@kbd uses ttsl only inside of @example and friends), 2716 % or `code' (@kbd uses normal tty font always). 2717 \parseargdef\kbdinputstyle{% 2718 \def\txiarg{#1}% 2719 \ifx\txiarg\worddistinct 2720 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% 2721 \else\ifx\txiarg\wordexample 2722 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% 2723 \else\ifx\txiarg\wordcode 2724 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% 2725 \else 2726 \errhelp = \EMsimple 2727 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% 2728 \fi\fi\fi 2729 } 2730 \def\worddistinct{distinct} 2731 \def\wordexample{example} 2732 \def\wordcode{code} 2733 2734 % Default is `distinct'. 2735 \kbdinputstyle distinct 2736 2737 \def\xkey{\key} 2738 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% 2739 \ifx\one\xkey\ifx\threex\three \key{#2}% 2740 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi 2741 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} 2742 2743 % For @indicateurl, @env, @command quotes seem unnecessary, so use \code. 2744 \let\indicateurl=\code 2745 \let\env=\code 2746 \let\command=\code 2747 2748 % @clicksequence{File @click{} Open ...} 2749 \def\clicksequence#1{\begingroup #1\endgroup} 2750 2751 % @clickstyle @arrow (by default) 2752 \parseargdef\clickstyle{\def\click{#1}} 2753 \def\click{\arrow} 2754 2787 2755 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the 2788 2756 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. … … 2806 2774 \space ({\unsepspaces \ignorespaces \temp \unskip})% 2807 2775 \fi 2776 \null % reset \spacefactor=1000 2808 2777 } 2809 2778 … … 2818 2787 \space ({\unsepspaces \ignorespaces \temp \unskip})% 2819 2788 \fi 2789 \null % reset \spacefactor=1000 2790 } 2791 2792 % @asis just yields its argument. Used with @table, for example. 2793 % 2794 \def\asis#1{#1} 2795 2796 % @math outputs its argument in math mode. 2797 % 2798 % One complication: _ usually means subscripts, but it could also mean 2799 % an actual _ character, as in @math{@var{some_variable} + 1}. So make 2800 % _ active, and distinguish by seeing if the current family is \slfam, 2801 % which is what @var uses. 2802 { 2803 \catcode`\_ = \active 2804 \gdef\mathunderscore{% 2805 \catcode`\_=\active 2806 \def_{\ifnum\fam=\slfam \_\else\sb\fi}% 2807 } 2808 } 2809 % Another complication: we want \\ (and @\) to output a math (or tt) \. 2810 % FYI, plain.tex uses \\ as a temporary control sequence (for no 2811 % particular reason), but this is not advertised and we don't care. 2812 % 2813 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. 2814 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} 2815 % 2816 \def\math{% 2817 \tex 2818 \mathunderscore 2819 \let\\ = \mathbackslash 2820 \mathactive 2821 % make the texinfo accent commands work in math mode 2822 \let\"=\ddot 2823 \let\'=\acute 2824 \let\==\bar 2825 \let\^=\hat 2826 \let\`=\grave 2827 \let\u=\breve 2828 \let\v=\check 2829 \let\~=\tilde 2830 \let\dotaccent=\dot 2831 $\finishmath 2832 } 2833 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. 2834 2835 % Some active characters (such as <) are spaced differently in math. 2836 % We have to reset their definitions in case the @math was an argument 2837 % to a command which sets the catcodes (such as @item or @section). 2838 % 2839 { 2840 \catcode`^ = \active 2841 \catcode`< = \active 2842 \catcode`> = \active 2843 \catcode`+ = \active 2844 \catcode`' = \active 2845 \gdef\mathactive{% 2846 \let^ = \ptexhat 2847 \let< = \ptexless 2848 \let> = \ptexgtr 2849 \let+ = \ptexplus 2850 \let' = \ptexquoteright 2851 } 2820 2852 } 2821 2853 2822 2854 2823 2855 \message{glyphs,} 2856 % and logos. 2857 2858 % @@ prints an @. 2859 \def\@{\char64 } 2860 2861 % Used to generate quoted braces. Unless we're in typewriter, use 2862 % \ecfont because the CM text fonts do not have braces, and we don't 2863 % want to switch into math. 2864 \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} 2865 \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} 2866 \let\{=\mylbrace 2867 \let\}=\myrbrace 2868 \begingroup 2869 % Definitions to produce \{ and \} commands for indices, 2870 % and @{ and @} for the aux/toc files. 2871 \catcode`\{ = \other \catcode`\} = \other 2872 \catcode`\[ = 1 \catcode`\] = 2 2873 \catcode`\! = 0 \catcode`\\ = \other 2874 !gdef!lbracecmd[\{]% 2875 !gdef!rbracecmd[\}]% 2876 !gdef!lbraceatcmd[@{]% 2877 !gdef!rbraceatcmd[@}]% 2878 !endgroup 2879 2880 % @comma{} to avoid , parsing problems. 2881 \let\comma = , 2882 2883 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent 2884 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. 2885 \let\, = \ptexc 2886 \let\dotaccent = \ptexdot 2887 \def\ringaccent#1{{\accent23 #1}} 2888 \let\tieaccent = \ptext 2889 \let\ubaraccent = \ptexb 2890 \let\udotaccent = \d 2891 2892 % Other special characters: @questiondown @exclamdown @ordf @ordm 2893 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. 2894 \def\questiondown{?`} 2895 \def\exclamdown{!`} 2896 \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} 2897 \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} 2898 2899 % Dotless i and dotless j, used for accents. 2900 \def\imacro{i} 2901 \def\jmacro{j} 2902 \def\dotless#1{% 2903 \def\temp{#1}% 2904 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi 2905 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi 2906 \else \errmessage{@dotless can be used only with i or j}% 2907 \fi\fi 2908 } 2909 2910 % The \TeX{} logo, as in plain, but resetting the spacing so that a 2911 % period following counts as ending a sentence. (Idea found in latex.) 2912 % 2913 \edef\TeX{\TeX \spacefactor=1000 } 2914 2915 % @LaTeX{} logo. Not quite the same results as the definition in 2916 % latex.ltx, since we use a different font for the raised A; it's most 2917 % convenient for us to use an explicitly smaller font, rather than using 2918 % the \scriptstyle font (since we don't reset \scriptstyle and 2919 % \scriptscriptstyle). 2920 % 2921 \def\LaTeX{% 2922 L\kern-.36em 2923 {\setbox0=\hbox{T}% 2924 \vbox to \ht0{\hbox{% 2925 \ifx\textnominalsize\xwordpt 2926 % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. 2927 % Revert to plain's \scriptsize, which is 7pt. 2928 \count255=\the\fam $\fam\count255 \scriptstyle A$% 2929 \else 2930 % For 11pt, we can use our lllsize. 2931 \selectfonts\lllsize A% 2932 \fi 2933 }% 2934 \vss 2935 }}% 2936 \kern-.15em 2937 \TeX 2938 } 2939 2940 % Some math mode symbols. 2941 \def\bullet{$\ptexbullet$} 2942 \def\geq{\ifmmode \ge\else $\ge$\fi} 2943 \def\leq{\ifmmode \le\else $\le$\fi} 2944 \def\minus{\ifmmode -\else $-$\fi} 2945 2946 % @dots{} outputs an ellipsis using the current font. 2947 % We do .5em per period so that it has the same spacing in the cm 2948 % typewriter fonts as three actual period characters; on the other hand, 2949 % in other typewriter fonts three periods are wider than 1.5em. So do 2950 % whichever is larger. 2951 % 2952 \def\dots{% 2953 \leavevmode 2954 \setbox0=\hbox{...}% get width of three periods 2955 \ifdim\wd0 > 1.5em 2956 \dimen0 = \wd0 2957 \else 2958 \dimen0 = 1.5em 2959 \fi 2960 \hbox to \dimen0{% 2961 \hskip 0pt plus.25fil 2962 .\hskip 0pt plus1fil 2963 .\hskip 0pt plus1fil 2964 .\hskip 0pt plus.5fil 2965 }% 2966 } 2967 2968 % @enddots{} is an end-of-sentence ellipsis. 2969 % 2970 \def\enddots{% 2971 \dots 2972 \spacefactor=\endofsentencespacefactor 2973 } 2824 2974 2825 2975 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. … … 2843 2993 \dimen2 = .55pt % Thickness of rules 2844 2994 % The text. (`r' is open on the right, `e' somewhat less so on the left.) 2845 \setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}2995 \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} 2846 2996 % 2847 2997 \setbox\errorbox=\hbox to \dimen0{\hfil … … 2992 3142 % so we'll define it if necessary. 2993 3143 % 2994 \ifx\Orb\ undefined3144 \ifx\Orb\thisisundefined 2995 3145 \def\Orb{\mathhexbox20D} 2996 3146 \fi … … 3020 3170 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue 3021 3171 3022 \parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% 3023 \endgroup\page\hbox{}\page} 3172 \parseargdef\shorttitlepage{% 3173 \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% 3174 \endgroup\page\hbox{}\page} 3024 3175 3025 3176 \envdef\titlepage{% … … 3081 3232 } 3082 3233 3083 % %%Macros to be used within @titlepage:3234 % Macros to be used within @titlepage: 3084 3235 3085 3236 \let\subtitlerm=\tenrm … … 3114 3265 3115 3266 3116 % %%Set up page headings and footings.3267 % Set up page headings and footings. 3117 3268 3118 3269 \let\thispage=\folio … … 3208 3359 \def\headings #1 {\csname HEADINGS#1\endcsname} 3209 3360 3210 \def\HEADINGSoff{% 3211 \global\evenheadline={\hfil} \global\evenfootline={\hfil} 3212 \global\oddheadline={\hfil} \global\oddfootline={\hfil}} 3213 \HEADINGSoff 3361 \def\headingsoff{% non-global headings elimination 3362 \evenheadline={\hfil}\evenfootline={\hfil}% 3363 \oddheadline={\hfil}\oddfootline={\hfil}% 3364 } 3365 3366 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting 3367 \HEADINGSoff % it's the default 3368 3214 3369 % When we turn headings on, set the page number to 1. 3215 3370 % For double-sided printing, put current file name in lower left corner, … … 3262 3417 % Only define if not already defined, in case a txi-??.tex file has set 3263 3418 % up a different format (e.g., txi-cs.tex does this). 3264 \ifx\today\ undefined3419 \ifx\today\thisisundefined 3265 3420 \def\today{% 3266 3421 \number\day\space … … 3323 3478 \advance\leftskip by-\tableindent 3324 3479 \advance\hsize by\tableindent 3325 \advance\rightskip by0pt plus1fil 3480 \advance\rightskip by0pt plus1fil\relax 3326 3481 \leavevmode\unhbox0\par 3327 3482 \endgroup … … 3809 3964 \global\advance\multitablelinespace by-\ht0 3810 3965 \fi 3811 % %Test to see if parskip is larger than space between lines of3812 % %table. If not, do nothing.3813 % %If so, set to same dimension as multitablelinespace.3966 % Test to see if parskip is larger than space between lines of 3967 % table. If not, do nothing. 3968 % If so, set to same dimension as multitablelinespace. 3814 3969 \ifdim\multitableparskip>\multitablelinespace 3815 3970 \global\multitableparskip=\multitablelinespace 3816 \global\advance\multitableparskip-7pt % %to keep parskip somewhat smaller3817 % %than skip between lines in the table.3971 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller 3972 % than skip between lines in the table. 3818 3973 \fi% 3819 3974 \ifdim\multitableparskip=0pt 3820 3975 \global\multitableparskip=\multitablelinespace 3821 \global\advance\multitableparskip-7pt % %to keep parskip somewhat smaller3822 % %than skip between lines in the table.3976 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller 3977 % than skip between lines in the table. 3823 3978 \fi} 3824 3979 … … 4135 4290 \def\ {\realbackslash\space }% 4136 4291 % 4137 % Need these in case \tex is in effect and \{ is a \delimiter again. 4138 % But can't use \lbracecmd and \rbracecmd because texindex assumes 4139 % braces and backslashes are used only as delimiters. 4140 \let\{ = \mylbrace 4141 \let\} = \myrbrace 4292 % Need these unexpandable (because we define \tt as a dummy) 4293 % definitions when @{ or @} appear in index entry text. Also, more 4294 % complicated, when \tex is in effect and \{ is a \delimiter again. 4295 % We can't use \lbracecmd and \rbracecmd because texindex assumes 4296 % braces and backslashes are used only as delimiters. Perhaps we 4297 % should define @lbrace and @rbrace commands a la @comma. 4298 \def\{{{\tt\char123}}% 4299 \def\}{{\tt\char125}}% 4142 4300 % 4143 4301 % I don't entirely understand this, but when an index entry is … … 4192 4350 % 4193 4351 % \definedummyword defines \#1 as \string\#1\space, thus effectively 4194 % preventing its expansion. This is used only for control %words,4352 % preventing its expansion. This is used only for control words, 4195 4353 % not control letters, because the \space would be incorrect for 4196 4354 % control characters, but is needed to separate the control word … … 4211 4369 % 4212 4370 \definedummyletter\_% 4371 \definedummyletter\-% 4213 4372 % 4214 4373 % Non-English letters. … … 4247 4406 % 4248 4407 % Assorted special characters. 4408 \definedummyword\arrow 4249 4409 \definedummyword\bullet 4250 4410 \definedummyword\comma … … 4253 4413 \definedummyword\dots 4254 4414 \definedummyword\enddots 4415 \definedummyword\entrybreak 4255 4416 \definedummyword\equiv 4256 4417 \definedummyword\error 4257 4418 \definedummyword\euro 4419 \definedummyword\expansion 4420 \definedummyword\geq 4258 4421 \definedummyword\guillemetleft 4259 4422 \definedummyword\guillemetright 4260 4423 \definedummyword\guilsinglleft 4261 4424 \definedummyword\guilsinglright 4262 \definedummyword\ expansion4425 \definedummyword\leq 4263 4426 \definedummyword\minus 4264 4427 \definedummyword\ogonek … … 4317 4480 \definedummyword\i 4318 4481 \definedummyword\r 4482 \definedummyword\sansserif 4319 4483 \definedummyword\sc 4484 \definedummyword\slanted 4320 4485 \definedummyword\t 4321 4486 % … … 4326 4491 \definedummyword\command 4327 4492 \definedummyword\dfn 4493 \definedummyword\dmn 4328 4494 \definedummyword\email 4329 4495 \definedummyword\emph 4330 4496 \definedummyword\env 4331 4497 \definedummyword\file 4498 \definedummyword\indicateurl 4332 4499 \definedummyword\kbd 4333 4500 \definedummyword\key … … 4357 4524 % We can just ignore other control letters. 4358 4525 \def\definedummyletter##1{\let##1\empty}% 4359 % Hopefully, all control words can become @asis.4526 % All control words become @asis by default; overrides below. 4360 4527 \let\definedummyword\definedummyaccent 4361 4528 % … … 4369 4536 \def\ { }% 4370 4537 \def\@{@}% 4371 % how to handle braces?4372 4538 \def\_{\normalunderscore}% 4539 \def\-{}% @- shouldn't affect sorting 4540 % 4541 % Unfortunately, texindex is not prepared to handle braces in the 4542 % content at all. So for index sorting, we map @{ and @} to strings 4543 % starting with |, since that ASCII character is between ASCII { and }. 4544 \def\{{|a}% 4545 \def\}{|b}% 4373 4546 % 4374 4547 % Non-English letters. … … 4398 4571 % Assorted special characters. 4399 4572 % (The following {} will end up in the sort string, but that's ok.) 4573 \def\arrow{->}% 4400 4574 \def\bullet{bullet}% 4401 4575 \def\comma{,}% … … 4407 4581 \def\euro{euro}% 4408 4582 \def\expansion{==>}% 4583 \def\geq{>=}% 4409 4584 \def\guillemetleft{<<}% 4410 4585 \def\guillemetright{>>}% 4411 4586 \def\guilsinglleft{<}% 4412 4587 \def\guilsinglright{>}% 4588 \def\leq{<=}% 4413 4589 \def\minus{-}% 4414 4590 \def\point{.}% … … 4425 4601 \def\textdegree{o}% 4426 4602 % 4603 \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax 4604 \else \indexlquoteignore \fi 4605 % 4427 4606 % We need to get rid of all macros, leaving only the arguments (if present). 4428 4607 % Of course this is not nearly correct, but it is the best we can do for now. … … 4437 4616 \macrolist 4438 4617 } 4618 4619 % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us 4620 % ignore left quotes in the sort term. 4621 {\catcode`\`=\active 4622 \gdef\indexlquoteignore{\let`=\empty}} 4439 4623 4440 4624 \let\indexbackslash=0 %overridden during \printindex. … … 4695 4879 % @code, which sets - active. This problem was fixed by a kludge--- 4696 4880 % ``-'' was active throughout whole index, but this isn't really right. 4697 %4698 4881 % The right solution is to prevent \entry from swallowing the whole text. 4699 4882 % --kasal, 21nov03 … … 4732 4915 \vskip 0pt plus1pt 4733 4916 % 4917 % When reading the text of entry, convert explicit line breaks 4918 % from @* into spaces. The user might give these in long section 4919 % titles, for instance. 4920 \def\*{\unskip\space\ignorespaces}% 4921 \def\entrybreak{\hfil\break}% 4922 % 4734 4923 % Swallow the left brace of the text (first parameter): 4735 4924 \afterassignment\doentry 4736 4925 \let\temp = 4737 4926 } 4927 \def\entrybreak{\unskip\space\ignorespaces}% 4738 4928 \def\doentry{% 4739 4929 \bgroup % Instead of the swallowed brace. … … 4968 5158 % Chapters, sections, etc. 4969 5159 4970 % \unnumberedno is an oxymoron, of course. But we count the unnumbered 5160 % Let's start with @part. 5161 \outer\parseargdef\part{\partzzz{#1}} 5162 \def\partzzz#1{% 5163 \chapoddpage 5164 \null 5165 \vskip.3\vsize % move it down on the page a bit 5166 \begingroup 5167 \noindent \titlefonts\rmisbold #1\par % the text 5168 \let\lastnode=\empty % no node to associate with 5169 \writetocentry{part}{#1}{}% but put it in the toc 5170 \headingsoff % no headline or footline on the part page 5171 \chapoddpage 5172 \endgroup 5173 } 5174 5175 % \unnumberedno is an oxymoron. But we count the unnumbered 4971 5176 % sections so that we can refer to them unambiguously in the pdf 4972 5177 % outlines by their "section number". We avoid collisions with chapter … … 5047 5252 % 5048 5253 % A numbered section within an unnumbered changes to unnumbered too. 5049 % To achi ve this, remember the "biggest" unnum. sec. we are currently in:5050 \chardef\un mlevel = \maxseclevel5254 % To achieve this, remember the "biggest" unnum. sec. we are currently in: 5255 \chardef\unnlevel = \maxseclevel 5051 5256 % 5052 5257 % Trace whether the current chapter is an appendix or not: … … 5073 5278 \def\headtype{#1}% 5074 5279 \if \headtype U% 5075 \ifnum \absseclevel < \un mlevel5076 \chardef\un mlevel = \absseclevel5280 \ifnum \absseclevel < \unnlevel 5281 \chardef\unnlevel = \absseclevel 5077 5282 \fi 5078 5283 \else … … 5086 5291 \fi 5087 5292 % Check for numbered within unnumbered: 5088 \ifnum \absseclevel > \un mlevel5293 \ifnum \absseclevel > \unnlevel 5089 5294 \def\headtype{U}% 5090 5295 \else 5091 \chardef\un mlevel = 35296 \chardef\unnlevel = 3 5092 5297 \fi 5093 5298 \fi … … 5175 5380 } 5176 5381 5177 \outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz 5382 % normally unnmhead0 calls unnumberedzzz: 5383 \outer\parseargdef\unnumbered{\unnmhead0{#1}} 5178 5384 \def\unnumberedzzz#1{% 5179 5385 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 … … 5219 5425 5220 5426 % Sections. 5427 % 5221 5428 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz 5222 5429 \def\seczzz#1{% … … 5225 5432 } 5226 5433 5227 \outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz 5434 % normally calls appendixsectionzzz: 5435 \outer\parseargdef\appendixsection{\apphead1{#1}} 5228 5436 \def\appendixsectionzzz#1{% 5229 5437 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 … … 5232 5440 \let\appendixsec\appendixsection 5233 5441 5234 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz 5442 % normally calls unnumberedseczzz: 5443 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} 5235 5444 \def\unnumberedseczzz#1{% 5236 5445 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 … … 5239 5448 5240 5449 % Subsections. 5241 \outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz 5450 % 5451 % normally calls numberedsubseczzz: 5452 \outer\parseargdef\numberedsubsec{\numhead2{#1}} 5242 5453 \def\numberedsubseczzz#1{% 5243 5454 \global\subsubsecno=0 \global\advance\subsecno by 1 … … 5245 5456 } 5246 5457 5247 \outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz 5458 % normally calls appendixsubseczzz: 5459 \outer\parseargdef\appendixsubsec{\apphead2{#1}} 5248 5460 \def\appendixsubseczzz#1{% 5249 5461 \global\subsubsecno=0 \global\advance\subsecno by 1 … … 5252 5464 } 5253 5465 5254 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz 5466 % normally calls unnumberedsubseczzz: 5467 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} 5255 5468 \def\unnumberedsubseczzz#1{% 5256 5469 \global\subsubsecno=0 \global\advance\subsecno by 1 … … 5260 5473 5261 5474 % Subsubsections. 5262 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz 5475 % 5476 % normally numberedsubsubseczzz: 5477 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} 5263 5478 \def\numberedsubsubseczzz#1{% 5264 5479 \global\advance\subsubsecno by 1 … … 5267 5482 } 5268 5483 5269 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz 5484 % normally appendixsubsubseczzz: 5485 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} 5270 5486 \def\appendixsubsubseczzz#1{% 5271 5487 \global\advance\subsubsecno by 1 … … 5274 5490 } 5275 5491 5276 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz 5492 % normally unnumberedsubsubseczzz: 5493 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} 5277 5494 \def\unnumberedsubsubseczzz#1{% 5278 5495 \global\advance\subsubsecno by 1 … … 5324 5541 % given all the information in convenient, parsed form. 5325 5542 5326 % %%Args are the skip and penalty (usually negative)5543 % Args are the skip and penalty (usually negative) 5327 5544 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} 5328 5545 5329 %%% Define plain chapter starts, and page on/off switching for it5330 5546 % Parameter controlling skip before chapter headings (if needed) 5331 5332 5547 \newskip\chapheadingskip 5333 5548 5549 % Define plain chapter starts, and page on/off switching for it. 5334 5550 \def\chapbreak{\dobreak \chapheadingskip {-4000}} 5335 5551 \def\chappager{\par\vfill\supereject} … … 5341 5557 \ifodd\pageno \else 5342 5558 \begingroup 5343 \evenheadline={\hfil}\evenfootline={\hfil}% 5344 \oddheadline={\hfil}\oddfootline={\hfil}% 5345 \hbox to 0pt{}% 5559 \headingsoff 5560 \null 5346 5561 \chappager 5347 5562 \endgroup … … 5535 5750 \def\sectionheading#1#2#3#4{% 5536 5751 {% 5752 \checkenv{}% should not be in an environment. 5753 % 5537 5754 % Switch to the right set of fonts. 5538 5755 \csname #2fonts\endcsname \rmisbold … … 5652 5869 % 10000. This is so \startdefun can avoid allowing breakpoints after 5653 5870 % section headings. Otherwise, it would insert a valid breakpoint between: 5654 %5655 5871 % @section sec-whatever 5656 5872 % @deffn def-whatever … … 5786 6002 \startcontents{\putwordShortTOC}% 5787 6003 % 6004 \let\partentry = \shortpartentry 5788 6005 \let\numchapentry = \shortchapentry 5789 6006 \let\appentry = \shortchapentry … … 5841 6058 % The arguments in between are the chapter number, section number, ... 5842 6059 6060 % Parts, in the main contents. Replace the part number, which doesn't 6061 % exist, with an empty box. Let's hope all the numbers have the same width. 6062 % Also ignore the page number, which is conventionally not printed. 6063 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} 6064 \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} 6065 % 6066 % Parts, in the short toc. 6067 \def\shortpartentry#1#2#3#4{% 6068 \penalty-300 6069 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip 6070 \shortchapentry{{\bf #1}}{\numeralbox}{}{}% 6071 } 6072 5843 6073 % Chapters, in the main contents. 5844 6074 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} … … 5930 6160 % @foo ... @end foo. 5931 6161 5932 % @tex ... @end tex escapes into raw Te xtemporarily.6162 % @tex ... @end tex escapes into raw TeX temporarily. 5933 6163 % One exception: @ is still an escape character, so that @end tex works. 5934 % But \@ or @@ will get a plain tex@ character.6164 % But \@ or @@ will get a plain @ character. 5935 6165 5936 6166 \envdef\tex{% … … 5948 6178 \catcode`\'=\other 5949 6179 \escapechar=`\\ 6180 % 6181 % ' is active in math mode (mathcode"8000). So reset it, and all our 6182 % other math active characters (just in case), to plain's definitions. 6183 \mathactive 5950 6184 % 5951 6185 \let\b=\ptexb … … 6052 6286 % Flag to tell @lisp, etc., not to narrow margin. 6053 6287 \let\nonarrowing = t% 6288 % 6289 % If this cartouche directly follows a sectioning command, we need the 6290 % \parskip glue (backspaced over by default) or the cartouche can 6291 % collide with the section heading. 6292 \ifnum\lastpenalty>10000 \vskip\parskip \fi 6293 % 6054 6294 \vbox\bgroup 6055 6295 \baselineskip=0pt\parskip=0pt\lineskip=0pt … … 6065 6305 \parskip=\normpskip 6066 6306 \vskip -\parskip 6067 \comment % For explanation, see the end of \def\group.6307 \comment % For explanation, see the end of def\group. 6068 6308 } 6069 6309 \def\Ecartouche{% … … 6151 6391 6152 6392 % We often define two environments, @foo and @smallfoo. 6153 % Let's do it by one command:6154 \def\makedispenv #1#2{6155 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} 6156 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} 6393 % Let's do it in one command. #1 is the env name, #2 the definition. 6394 \def\makedispenvdef#1#2{% 6395 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% 6396 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% 6157 6397 \expandafter\let\csname E#1\endcsname \afterenvbreak 6158 6398 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak 6159 6399 } 6160 6400 6161 % Define two synonyms: 6162 \def\maketwodispenvs #1#2#3{ 6163 \makedispenv{#1}{#3} 6164 \makedispenv{#2}{#3} 6165 } 6166 6167 % @lisp: indented, narrowed, typewriter font; @example: same as @lisp. 6401 % Define two environment synonyms (#1 and #2) for an environment. 6402 \def\maketwodispenvdef#1#2#3{% 6403 \makedispenvdef{#1}{#3}% 6404 \makedispenvdef{#2}{#3}% 6405 } 6406 % 6407 % @lisp: indented, narrowed, typewriter font; 6408 % @example: same as @lisp. 6168 6409 % 6169 6410 % @smallexample and @smalllisp: use smaller fonts. 6170 6411 % Originally contributed by Pavel@xerox. 6171 6412 % 6172 \maketwodispenv s{lisp}{example}{%6413 \maketwodispenvdef{lisp}{example}{% 6173 6414 \nonfillstart 6174 6415 \tt\setupmarkupstyle{example}% 6175 6416 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. 6176 \gobble 6417 \gobble % eat return 6177 6418 } 6178 6419 % @display/@smalldisplay: same as @lisp except keep current font. 6179 6420 % 6180 \makedispenv 6421 \makedispenvdef{display}{% 6181 6422 \nonfillstart 6182 6423 \gobble … … 6185 6426 % @format/@smallformat: same as @display except don't narrow margins. 6186 6427 % 6187 \makedispenv {format}{%6428 \makedispenvdef{format}{% 6188 6429 \let\nonarrowing = t% 6189 6430 \nonfillstart … … 6204 6445 \let\nonarrowing = t% 6205 6446 \nonfillstart 6206 \advance\leftskip by 0pt plus 1fill 6447 \advance\leftskip by 0pt plus 1fill\relax 6207 6448 \gobble 6208 6449 } … … 6238 6479 % we're doing normal filling. So, when using \aboveenvbreak and 6239 6480 % \afterenvbreak, temporarily make \parskip 0. 6481 % 6482 \makedispenvdef{quotation}{\quotationstart} 6240 6483 % 6241 6484 \def\quotationstart{% … … 6254 6497 } 6255 6498 6256 \envdef\quotation{%6257 \setnormaldispenv6258 \quotationstart6259 }6260 6261 \envdef\smallquotation{%6262 \setsmalldispenv6263 \quotationstart6264 }6265 \let\Esmallquotation = \Equotation6266 6267 6499 % We have retained a nonzero parskip for the environment, since we're 6268 6500 % doing normal filling. … … 6270 6502 \def\Equotation{% 6271 6503 \par 6272 \ifx\quotationauthor\ undefined\else6504 \ifx\quotationauthor\thisisundefined\else 6273 6505 % indent a bit. 6274 6506 \leftline{\kern 2\leftskip \sl ---\quotationauthor}% … … 6276 6508 {\parskip=0pt \afterenvbreak}% 6277 6509 } 6510 \def\Esmallquotation{\Equotation} 6278 6511 6279 6512 % If we're given an argument, typeset it in bold with a colon after. … … 6332 6565 % Setup for the @verbatim environment 6333 6566 % 6334 % Real tab expansion 6567 % Real tab expansion. 6335 6568 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount 6336 6569 % 6337 \def\starttabbox{\setbox0=\hbox\bgroup} 6570 % We typeset each line of the verbatim in an \hbox, so we can handle 6571 % tabs. The \global is in case the verbatim line starts with an accent, 6572 % or some other command that starts with a begin-group. Otherwise, the 6573 % entire \verbbox would disappear at the corresponding end-group, before 6574 % it is typeset. Meanwhile, we can't have nested verbatim commands 6575 % (can we?), so the \global won't be overwriting itself. 6576 \newbox\verbbox 6577 \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} 6338 6578 % 6339 6579 \begingroup … … 6342 6582 \catcode`\^^I=\active 6343 6583 \def^^I{\leavevmode\egroup 6344 \dimen 0=\wd0% the width so far, or since the previous tab6345 \divide\dimen 0by\tabw6346 \multiply\dimen 0by\tabw % compute previous multiple of \tabw6347 \advance\dimen 0by\tabw % advance to next multiple of \tabw6348 \wd 0=\dimen0 \box0\starttabbox6584 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab 6585 \divide\dimen\verbbox by\tabw 6586 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw 6587 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw 6588 \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox 6349 6589 }% 6350 6590 } … … 6355 6595 \let\nonarrowing = t% 6356 6596 \nonfillstart 6357 % Easiest (and conventionally used) font for verbatim 6358 \tt 6359 \def\par{\leavevmode\egroup\box0\endgraf}% 6597 \tt % easiest (and conventionally used) font for verbatim 6598 % The \leavevmode here is for blank lines. Otherwise, we would 6599 % never \starttabox and the \egroup would end verbatim mode. 6600 \def\par{\leavevmode\egroup\box\verbbox\endgraf}% 6360 6601 \tabexpand 6361 6602 \setupmarkupstyle{verbatim}% 6362 6603 % Respect line breaks, 6363 6604 % print special symbols as themselves, and 6364 % make each space count 6365 % must do in this order:6605 % make each space count. 6606 % Must do in this order: 6366 6607 \obeylines \uncatcodespecials \sepspaces 6367 6608 \everypar{\starttabbox}% … … 6420 6661 \setupverbatim 6421 6662 \indexnofonts % Allow `@@' and other weird things in file names. 6663 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% 6422 6664 \input #1 6423 6665 \afterenvbreak … … 6469 6711 % a break between a section heading and a defun. 6470 6712 % 6471 % As a minor refinement, we avoid "club" headers by signalling6713 % As a further refinement, we avoid "club" headers by signalling 6472 6714 % with penalty of 10003 after the very first @deffn in the 6473 6715 % sequence (see above), and penalty of 10002 after any following … … 6506 6748 % common ending: 6507 6749 \interlinepenalty = 10000 6508 \advance\rightskip by 0pt plus 1fil 6750 \advance\rightskip by 0pt plus 1fil\relax 6509 6751 \endgraf 6510 6752 \nobreak\vskip -\parskip … … 6536 6778 \envdef#1{% 6537 6779 \startdefun 6780 \doingtypefnfalse % distinguish typed functions from all else 6538 6781 \parseargusing\activeparens{\printdefunline#3}% 6539 6782 }% … … 6542 6785 } 6543 6786 6544 %%% Untyped functions: 6787 \newif\ifdoingtypefn % doing typed function? 6788 \newif\ifrettypeownline % typeset return type on its own line? 6789 6790 % @deftypefnnewline on|off says whether the return type of typed functions 6791 % are printed on their own line. This affects @deftypefn, @deftypefun, 6792 % @deftypeop, and @deftypemethod. 6793 % 6794 \parseargdef\deftypefnnewline{% 6795 \def\temp{#1}% 6796 \ifx\temp\onword 6797 \expandafter\let\csname SETtxideftypefnnl\endcsname 6798 = \empty 6799 \else\ifx\temp\offword 6800 \expandafter\let\csname SETtxideftypefnnl\endcsname 6801 = \relax 6802 \else 6803 \errhelp = \EMsimple 6804 \errmessage{Unknown @txideftypefnnl value `\temp', 6805 must be on|off}% 6806 \fi\fi 6807 } 6808 6809 % Untyped functions: 6545 6810 6546 6811 % @deffn category name args … … 6561 6826 } 6562 6827 6563 % %%Typed functions:6828 % Typed functions: 6564 6829 6565 6830 % @deftypefn category type name args … … 6576 6841 \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% 6577 6842 \dosubind{fn}{\code{#4}}{#1}% 6843 \doingtypefntrue 6578 6844 \defname{#2}{#3}{#4}\defunargs{#5\unskip}% 6579 6845 } 6580 6846 6581 % %%Typed variables:6847 % Typed variables: 6582 6848 6583 6849 % @deftypevr category type var args … … 6597 6863 } 6598 6864 6599 % %%Untyped variables:6865 % Untyped variables: 6600 6866 6601 6867 % @defvr category var args … … 6608 6874 \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } 6609 6875 6610 %%% Type: 6876 % Types: 6877 6611 6878 % @deftp category name args 6612 6879 \makedefun{deftp}#1 #2 #3\endheader{% … … 6636 6903 % 6637 6904 \def\defname#1#2#3{% 6905 \par 6638 6906 % Get the values of \leftskip and \rightskip as they were outside the @def... 6639 6907 \advance\leftskip by -\defbodyindent 6640 6908 % 6641 % How we'll format the type name. Putting it in brackets helps 6909 % Determine if we are typesetting the return type of a typed function 6910 % on a line by itself. 6911 \rettypeownlinefalse 6912 \ifdoingtypefn % doing a typed function specifically? 6913 % then check user option for putting return type on its own line: 6914 \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else 6915 \rettypeownlinetrue 6916 \fi 6917 \fi 6918 % 6919 % How we'll format the category name. Putting it in brackets helps 6642 6920 % distinguish it from the body text that may end up on the next line 6643 6921 % just below it. … … 6645 6923 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} 6646 6924 % 6647 % Figure out line sizes for the paragraph shape. 6925 % Figure out line sizes for the paragraph shape. We'll always have at 6926 % least two. 6927 \tempnum = 2 6928 % 6648 6929 % The first line needs space for \box0; but if \rightskip is nonzero, 6649 6930 % we need only space for the part of \box0 which exceeds it: 6650 6931 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip 6932 % 6933 % If doing a return type on its own line, we'll have another line. 6934 \ifrettypeownline 6935 \advance\tempnum by 1 6936 \def\maybeshapeline{0in \hsize}% 6937 \else 6938 \def\maybeshapeline{}% 6939 \fi 6940 % 6651 6941 % The continuations: 6652 6942 \dimen2=\hsize \advance\dimen2 by -\defargsindent 6653 % (plain.tex says that \dimen1 should be used only as global.) 6654 \parshape 2 0in \dimen0 \defargsindent \dimen2 6655 % 6656 % Put the type name to the right margin. 6943 % 6944 % The final paragraph shape: 6945 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 6946 % 6947 % Put the category name at the right margin. 6657 6948 \noindent 6658 6949 \hbox to 0pt{% … … 6676 6967 % one has made identifiers using them :). 6677 6968 \df \tt 6678 \def\temp{#2}% return value type 6679 \ifx\temp\empty\else \tclose{\temp} \fi 6969 \def\temp{#2}% text of the return type 6970 \ifx\temp\empty\else 6971 \tclose{\temp}% typeset the return type 6972 \ifrettypeownline 6973 % put return type on its own line; prohibit line break following: 6974 \hfil\vadjust{\nobreak}\break 6975 \else 6976 \space % type on same line, so just followed by a space 6977 \fi 6978 \fi % no return type 6680 6979 #3% output function name 6681 6980 }% … … 6795 7094 % To do this right we need a feature of e-TeX, \scantokens, 6796 7095 % which we arrange to emulate with a temporary file in ordinary TeX. 6797 \ifx\eTeXversion\ undefined7096 \ifx\eTeXversion\thisisundefined 6798 7097 \newwrite\macscribble 6799 7098 \def\scantokens#1{% … … 6806 7105 \fi 6807 7106 6808 \def\scanmacro#1{% 6809 \begingroup 6810 \newlinechar`\^^M 6811 \let\xeatspaces\eatspaces 6812 % Undo catcode changes of \startcontents and \doprintindex 6813 % When called from @insertcopying or (short)caption, we need active 6814 % backslash to get it printed correctly. Previously, we had 6815 % \catcode`\\=\other instead. We'll see whether a problem appears 6816 % with macro expansion. --kasal, 19aug04 6817 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ 6818 % ... and \example 6819 \spaceisspace 6820 % 6821 % Append \endinput to make sure that TeX does not see the ending newline. 6822 % I've verified that it is necessary both for e-TeX and for ordinary TeX 6823 % --kasal, 29nov03 6824 \scantokens{#1\endinput}% 6825 \endgroup 6826 } 7107 \def\scanmacro#1{\begingroup 7108 \newlinechar`\^^M 7109 \let\xeatspaces\eatspaces 7110 % 7111 % Undo catcode changes of \startcontents and \doprintindex 7112 % When called from @insertcopying or (short)caption, we need active 7113 % backslash to get it printed correctly. Previously, we had 7114 % \catcode`\\=\other instead. We'll see whether a problem appears 7115 % with macro expansion. --kasal, 19aug04 7116 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ 7117 % 7118 % ... and for \example: 7119 \spaceisspace 7120 % 7121 % The \empty here causes a following catcode 5 newline to be eaten as 7122 % part of reading whitespace after a control sequence. It does not 7123 % eat a catcode 13 newline. There's no good way to handle the two 7124 % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX 7125 % would then have different behavior). See the Macro Details node in 7126 % the manual for the workaround we recommend for macros and 7127 % line-oriented commands. 7128 % 7129 \scantokens{#1\empty}% 7130 \endgroup} 6827 7131 6828 7132 \def\scanexp#1{% … … 6878 7182 % Macro bodies are absorbed as an argument in a context where 6879 7183 % all characters are catcode 10, 11 or 12, except \ which is active 6880 % (as in normal texinfo). It is necessary to change the definition of \. 6881 7184 % (as in normal texinfo). It is necessary to change the definition of \ 7185 % to recognize macro arguments; this is the job of \mbodybackslash. 7186 % 6882 7187 % Non-ASCII encodings make 8-bit characters active, so un-activate 6883 7188 % them to avoid their expansion. Must do this non-globally, to 6884 7189 % confine the change to the current group. 6885 7190 % 6886 7191 % It's necessary to have hard CRs when the macro is executed. This is 6887 % done by 7192 % done by making ^^M (\endlinechar) catcode 12 when reading the macro 6888 7193 % body, and then making it the \newlinechar in \scanmacro. 6889 6890 \def\scanctxt{% 7194 % 7195 \def\scanctxt{% used as subroutine 6891 7196 \catcode`\"=\other 6892 7197 \catcode`\+=\other … … 6901 7206 } 6902 7207 6903 \def\scanargctxt{% 7208 \def\scanargctxt{% used for copying and captions, not macros. 6904 7209 \scanctxt 6905 7210 \catcode`\\=\other … … 6907 7212 } 6908 7213 6909 \def\macrobodyctxt{% 7214 \def\macrobodyctxt{% used for @macro definitions 6910 7215 \scanctxt 6911 7216 \catcode`\{=\other … … 6915 7220 } 6916 7221 6917 \def\macroargctxt{% 7222 \def\macroargctxt{% used when scanning invocations 6918 7223 \scanctxt 6919 \catcode`\\=\other 6920 } 7224 \catcode`\\=0 7225 } 7226 % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" 7227 % for the single characters \ { }. Thus, we end up with the "commands" 7228 % that would be written @\ @{ @} in a Texinfo document. 7229 % 7230 % We already have @{ and @}. For @\, we define it here, and only for 7231 % this purpose, to produce a typewriter backslash (so, the @\ that we 7232 % define for @math can't be used with @macro calls): 7233 % 7234 \def\\{\normalbackslash}% 7235 % 7236 % We would like to do this for \, too, since that is what makeinfo does. 7237 % But it is not possible, because Texinfo already has a command @, for a 7238 % cedilla accent. Documents must use @comma{} instead. 7239 % 7240 % \anythingelse will almost certainly be an error of some kind. 7241 6921 7242 6922 7243 % \mbodybackslash is the definition of \ in @macro bodies. … … 6925 7246 % We define \csname macarg.\endcsname to be \realbackslash, so 6926 7247 % \\ in macro replacement text gets you a backslash. 6927 7248 % 6928 7249 {\catcode`@=0 @catcode`@\=@active 6929 7250 @gdef@usembodybackslash{@let\=@mbodybackslash} … … 6932 7253 \expandafter\def\csname macarg.\endcsname{\realbackslash} 6933 7254 7255 \def\margbackslash#1{\char`\#1 } 7256 6934 7257 \def\macro{\recursivefalse\parsearg\macroxxx} 6935 7258 \def\rmacro{\recursivetrue\parsearg\macroxxx} 6936 7259 6937 7260 \def\macroxxx#1{% 6938 \getargs{#1}% 7261 \getargs{#1}% now \macname is the macname and \argl the arglist 6939 7262 \ifx\argl\empty % no arguments 6940 \paramno=0 %7263 \paramno=0\relax 6941 7264 \else 6942 7265 \expandafter\parsemargdef \argl;% 7266 \if\paramno>256\relax 7267 \ifx\eTeXversion\thisisundefined 7268 \errhelp = \EMsimple 7269 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} 7270 \fi 7271 \fi 6943 7272 \fi 6944 7273 \if1\csname ismacro.\the\macname\endcsname … … 6987 7316 \def\getargs#1{\getargsxxx#1{}} 6988 7317 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} 6989 \def\getmacname 7318 \def\getmacname#1 #2\relax{\macname={#1}} 6990 7319 \def\getmacargs#1{\def\argl{#1}} 6991 7320 7321 % For macro processing make @ a letter so that we can make Texinfo private macro names. 7322 \edef\texiatcatcode{\the\catcode`\@} 7323 \catcode `@=11\relax 7324 6992 7325 % Parse the optional {params} list. Set up \paramno and \paramlist 6993 % so \defmacro knows what to do. Define \macarg.blah for each blah 6994 % in the params list, to be ##N where N is the position in that list. 7326 % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH 7327 % in the params list to some hook where the argument si to be expanded. If 7328 % there are less than 10 arguments that hook is to be replaced by ##N where N 7329 % is the position in that list, that is to say the macro arguments are to be 7330 % defined `a la TeX in the macro body. 7331 % 6995 7332 % That gets used by \mbodybackslash (above). 6996 7333 % 6997 7334 % We need to get `macro parameter char #' into several definitions. 6998 % The technique used is stolen from LaTeX: 7335 % The technique used is stolen from LaTeX: let \hash be something 6999 7336 % unexpandable, insert that wherever you need a #, and then redefine 7000 7337 % it to # just before using the token list produced. … … 7002 7339 % The same technique is used to protect \eatspaces till just before 7003 7340 % the macro is used. 7004 7005 \def\parsemargdef#1;{\paramno=0\def\paramlist{}% 7006 \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} 7341 % 7342 % If there are 10 or more arguments, a different technique is used, where the 7343 % hook remains in the body, and when macro is to be expanded the body is 7344 % processed again to replace the arguments. 7345 % 7346 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the 7347 % argument N value and then \edef the body (nothing else will expand because of 7348 % the catcode regime underwhich the body was input). 7349 % 7350 % If you compile with TeX (not eTeX), and you have macros with 10 or more 7351 % arguments, you need that no macro has more than 256 arguments, otherwise an 7352 % error is produced. 7353 \def\parsemargdef#1;{% 7354 \paramno=0\def\paramlist{}% 7355 \let\hash\relax 7356 \let\xeatspaces\relax 7357 \parsemargdefxxx#1,;,% 7358 % In case that there are 10 or more arguments we parse again the arguments 7359 % list to set new definitions for the \macarg.BLAH macros corresponding to 7360 % each BLAH argument. It was anyhow needed to parse already once this list 7361 % in order to count the arguments, and as macros with at most 9 arguments 7362 % are by far more frequent than macro with 10 or more arguments, defining 7363 % twice the \macarg.BLAH macros does not cost too much processing power. 7364 \ifnum\paramno<10\relax\else 7365 \paramno0\relax 7366 \parsemmanyargdef@@#1,;,% 10 or more arguments 7367 \fi 7368 } 7007 7369 \def\parsemargdefxxx#1,{% 7008 7370 \if#1;\let\next=\relax 7009 7371 \else \let\next=\parsemargdefxxx 7010 \advance\paramno by 1 %7372 \advance\paramno by 1 7011 7373 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname 7012 7374 {\xeatspaces{\hash\the\paramno}}% … … 7014 7376 \fi\next} 7015 7377 7378 \def\parsemmanyargdef@@#1,{% 7379 \if#1;\let\next=\relax 7380 \else 7381 \let\next=\parsemmanyargdef@@ 7382 \edef\tempb{\eatspaces{#1}}% 7383 \expandafter\def\expandafter\tempa 7384 \expandafter{\csname macarg.\tempb\endcsname}% 7385 % Note that we need some extra \noexpand\noexpand, this is because we 7386 % don't want \the to be expanded in the \parsermacbody as it uses an 7387 % \xdef . 7388 \expandafter\edef\tempa 7389 {\noexpand\noexpand\noexpand\the\toks\the\paramno}% 7390 \advance\paramno by 1\relax 7391 \fi\next} 7392 7016 7393 % These two commands read recursive and nonrecursive macro bodies. 7017 7394 % (They're different since rec and nonrec macros end differently.) 7018 7395 % 7396 7397 \catcode `\@\texiatcatcode 7019 7398 \long\def\parsemacbody#1@end macro% 7020 7399 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% 7021 7400 \long\def\parsermacbody#1@end rmacro% 7022 7401 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% 7023 7024 % This defines the macro itself. There are six cases: recursive and 7025 % nonrecursive macros of zero, one, and many arguments. 7402 \catcode `\@=11\relax 7403 7404 \let\endargs@\relax 7405 \let\nil@\relax 7406 \def\nilm@{\nil@}% 7407 \long\def\nillm@{\nil@}% 7408 7409 % This macro is expanded during the Texinfo macro expansion, not during its 7410 % definition. It gets all the arguments values and assigns them to macros 7411 % macarg.ARGNAME 7412 % 7413 % #1 is the macro name 7414 % #2 is the list of argument names 7415 % #3 is the list of argument values 7416 \def\getargvals@#1#2#3{% 7417 \def\macargdeflist@{}% 7418 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. 7419 \def\paramlist{#2,\nil@}% 7420 \def\macroname{#1}% 7421 \begingroup 7422 \macroargctxt 7423 \def\argvaluelist{#3,\nil@}% 7424 \def\@tempa{#3}% 7425 \ifx\@tempa\empty 7426 \setemptyargvalues@ 7427 \else 7428 \getargvals@@ 7429 \fi 7430 } 7431 7432 % 7433 \def\getargvals@@{% 7434 \ifx\paramlist\nilm@ 7435 % Some sanity check needed here that \argvaluelist is also empty. 7436 \ifx\argvaluelist\nillm@ 7437 \else 7438 \errhelp = \EMsimple 7439 \errmessage{Too many arguments in macro `\macroname'!}% 7440 \fi 7441 \let\next\macargexpandinbody@ 7442 \else 7443 \ifx\argvaluelist\nillm@ 7444 % No more arguments values passed to macro. Set remaining named-arg 7445 % macros to empty. 7446 \let\next\setemptyargvalues@ 7447 \else 7448 % pop current arg name into \@tempb 7449 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% 7450 \expandafter\@tempa\expandafter{\paramlist}% 7451 % pop current argument value into \@tempc 7452 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% 7453 \expandafter\@tempa\expandafter{\argvaluelist}% 7454 % Here \@tempb is the current arg name and \@tempc is the current arg value. 7455 % First place the new argument macro definition into \@tempd 7456 \expandafter\macname\expandafter{\@tempc}% 7457 \expandafter\let\csname macarg.\@tempb\endcsname\relax 7458 \expandafter\def\expandafter\@tempe\expandafter{% 7459 \csname macarg.\@tempb\endcsname}% 7460 \edef\@tempd{\long\def\@tempe{\the\macname}}% 7461 \push@\@tempd\macargdeflist@ 7462 \let\next\getargvals@@ 7463 \fi 7464 \fi 7465 \next 7466 } 7467 7468 \def\push@#1#2{% 7469 \expandafter\expandafter\expandafter\def 7470 \expandafter\expandafter\expandafter#2% 7471 \expandafter\expandafter\expandafter{% 7472 \expandafter#1#2}% 7473 } 7474 7475 % Replace arguments by their values in the macro body, and place the result 7476 % in macro \@tempa 7477 \def\macvalstoargs@{% 7478 % To do this we use the property that token registers that are \the'ed 7479 % within an \edef expand only once. So we are going to place all argument 7480 % values into respective token registers. 7481 % 7482 % First we save the token context, and initialize argument numbering. 7483 \begingroup 7484 \paramno0\relax 7485 % Then, for each argument number #N, we place the corresponding argument 7486 % value into a new token list register \toks#N 7487 \expandafter\putargsintokens@\saveparamlist@,;,% 7488 % Then, we expand the body so that argument are replaced by their 7489 % values. The trick for values not to be expanded themselves is that they 7490 % are within tokens and that tokens expand only once in an \edef . 7491 \edef\@tempc{\csname mac.\macroname .body\endcsname}% 7492 % Now we restore the token stack pointer to free the token list registers 7493 % which we have used, but we make sure that expanded body is saved after 7494 % group. 7495 \expandafter 7496 \endgroup 7497 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% 7498 } 7499 7500 \def\macargexpandinbody@{% 7501 %% Define the named-macro outside of this group and then close this group. 7502 \expandafter 7503 \endgroup 7504 \macargdeflist@ 7505 % First the replace in body the macro arguments by their values, the result 7506 % is in \@tempa . 7507 \macvalstoargs@ 7508 % Then we point at the \norecurse or \gobble (for recursive) macro value 7509 % with \@tempb . 7510 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname 7511 % Depending on whether it is recursive or not, we need some tailing 7512 % \egroup . 7513 \ifx\@tempb\gobble 7514 \let\@tempc\relax 7515 \else 7516 \let\@tempc\egroup 7517 \fi 7518 % And now we do the real job: 7519 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% 7520 \@tempd 7521 } 7522 7523 \def\putargsintokens@#1,{% 7524 \if#1;\let\next\relax 7525 \else 7526 \let\next\putargsintokens@ 7527 % First we allocate the new token list register, and give it a temporary 7528 % alias \@tempb . 7529 \toksdef\@tempb\the\paramno 7530 % Then we place the argument value into that token list register. 7531 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname 7532 \expandafter\@tempb\expandafter{\@tempa}% 7533 \advance\paramno by 1\relax 7534 \fi 7535 \next 7536 } 7537 7538 % Save the token stack pointer into macro #1 7539 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} 7540 % Restore the token stack pointer from number in macro #1 7541 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} 7542 % newtoks that can be used non \outer . 7543 \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} 7544 7545 % Tailing missing arguments are set to empty 7546 \def\setemptyargvalues@{% 7547 \ifx\paramlist\nilm@ 7548 \let\next\macargexpandinbody@ 7549 \else 7550 \expandafter\setemptyargvaluesparser@\paramlist\endargs@ 7551 \let\next\setemptyargvalues@ 7552 \fi 7553 \next 7554 } 7555 7556 \def\setemptyargvaluesparser@#1,#2\endargs@{% 7557 \expandafter\def\expandafter\@tempa\expandafter{% 7558 \expandafter\def\csname macarg.#1\endcsname{}}% 7559 \push@\@tempa\macargdeflist@ 7560 \def\paramlist{#2}% 7561 } 7562 7563 % #1 is the element target macro 7564 % #2 is the list macro 7565 % #3,#4\endargs@ is the list value 7566 \def\pop@#1#2#3,#4\endargs@{% 7567 \def#1{#3}% 7568 \def#2{#4}% 7569 } 7570 \long\def\longpop@#1#2#3,#4\endargs@{% 7571 \long\def#1{#3}% 7572 \long\def#2{#4}% 7573 } 7574 7575 % This defines a Texinfo @macro. There are eight cases: recursive and 7576 % nonrecursive macros of zero, one, up to nine, and many arguments. 7026 7577 % Much magic with \expandafter here. 7027 7578 % \xdef is used so that macro definitions will survive the file 7028 7579 % they're defined in; @include reads the file inside a group. 7580 % 7029 7581 \def\defmacro{% 7030 7582 \let\hash=##% convert placeholders to macro parameter chars … … 7041 7593 \expandafter\xdef\csname\the\macname xxx\endcsname##1{% 7042 7594 \egroup\noexpand\scanmacro{\temp}}% 7043 \else % many 7044 \expandafter\xdef\csname\the\macname\endcsname{% 7045 \bgroup\noexpand\macroargctxt 7046 \noexpand\csname\the\macname xx\endcsname}% 7047 \expandafter\xdef\csname\the\macname xx\endcsname##1{% 7048 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% 7049 \expandafter\expandafter 7050 \expandafter\xdef 7051 \expandafter\expandafter 7052 \csname\the\macname xxx\endcsname 7053 \paramlist{\egroup\noexpand\scanmacro{\temp}}% 7595 \else 7596 \ifnum\paramno<10\relax % at most 9 7597 \expandafter\xdef\csname\the\macname\endcsname{% 7598 \bgroup\noexpand\macroargctxt 7599 \noexpand\csname\the\macname xx\endcsname}% 7600 \expandafter\xdef\csname\the\macname xx\endcsname##1{% 7601 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% 7602 \expandafter\expandafter 7603 \expandafter\xdef 7604 \expandafter\expandafter 7605 \csname\the\macname xxx\endcsname 7606 \paramlist{\egroup\noexpand\scanmacro{\temp}}% 7607 \else % 10 or more 7608 \expandafter\xdef\csname\the\macname\endcsname{% 7609 \noexpand\getargvals@{\the\macname}{\argl}% 7610 }% 7611 \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp 7612 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble 7613 \fi 7054 7614 \fi 7055 7615 \else … … 7068 7628 \noexpand\norecurse{\the\macname}% 7069 7629 \noexpand\scanmacro{\temp}\egroup}% 7070 \else % many 7071 \expandafter\xdef\csname\the\macname\endcsname{% 7072 \bgroup\noexpand\macroargctxt 7073 \expandafter\noexpand\csname\the\macname xx\endcsname}% 7074 \expandafter\xdef\csname\the\macname xx\endcsname##1{% 7075 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% 7076 \expandafter\expandafter 7077 \expandafter\xdef 7078 \expandafter\expandafter 7079 \csname\the\macname xxx\endcsname 7080 \paramlist{% 7081 \egroup 7082 \noexpand\norecurse{\the\macname}% 7083 \noexpand\scanmacro{\temp}\egroup}% 7630 \else % at most 9 7631 \ifnum\paramno<10\relax 7632 \expandafter\xdef\csname\the\macname\endcsname{% 7633 \bgroup\noexpand\macroargctxt 7634 \expandafter\noexpand\csname\the\macname xx\endcsname}% 7635 \expandafter\xdef\csname\the\macname xx\endcsname##1{% 7636 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% 7637 \expandafter\expandafter 7638 \expandafter\xdef 7639 \expandafter\expandafter 7640 \csname\the\macname xxx\endcsname 7641 \paramlist{% 7642 \egroup 7643 \noexpand\norecurse{\the\macname}% 7644 \noexpand\scanmacro{\temp}\egroup}% 7645 \else % 10 or more: 7646 \expandafter\xdef\csname\the\macname\endcsname{% 7647 \noexpand\getargvals@{\the\macname}{\argl}% 7648 }% 7649 \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp 7650 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse 7651 \fi 7084 7652 \fi 7085 7653 \fi} 7654 7655 \catcode `\@\texiatcatcode\relax 7086 7656 7087 7657 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} … … 7090 7660 % {. If so it reads up to the closing }, if not, it reads the whole 7091 7661 % line. Whatever was read is then fed to the next control sequence 7092 % as an argument (by \parsebrace or \parsearg) 7662 % as an argument (by \parsebrace or \parsearg). 7663 % 7093 7664 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} 7094 7665 \def\braceorlinexxx{% … … 7100 7671 % @alias. 7101 7672 % We need some trickery to remove the optional spaces around the equal 7102 % sign. Just make them active and then expand them all to nothing. 7673 % sign. Make them active and then expand them all to nothing. 7674 % 7103 7675 \def\alias{\parseargusing\obeyspaces\aliasxxx} 7104 7676 \def\aliasxxx #1{\aliasyyy#1\relax} … … 7121 7693 % @inforef is relatively simple. 7122 7694 \def\inforef #1{\inforefzzz #1,,,,**} 7123 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, 7695 \def\inforefzzz #1,#2,#3,#4**{% 7696 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, 7124 7697 node \samp{\ignorespaces#1{}}} 7125 7698 … … 7182 7755 \immediate \writexrdef{title}{\the\toks0 }% 7183 7756 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. 7184 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during\shipout7757 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout 7185 7758 }% 7186 7759 \fi 7187 7760 } 7761 7762 % @xrefautosectiontitle on|off says whether @section(ing) names are used 7763 % automatically in xrefs, if the third arg is not explicitly specified. 7764 % This was provided as a "secret" @set xref-automatic-section-title 7765 % variable, now it's official. 7766 % 7767 \parseargdef\xrefautomaticsectiontitle{% 7768 \def\temp{#1}% 7769 \ifx\temp\onword 7770 \expandafter\let\csname SETxref-automatic-section-title\endcsname 7771 = \empty 7772 \else\ifx\temp\offword 7773 \expandafter\let\csname SETxref-automatic-section-title\endcsname 7774 = \relax 7775 \else 7776 \errhelp = \EMsimple 7777 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', 7778 must be on|off}% 7779 \fi\fi 7780 } 7781 7188 7782 7189 7783 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is … … 7203 7797 \ifdim \wd0 = 0pt 7204 7798 % No printed node name was explicitly given. 7205 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax7799 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax 7206 7800 % Use the node name inside the square brackets. 7207 7801 \def\printedrefname{\ignorespaces #1}% … … 7358 7952 \iflinks 7359 7953 \ifhavexrefs 7360 \message{\linenumber Undefined cross reference `#1'.}% 7954 {\toks0 = {#1}% avoid expansion of possibly-complex value 7955 \message{\linenumber Undefined cross reference `\the\toks0'.}}% 7361 7956 \else 7362 7957 \ifwarnedxrefs\else … … 7522 8117 \def\supereject{\par\penalty -20000\footnoteno =0 } 7523 8118 7524 % @footnotestyle is meaningful for info output only.8119 % @footnotestyle is meaningful for Info output only. 7525 8120 \let\footnotestyle=\comment 7526 8121 … … 7585 8180 % provide a place where TeX can split the footnote. 7586 8181 \footstrut 8182 % 8183 % Invoke rest of plain TeX footnote routine. 7587 8184 \futurelet\next\fo@t 7588 8185 } … … 7672 8269 % 7673 8270 \def\image#1{% 7674 \ifx\epsfbox\ undefined8271 \ifx\epsfbox\thisiundefined 7675 8272 \ifwarnednoepsf \else 7676 8273 \errhelp = \noepsfhelp … … 7688 8285 % #4 is (ignored optional) html alt text. 7689 8286 % #5 is (ignored optional) extension. 7690 % #6 is just the usual extra ignored arg for parsing thisstuff.8287 % #6 is just the usual extra ignored arg for parsing stuff. 7691 8288 \newif\ifimagevmode 7692 8289 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup … … 8137 8734 % Latin1 (ISO-8859-1) character definitions. 8138 8735 \def\latonechardefs{% 8139 \gdef^^a0{ ~}8736 \gdef^^a0{\tie} 8140 8737 \gdef^^a1{\exclamdown} 8141 8738 \gdef^^a2{\missingcharmsg{CENT SIGN}} … … 8167 8764 \gdef^^ba{\ordm} 8168 8765 % 8169 \gdef^^bb{\guille tright}8766 \gdef^^bb{\guillemetright} 8170 8767 \gdef^^bc{$1\over4$} 8171 8768 \gdef^^bd{$1\over2$} … … 8259 8856 % Latin2 (ISO-8859-2) character definitions. 8260 8857 \def\lattwochardefs{% 8261 \gdef^^a0{ ~}8858 \gdef^^a0{\tie} 8262 8859 \gdef^^a1{\ogonek{A}} 8263 8860 \gdef^^a2{\u{}} … … 8340 8937 \gdef^^eb{\"e} 8341 8938 \gdef^^ec{\v e} 8342 \gdef^^ed{\' \i}8343 \gdef^^ee{\^ \i}8939 \gdef^^ed{\'{\dotless{i}}} 8940 \gdef^^ee{\^{\dotless{i}}} 8344 8941 \gdef^^ef{\v d} 8345 8942 % … … 8432 9029 \gdef\DeclareUnicodeCharacter#1#2{% 8433 9030 \countUTFz = "#1\relax 8434 \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%9031 %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% 8435 9032 \begingroup 8436 9033 \parseXMLCharref … … 8900 9497 \vbadness = 10000 8901 9498 8902 % Don't be sofinicky about underfull hboxes, either.8903 \hbadness = 20009499 % Don't be very finicky about underfull hboxes, either. 9500 \hbadness = 6666 8904 9501 8905 9502 % Following George Bush, get rid of widows and orphans. … … 9108 9705 \message{and turning on texinfo input format.} 9109 9706 9707 \def^^L{\par} % remove \outer, so ^L can appear in an @comment 9708 9110 9709 % DEL is a comment character, in case @c does not suffice. 9111 9710 \catcode`\^^? = 14 9112 9711 9113 9712 % Define macros to output various characters with catcode for normal text. 9114 \catcode`\"=\other 9115 \catcode`\~=\other 9116 \catcode`\^=\other 9117 \catcode`\_=\other 9118 \catcode`\|=\other 9119 \catcode`\<=\other 9120 \catcode`\>=\other 9121 \catcode`\+=\other 9122 \catcode`\$=\other 9123 \def\normaldoublequote{"} 9124 \def\normaltilde{~} 9125 \def\normalcaret{^} 9126 \def\normalunderscore{_} 9127 \def\normalverticalbar{|} 9128 \def\normalless{<} 9129 \def\normalgreater{>} 9130 \def\normalplus{+} 9131 \def\normaldollar{$}%$ font-lock fix 9713 \catcode`\"=\other \def\normaldoublequote{"} 9714 \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix 9715 \catcode`\+=\other \def\normalplus{+} 9716 \catcode`\<=\other \def\normalless{<} 9717 \catcode`\>=\other \def\normalgreater{>} 9718 \catcode`\^=\other \def\normalcaret{^} 9719 \catcode`\_=\other \def\normalunderscore{_} 9720 \catcode`\|=\other \def\normalverticalbar{|} 9721 \catcode`\~=\other \def\normaltilde{~} 9132 9722 9133 9723 % This macro is used to make a character print one way in \tt … … 9222 9812 % 9223 9813 @def@normalturnoffactive{% 9814 @let"=@normaldoublequote 9815 @let$=@normaldollar %$ font-lock fix 9816 @let+=@normalplus 9817 @let<=@normalless 9818 @let>=@normalgreater 9224 9819 @let\=@normalbackslash 9225 @let"=@normaldoublequote9226 @let~=@normaltilde9227 9820 @let^=@normalcaret 9228 9821 @let_=@normalunderscore 9229 9822 @let|=@normalverticalbar 9230 @let<=@normalless 9231 @let>=@normalgreater 9232 @let+=@normalplus 9233 @let$=@normaldollar %$ font-lock fix 9823 @let~=@normaltilde 9234 9824 @markupsetuplqdefault 9235 9825 @markupsetuprqdefault … … 9263 9853 @escapechar = `@@ 9264 9854 9855 % These (along with & and #) are made active for url-breaking, so need 9856 % active definitions as the normal characters. 9857 @def@normaldot{.} 9858 @def@normalquest{?} 9859 @def@normalslash{/} 9860 9265 9861 % These look ok in all fonts, so just make them not special. 9266 @catcode`@& = @other 9267 @catcode`@# = @other 9268 @catcode`@% = @other 9862 @catcode`@& = @other @def@normalamp{&} 9863 @catcode`@# = @other @def@normalhash{#} 9864 @catcode`@% = @other @def@normalpercent{%} 9269 9865 9270 9866 @c Finally, make ` and ' active, so that txicodequoteundirected and
Note: See TracChangeset
for help on using the changeset viewer.