help-texinfo
[Top][All Lists]
Advanced

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

Re: [help-texinfo] Inserting the degree symbol


From: Karl Berry
Subject: Re: [help-texinfo] Inserting the degree symbol
Date: Sat, 26 Aug 2006 19:21:34 -0500

    Is it possible to insert the degree symbol [1] in a Texinfo document?
    And if it is, how?

    [1] http://en.wikipedia.org/wiki/%C2%B0

Here's a patch to implement @textdegree{}.  It'll be in the next release
(no ETA, sorry).

It just produces an "o" for non-encoded Info output and plain text.  If
you think something else would be better ("degrees"?), let me know ...

Best,
Karl


Index: texinfo.tex
===================================================================
RCS file: /sources/texinfo/texinfo/doc/texinfo.tex,v
retrieving revision 1.219
diff -c -r1.219 texinfo.tex
*** texinfo.tex 12 Aug 2006 13:38:10 -0000      1.219
--- texinfo.tex 27 Aug 2006 00:07:51 -0000
***************
*** 2301,2306 ****
--- 2301,2310 ----
      }$%
  }
  
+ % @textdegree - the normal degrees sign.
+ %
+ \def\textdegree{$^\circ$}
+ 
  % Laurent Siebenmann reports \Orb undefined with:
  %  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
  % so we'll define it if necessary.
***************
*** 3524,3529 ****
--- 3528,3534 ----
    \definedummyword\point
    \definedummyword\print
    \definedummyword\result
+   \definedummyword\textdegree
    %
    % We want to disable all macros so that they are not expanded by \write.
    \macrolist
***************
*** 3657,3662 ****
--- 3662,3668 ----
    \def\point{.}%
    \def\print{-|}%
    \def\result{=>}%
+   \def\textdegree{degrees}%
    %
    % We need to get rid of all macros, leaving only the arguments (if present).
    % Of course this is not nearly correct, but it is the best we can do for 
now.
Index: doc/texinfo.txi
===================================================================
RCS file: /sources/texinfo/texinfo/doc/texinfo.txi,v
retrieving revision 1.172
diff -c -r1.172 texinfo.txi
*** doc/texinfo.txi     26 Aug 2006 23:25:38 -0000      1.172
--- doc/texinfo.txi     26 Aug 2006 23:46:29 -0000
***************
*** 447,452 ****
--- 447,453 ----
                                   and the copyright symbol.
  * euro::                        How to insert the Euro currency symbol.
  * pounds::                      How to insert the pounds currency symbol.
+ * textdegree::                  How to insert the degrees symbol.
  * minus::                       How to insert a minus sign.
  * math::                        How to format a mathematical expression.
  * Glyphs::                      How to indicate results of evaluation,
***************
*** 10034,10040 ****
  @item Accents.
  @item Dots and bullets.
  @item The @TeX{} logo and the copyright symbol.
! @item The pounds currency symbol.
  @item The minus sign.
  @item Mathematical expressions.
  @item Glyphs for evaluation, macros, errors, etc.
--- 10035,10042 ----
  @item Accents.
  @item Dots and bullets.
  @item The @TeX{} logo and the copyright symbol.
! @item The euro and pounds currency symbols.
! @item The degrees symbol.
  @item The minus sign.
  @item Mathematical expressions.
  @item Glyphs for evaluation, macros, errors, etc.
***************
*** 10053,10058 ****
--- 10055,10061 ----
                                   and the copyright symbol.
  * euro::                        How to insert the Euro currency symbol.
  * pounds::                      How to insert the pounds currency symbol.
+ * textdegree::                  How to insert the degrees symbol.
  * minus::                       How to insert a minus sign.
  * math::                        How to format a mathematical expression.
  * Glyphs::                      How to indicate results of evaluation,
***************
*** 10661,10670 ****
  
  Use the @code{@@address@hidden@}} command to generate address@hidden'.  Where
  possible, this is the symbol for the Euro currency, invented as part
! of the European economic unification relatively recently.  In plain
! Info, it is the word @samp{Euro }.  (The space is included in the text
! transliteration since typically there would be no space after the
! symbol, so it would be inappropriate to have a space in the source document.)
  
  Texinfo cannot magically synthesize support for the Euro symbol where
  the underlying system (fonts, software, whatever) does not support
--- 10664,10673 ----
  
  Use the @code{@@address@hidden@}} command to generate address@hidden'.  Where
  possible, this is the symbol for the Euro currency, invented as part
! of the European economic unification.  In plain Info, it is the word
! @samp{Euro }.  A trailing space is included in the text
! transliteration since typically no space is desired after the symbol,
! so it would be inappropriate to have a space in the source document.
  
  Texinfo cannot magically synthesize support for the Euro symbol where
  the underlying system (fonts, software, whatever) does not support
***************
*** 10698,10703 ****
--- 10701,10715 ----
  Info, it is a @samp{#}.
  
  
+ @node textdegree
+ @section @code{@@address@hidden@} (@textdegree{}): Degrees symbol
+ @findex pounds
+ 
+ Use the @code{@@address@hidden@}} command to generate address@hidden'.
+ Where possible, this is the normal symbol for degrees.  In plain text
+ and Info output, it is an @samp{o}.
+ 
+ 
  @node minus
  @section @code{@@address@hidden@} (@minus{}): Inserting a Minus Sign
  @findex minus
Index: makeinfo/cmds.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.65
diff -c -r1.65 cmds.c
*** makeinfo/cmds.c     10 Jul 2006 23:07:12 -0000      1.65
--- makeinfo/cmds.c     26 Aug 2006 23:46:36 -0000
***************
*** 321,326 ****
--- 321,327 ----
    { "tab", cm_tab, NO_BRACE_ARGS },
    { "table", cm_table, NO_BRACE_ARGS },
    { "tex", cm_tex, NO_BRACE_ARGS },
+   { "textdegree", cm_special_char, BRACE_ARGS },
    { "tie", cm_tie, BRACE_ARGS },
    { "tieaccent", cm_accent, MAYBE_BRACE_ARGS },
    { "tindex", cm_tindex, NO_BRACE_ARGS },
Index: makeinfo/lang.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/lang.c,v
retrieving revision 1.19
diff -c -r1.19 lang.c
*** makeinfo/lang.c     1 Jun 2006 23:48:33 -0000       1.19
--- makeinfo/lang.c     26 Aug 2006 23:46:40 -0000
***************
*** 1094,1099 ****
--- 1094,1101 ----
          add_encoded_char ("ordf" , "a");
        else if (strcmp (command, "ordm") == 0)
          add_encoded_char ("ordm" , "o");
+       else if (strcmp (command, "textdegree") == 0)
+         add_encoded_char ("deg" , "o");
        else if (strcmp (command, "AE") == 0)
          add_encoded_char ("AElig", command);
        else if (strcmp (command, "ae") == 0)




reply via email to

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