[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texi2dvi changes the behavior of ~

From: Akim Demaille
Subject: texi2dvi changes the behavior of ~
Date: Mon, 4 May 2009 18:08:41 +0200

Hi all,

texi2dvi has code that looks like this:

  # we'd like to handle arbitrary input file names, especially
  # foo~bar/a~b.tex, since Debian likes ~ characters.
  if $catcode_special; then
    # $normaltilde is just to reduce line length in this source file.
# The idea is to define \normaltilde as a catcode other ~ character, # then make the active ~ be equivalent to that, instead of the plain
    # TeX tie.  Then when the active ~ appears in the filename, it will
    # be expanded to itself, as far as \input will see.  (This is the
    # same thing that texinfo.tex does in general, BTW.)
normaltilde="${escape}catcode126=12 ${escape}def$ {escape}normaltilde{~}" cmd="$cmd '$normaltilde${escape}catcode126=13 ${escape}let~ \normaltilde '"

which is enabled by default (catcode_special=true), therefore, a call such as:

        texi2pdf foo.tex

actually calls something like

pdflatex '\catcode126=12 \def\normaltilde{~}\catcode126=13 \let~ \normaltilde ' '\input' foo.tex

As a result:

$ cat foo.tex
$ pdflatex '\catcode126=12 \def\normaltilde{~}\catcode126=13 \let~ \normaltilde ' '\input' foo.tex
This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
entering extended mode
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish, french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian, swedish,
turkish, ukenglish, ukrainian, loaded.
(./foo.tex (/opt/local/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/opt/local/share/texmf-dist/tex/latex/base/size10.clo)) (./foo.aux) [1{/opt/lo cal/share/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./foo.aux) )</ opt/local/s
Output written on foo.pdf (1 page, 4604 bytes).
Transcript written on foo.log.
$ pdftotext foo.pdf
$ cat foo.txt


i.e., the tilda, which is a nonbreakable space, becomes visible. This is especially visible when using hyperref's autoref feature which generate "section~\ref{sec.foo}" for "\autoref{sec.foo}".

How is this code expected to disable the magic tricks it plays with ~?

Thanks in advance.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]