home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / text / tex / 15306 < prev    next >
Encoding:
Text File  |  1993-01-22  |  2.4 KB  |  67 lines

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!mcsun!sunic!uts!kubipdal
  3. From: kubipdal@uts.uni-c.dk (Peter Dalg}rd)
  4. Subject: Re: NFSS: How change mathcodes?
  5. Organization: UNI-C, Danish Computing Centre for Research and Education
  6. Date: Fri, 22 Jan 1993 16:19:57 GMT
  7. Message-ID: <1993Jan22.161957.7751@uts.uni-c.dk>
  8. References: <1993Jan20.161638.7096@uts.uni-c.dk>
  9. Keywords: NFSS, mathcode
  10. Lines: 55
  11.  
  12. Sorry about following up on my own postings, but noone else did and I
  13. did find at least a partial solution.
  14.  
  15. In <1993Jan20.161638.7096@uts.uni-c.dk> kubipdal@uts.uni-c.dk (Peter Dalg}rd) writes:
  16.  
  17. >a) How would one know that \bffam is the family corresponding to
  18. >    \mathbf{} (In fact it is, but suppose I wanted do it for
  19. >    another alphabet)?
  20.  
  21. >b) Math alphabets do not seem to be defined unless there is reference 
  22. >    to them in a formula (??) As it is now, $X_i$ gives me an
  23. >    error that textfont 4 is undefined, but $X_i+\mathbf{z}$
  24. >    works. How do I enforce definition of the relevant fonts?
  25.  
  26. Part b) is easily disposed of by creating a dummy formula with a font
  27. selection inside, e.g.
  28. \setbox0\hbox{$\mathbf\relax$}
  29.  
  30. Part a) is tricky. If the math alphabet has been created with 
  31. \new@internalmathalphabet or \newmathalphabet, then the control
  32. sequence expands to something that starts with a call to 
  33. \select@group, whose second argument is the math family that I
  34. was after. The first argument is the command sequence itself.
  35. (I.e. \mathbf ->\select@group \mathbf \bffam ....)
  36. So I need to extract the third token of the expansion of the
  37. math alphabet control sequence. I ended up with this (setfam is my
  38. original macro):
  39.  
  40. \newcount\h@ckedf@mily
  41. \def \getthirdtoken#1#2#3#4***{#3}
  42. \def \@wfulf@milyh@ck#1{
  43.         \h@ckedf@mily\expandafter\getthirdtoken#1***
  44.         \setbox0\hbox{$#1\relax$}
  45. }
  46. \def \mathletter#1#2{
  47.         \@wfulf@milyh@ck{#1}
  48.         \setfam{\h@ckedf@mily}{#2}
  49. }
  50. \def \bfmathletter#1{\mathletter{\mathbf}{#1}}
  51.  
  52. This doesn't work for rm and mi since they are set up differently
  53. in newlfont.sty. However, they are in their usual places, so one can
  54. just:
  55.  
  56. \def \mimathletter#1{\setfam 1 {#1}}
  57. \def \rmmathletter#1{\setfam 0 {#1}}
  58.  
  59. Something tells me that this can't be the right way, but it's the best
  60. I can do!
  61.  
  62.     Peter
  63.  
  64. PS: Please note that I routinely \catcode RET SPC and TAB to 9 (ignored)
  65. in my macros, people who prefer the usual TeX style need to delete a few
  66. spaces and insert some % signs in various places.
  67.