Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
On Wed, Oct 29, 2008 at 05:19:56PM -0500, Karl Berry wrote: I reverted my change. Oleg says he's working on the more complex fix. Sorry for such a delayed reply. I've checked in the fixes. Would be nice to have them tested as they are pretty invasive. Thanks, Oleg
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
Hi Karl, On 2008/10/28 17:03 -0500, Karl Berry wrote: Maybe we could make ` and ' active all the time, like and other characters are now. I changed texinfo.tex (in CVS and gnulib and ftp://tug.org/tex/texinfo.tex) to do this, so your backticks should show up universally now. Fingers crossed ... Using latest texinfo.tex, TeX barfs on LilyPond learning manual in English. Here's the relevant part of the log: ./lilypond-learning.cps:12: Missing number, treated as zero. to be read again \char '...sname \relax '\else \char '15 \fi \else \char '15 \fi argument \xeatspaces {\char ' 15 } \tclose ...on \rawbackslash \plainfrenchspacing #1 }\null \codex #1-\tclose {#1} \endgroup l.12 \entry {\code {\xeatspaces {\char '15 }} }{13} A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.) ... and here are the first lines of lilypond-learning.cps: \initial {!} \entry {\code {\xeatspaces {!}}}{21} \initial {#} \entry {\code {\xeatspaces {#}}}{173} \entry {\code {\xeatspaces {##f}}}{173} \entry {\code {\xeatspaces {##t}}}{173} \entry {\code {\xeatspaces {#'symbol}}}{174} \initial {%} \entry {\code {\xeatspaces {%}}}{16} \entry {\code {\xeatspaces {%{\tt \char 123} ... %{\tt \char 125{16} \initial {'} \entry {\code {\xeatspaces {\char '15 }}}{13} \initial {(} \entry {\code {\xeatspaces {( ... )}}}{19} If this isn't enough to investigate and fix this, let me know and I'll try to provide a minimal Texinfo source that reproduces this. Best, John
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
\entry {\code {\xeatspaces {\char '15 }}}{13} Sigh. These kinds of index entries are so wrong, and so hard to eradicate. I reverted my change. Oleg says he's working on the more complex fix. Thanks, karl
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
Reinhold. Maybe we could make ` and ' active all the time, like and other characters are now. I changed texinfo.tex (in CVS and gnulib and ftp://tug.org/tex/texinfo.tex) to do this, so your backticks should show up universally now. Fingers crossed ... Thanks, Karl
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am Donnerstag, 23. Oktober 2008 schrieb Karl Berry: It is actually active all the time by default, Maybe in your manual. Unless I'm totally off (always possible), in standard Texinfo, ' and ` are only made active inside @code. Actually, the manual tells a different story (and a run of texi2pdf confirms this): http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Inserting-Quote-Characters By default ` and ' are active, even inside @code. However, inside @code you sometimes don't want the replacements, so you can turn them off by using @set txicodequoteundirected That is what causes the behavior you're seeing. Actually, we are setting @set txicodequoteundirected right at the very beginning of our manual, because we don't want those replacements at all... Cheers, Reinhold - -- - -- Reinhold Kainhofer, Vienna University of Technology, Austria email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/ * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/ * K Desktop Environment, http://www.kde.org, KOrganizer maintainer * Chorvereinigung Jung-Wien, http://www.jung-wien.at/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFJAa9ATqjEwhXvPN0RAr9jAJ9Mf4L8OjbVmM0f7PvbflWqC23V0ACeK6kt gX8FskEuZ68ZcFwgnpto3eE= =U8hb -END PGP SIGNATURE-
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
By default ` and ' are active, even inside @code. only Never mind, we're talking in circles. I'll look at the actual problem as soon as I have a chance.
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
On Thu, Oct 23, 2008 at 12:16:48PM -0500, Karl Berry wrote: -\def\codex #1{\tclose{#1}\endgroup} +\def\codex #1{\tclose{\scantokens{#1}}\endgroup} I am scared of this change. Yeah, I was concerned about it as well... Maybe we could make ` and ' active all the time, like and other characters are now. You mean this: @@ -9010,6 +9010,11 @@ @[EMAIL PROTECTED] = @other @[EMAIL PROTECTED] = @other [EMAIL PROTECTED] Finally, make ` and ' active, so that txicodequoteundirected and [EMAIL PROTECTED] txicodequotebacktick work right in, say, @[EMAIL PROTECTED] b c'}}: if we [EMAIL PROTECTED] don't make ` and ' active, @code will not get them as active chars. [EMAIL PROTECTED]@'[EMAIL PROTECTED] @let'@rq [EMAIL PROTECTED]@[EMAIL PROTECTED] @c ` is already defined above. @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) I've tested it a bit, seems to work even inside indices. Can you think of situations where this change might cause trouble? I couldn't find anything suspicious in texinfo.tex. Best, Oleg
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
@[EMAIL PROTECTED] code inside w: c'}} produces a curly quote @[EMAIL PROTECTED] w inside code: c'}} produces a straigth quote Sigh. I don't have a good answer for you. The cause is the catcodes being set at the wrong time (in this case), which is a fundamental attribute of TeX. Can you just use the form you want? -\def\codex #1{\tclose{#1}\endgroup} +\def\codex #1{\tclose{\scantokens{#1}}\endgroup} I am scared of this change. For one thing, if we're not running e-tex, it will cause a temp file to be written and read on every @code (and similar) command. That seems incredibly painful. I also wonder about nested commands requiring \scantokens. (I wonder about that now, in fact.) Maybe we could make ` and ' active all the time, like and other characters are now. karl
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am Donnerstag, 23. Oktober 2008 schrieb Karl Berry: @[EMAIL PROTECTED] code inside w: c'}} produces a curly quote @[EMAIL PROTECTED] w inside code: c'}} produces a straigth quote Sigh. I don't have a good answer for you. The cause is the catcodes being set at the wrong time (in this case), which is a fundamental attribute of TeX. Can you just use the form you want? for the @[EMAIL PROTECTED] we already changed it as a workaround. However, we have some @[EMAIL PROTECTED] (that macro is defined as in the sample file of my first mail) and we apparently cannot change this... I am scared of this change. For one thing, if we're not running e-tex, it will cause a temp file to be written and read on every @code (and similar) command. That seems incredibly painful. Yes, that doesn't sound like a proper solution :( Maybe we could make ` and ' active all the time, like and other characters are now. It is actually active all the time by default, but we need to deactivate it completely, since ' is the octave indicator for note pitches and thus must not appear as a curly quote! In particular, in standard music notation used practivally everywhere (and thus also in LilyPond) c' or do' is the note an octave up from c or do and c'' or do'' is the note an further octave up. The problem only shows when we try to disable curly quotes altogether. Cheers, Reinhold - -- - -- Reinhold Kainhofer, Vienna University of Technology, Austria email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/ * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/ * K Desktop Environment, http://www.kde.org, KOrganizer maintainer * Chorvereinigung Jung-Wien, http://www.jung-wien.at/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFJAMKXTqjEwhXvPN0RAl/bAJ9r7eQL5RchMZJydG7lMi0O0eABFACfVMs6 iJHzxqEWb7i5OnKZDWUB8EU= =p3Ue -END PGP SIGNATURE-
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
It is actually active all the time by default, Maybe in your manual. Unless I'm totally off (always possible), in standard Texinfo, ' and ` are only made active inside @code. That is what causes the behavior you're seeing. Anyway, I'll look at it, but don't hold your breath. Thanks, karl
Re: Smart quote replacement in texi2pdf broken with nested @code and @warning / @w
On Fri, Oct 17, 2008 at 04:49:33PM +0200, Reinhold Kainhofer wrote: @[EMAIL PROTECTED] code inside w: c'}} produces a curly quote @[EMAIL PROTECTED] w inside code: c'}} produces a straigth quote This patch fixes it: @@ -2519,7 +2519,9 @@ \discretionary{}{}{}}% {\_}% } -\def\codex #1{\tclose{#1}\endgroup} +% \scantokens will get catcodes right if @code occurs in an +% argument, e.g., in @[EMAIL PROTECTED] or @[EMAIL PROTECTED] +\def\codex #1{\tclose{\scantokens{#1}}\endgroup} % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is undesirable in Best, Oleg