home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / text / tex / 14437 < prev    next >
Encoding:
Text File  |  1992-12-23  |  2.2 KB  |  59 lines

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rose.cis.ohio-state.edu!mandal
  3. From: mandal@rose.cis.ohio-state.edu (Manas Mandal)
  4. Subject: \Roman{ctr} in LaTeX, Forcing expansions of tokens in TeX
  5. Message-ID: <MANDAL.92Dec23124023@rose.cis.ohio-state.edu>
  6. Originator: mandal@rose.cis.ohio-state.edu
  7. Sender: news@cis.ohio-state.edu (NETnews        )
  8. Organization: Ohio State Computer Science
  9. Date: Wed, 23 Dec 1992 17:40:23 GMT
  10. Lines: 47
  11.  
  12. I am having trouble getting the `correct' value of a counter typed out on the
  13. screen using \typeout and \Roman.
  14.  
  15. I have a counter called chapter, and defined \thechapter as follows
  16.         \newcounter{chapter}
  17.         \def\thechapter{\Roman{chapter}
  18.  
  19. so that when the chapter is 3, I would get III as the value of the chapter.
  20.  
  21. While processing, I want to typeout the current chapter number, so at
  22. the relevant place, I issue the command \typeout{\thechapter}
  23.  
  24.  
  25. If \thechapter is defined as               I get as output
  26.  
  27.         \arabic{chapter}                        3
  28.         \roman{chapter}                         iii
  29.         \Roman{chapter}                         \uppercase {iii}
  30.         \alph{chapter}                          c
  31.         \Alph{chapter}                          C
  32.  
  33.  
  34. QUESTION 1::
  35.  
  36. Is this a bug in LaTeX? \Roman is not expanded but everything else
  37. gets displayed properly? In latex.tex, \@Roman is defined as
  38.         \expandafter\uppercase\expandafter{\romannumeral #1}
  39. which is why the full expansion is not being done.
  40.  
  41.  
  42. QUESTION 2::
  43.  
  44. How do I force the expansion without changing the definition of
  45. \@Roman? Can I say something like
  46.         \typeout{\expand\thechapter}
  47. so that \thechapter is correctly expanded? I did go thorugh part of
  48. the TeX book (\expandafter, \noexpand, etc.) but couldn't figure out
  49. the solution. (There is no \expand in TeX.)
  50.  
  51.  
  52. Thanks for any pointers,
  53. Manas
  54. -- 
  55.  _____________________________________________________________________________
  56. :     Manas Mandal             Department of Computer and Information Science :
  57. :                                        The Ohio State University            :
  58. : mandal@cis.ohio-state.edu     2036 Neil Avenue, Columbus, OH 43210-1277 USA :
  59.