On Fri, Nov 11, 2022 at 11:48:47AM +0100, Patrice Dumas wrote: > On Fri, Nov 11, 2022 at 08:47:32AM +0000, Werner LEMBERG wrote: > > > > [texinfo.tex 2022-11-07.17] > > > > > > I suggest to change the mapping for U+00B0 (DEGREE SIGN) to use > > `@textdegree{}`. > > > > ``` > > \input texinfo > > > > @code{45°} > > > > @code{45@textdegree{}} > > > > @bye > > ``` > > It is better to be consistent in my opinion. Here is a proposed patch, > it does not use @textdegree but leads to the same output as @textdegree{}. > It fails in @math{}, but the preceding mapping also failed in @math.
Note that there are also definitions for Latin-1 and Latin-2 which already use @textdegree. I don't know what the original reasoning was behind using \ringaccent. A fixed width degree sign can be got with a little difficulty. It's only worth doing this if somebody is actually using degree signs in a fixed width context - I don't have much interest in fixing this for all of the character definitions. Please test the patch at the end of this mail. Sample input: 45° @code{45°} 45@textdegree{} @code{45°} @math{45°} @example aaaaaa 45°aaa aaaaaa @end example diff --git a/doc/texinfo.tex b/doc/texinfo.tex index b1bf41ff56..2e4b4a9e65 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -3691,7 +3691,9 @@ $$% % @textdegree - the normal degrees sign. % -\def\textdegree{$^\circ$} +\def\textdegree{\ifusingtt + {\hbox to \fontdimen2\font {\ensuremath{^\circ}\hfil}}% + {\ensuremath{^\circ}}} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 @@ -10063,7 +10065,7 @@ directory should work if nowhere else does.} \gdefchar^^ae{\v Z} \gdefchar^^af{\dotaccent Z} % - \gdefchar^^b0{\textdegree{}} + \gdefchar^^b0{\textdegree} \gdefchar^^b1{\ogonek{a}} \gdefchar^^b2{\ogonek{ }} \gdefchar^^b3{\l} @@ -10486,7 +10488,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% \DeclareUnicodeCharacter{00AF}{\={ }}% % - \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% + \DeclareUnicodeCharacter{00B0}{\textdegree} \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% \DeclareUnicodeCharacter{00B2}{$^2$}% \DeclareUnicodeCharacter{00B3}{$^3$}%