node_section_re = re.compile (r'@(node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading)( )(.*?)(\n)')
menu_entry_re = re.compile (r'\* (.*?)::')
-# Why not use recode?
-# - well, it would add one more dependency...
-accents2texi = (
- ("á", "@'a"),
- ("à", "@`a"),
- ("â", "@^a"),
- ("ä", "@\"a"),
- ("é", "@'e"),
- ("è", "@`e"),
- ("ê", "@^e"),
- ("ë", "@\"e"),
- ("ó", "@'o"),
- ("ò", "@`o"),
- ("ô", "@^o"),
- ("ö", "@\"o"),
- ("ú", "@'u"),
- ("ù", "@`u"),
- ("û", "@^u"),
- ("ü", "@\"u"),
- ("ç", "@,{c}"),
- ("À", "@`A"),
- ("Á", "@'A"),
- ("Â", "@^A"),
- ("Ä", "@\"A"),
- ("É", "@'E"),
- ("È", "@`E"),
- ("Ê", "@^E"),
- ("Ë", "@\"E"),
- ("Ó", "@'O"),
- ("Ò", "@`O"),
- ("Ô", "@^O"),
- ("Ö", "@\"O"),
- ("Ú ", "@'U"),
- ("Ù", "@`U"),
- ("Û", "@^U"),
- ("Ü", "@\"U"),
- ("Ç", "@,{C}"),
- ("Í", "@'{@dotless{i}}"),
- ("ì", "@`{@dotless{i}}"),
- ("î", "@^{@dotless{i}}"),
- ("ï", "@\"{@dotless{i}}"),
- ("Í", "@'I"),
- ("Ì", "@`I"),
- ("Î", "@^I"),
- ("Ï", "@\"I"),
- ("œ", "@oe{}"),
- ("Œ", "@OE{}"),
- ("æ", "@ae{}"),
- ("Æ", "@AE{}"),
- ("¡", "@exclamdown{}"),
- ("¿", "@questiondown{}"),
- ("ø", "@o{}"),
- ("Ø", "@O{}"),
- ("ß", "@ss{}"),
- ("ł", "@l{}"),
- ("Ł", "@L{}"),
- ("å", "@aa{}"),
- ("Å", "@AA{}"))
-
-
def title_gettext (m):
if m.group (2) == '{':
r = whitespaces.sub (' ', m.group (3))
page = page.replace ('UNTRANSLATED NODE: IGNORE ME', _doc ("This section has not been translated yet; please refer to the manual in English."))
includes = include_re.findall (page)
page = include_re.sub (lambda m: include_replace (m, filename), page)
- for (u_char, texiaccent_char) in accents2texi:
- page = page.replace (u_char, texiaccent_char)
p = os.path.join (outdir, filename) [:-4] + 'pdftexi'
f = open (p, 'w')
f.write (page)
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2007-05-04.09}
+\def\texinfoversion{2007-06-26.23}
%
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
% regular 0x27.
%
\def\codequoteright{%
- \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
- '%
- \else
- \char'15
- \fi
+ \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else \char'15 \fi
+ \else \char'15 \fi
}
%
% and a similar option for the left quote char vs. a grave accent.
% the code environments to do likewise.
%
\def\codequoteleft{%
- \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
- `%
- \else
- \char'22
- \fi
+ \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+ \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+ `%
+ \else \char'22 \fi
+ \else \char'22 \fi
}
%
\begingroup
% all characters are catcode 10, 11 or 12, except \ which is active
% (as in normal texinfo). It is necessary to change the definition of \.
+% Non-ASCII encodings make 8-bit characters active, so un-activate
+% them to avoid their expansion. Must do this non-globally, to
+% confine the change to the current group.
+
% It's necessary to have hard CRs when the macro is executed. This is
% done by making ^^M (\endlinechar) catcode 12 when reading the macro
% body, and then making it the \newlinechar in \scanmacro.
\catcode`\_=\other
\catcode`\|=\other
\catcode`\~=\other
+ \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
}
\def\scanargctxt{%
% @documentlanguage is usually given very early, just after
% @setfilename. If done too late, it may not override everything
-% properly. Single argument is the language abbreviation.
-% It would be nice if we could set up a hyphenation file here.
+% properly. Single argument is the language (de) or locale (de_DE)
+% abbreviation. It would be nice if we could set up a hyphenation file.
%
-\parseargdef\documentlanguage{%
+{
+ \catcode`\_ = \active
+ \globaldefs=1
+\parseargdef\documentlanguage{\begingroup
+ \let_=\normalunderscore % normal _ character for filenames
\tex % read txi-??.tex file in plain TeX.
- % Read the file if it exists.
+ % Read the file by the name they passed if it exists.
\openin 1 txi-#1.tex
\ifeof 1
- \errhelp = \nolanghelp
- \errmessage{Cannot read language file txi-#1.tex}%
+ \documentlanguagetrywithoutunderscore{#1_\finish}%
\else
\input txi-#1.tex
\fi
\closein 1
\endgroup
+\endgroup}
+}
+%
+% If they passed de_DE, and txi-de_DE.tex doesn't exist,
+% try txi-de.tex.
+%
+\def\documentlanguagetrywithoutunderscore#1_#2\finish{%
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \else
+ \input txi-#1.tex
+ \fi
+ \closein 1
}
+%
\newhelp\nolanghelp{The given language definition file cannot be found or
is empty. Maybe you need to install it? In the current directory
should work if nowhere else does.}
\repeat
}
+\def\setnonasciicharscatcodenonglobal#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \catcode\count255=#1
+ \advance\count255 by 1
+ \repeat
+}
+
% @documentencoding sets the definition of non-ASCII characters
% according to the specified encoding.
%
\ifpdf
\pdfpageheight #7\relax
\pdfpagewidth #8\relax
+ % if we don't reset these, they will remain at "1 true in" of
+ % whatever layout pdftex was dumped with.
+ \pdfhorigin = 1 true in
+ \pdfvorigin = 1 true in
\fi
%
\setleading{\textleading}