From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/26036 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: How to \bf for math? Date: Sat, 18 Feb 2006 12:56:53 +0100 Message-ID: <43F70B85.5070006@elvenkind.com> References: <6faad9f00601150307k69d8a10er89fe149ee8f724ab@mail.gmail.com> <1B2F871A-AFE0-42CF-A17D-1C29D7F0966C@fiee.net> <6faad9f00601150659y7528773du9423ccf07d066bd0@mail.gmail.com> <43CA9061.2040002@wxs.nl> <43CB7E1E.2080602@elvenkind.com> <6faad9f00601160908k6e940d9fk58b57cfa1de68839@mail.gmail.com> <43F4DE75.4040209@comp.lancs.ac.uk> <43F4E34E.4090608@comp.lancs.ac.uk> <1140197084.48104.6.camel@tempete> <43F614BF.6010101@comp.lancs.ac.uk> <1140203340.79639.4.camel@tempete> <43F62A52.7090105@comp.lancs.ac.uk> <43F64203.7080202@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010001030205050602050609" X-Trace: sea.gmane.org 1140263840 28940 80.91.229.2 (18 Feb 2006 11:57:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 18 Feb 2006 11:57:20 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat Feb 18 12:57:18 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1FAQiA-00040k-Hr for gctc-ntg-context-518@m.gmane.org; Sat, 18 Feb 2006 12:57:14 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0292F12798; Sat, 18 Feb 2006 12:57:14 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 10020-01-5; Sat, 18 Feb 2006 12:57:08 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DF2FE12784; Sat, 18 Feb 2006 12:57:07 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A471612784 for ; Sat, 18 Feb 2006 12:57:06 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 10020-01-4 for ; Sat, 18 Feb 2006 12:57:05 +0100 (CET) Original-Received: from post-24.mail.nl.demon.net (post-24.mail.nl.demon.net [194.159.73.194]) by ronja.ntg.nl (Postfix) with SMTP id 25B4212780 for ; Sat, 18 Feb 2006 12:57:04 +0100 (CET) Original-Received: from boo.demon.nl ([82.161.175.147]:38729 helo=[192.168.1.3]) by post-24.mail.nl.demon.net with esmtp (Exim 4.51) id 1FAQhz-000L6C-HV for ntg-context@ntg.nl; Sat, 18 Feb 2006 11:57:04 +0000 User-Agent: Mozilla Thunderbird 1.0 (X11/20050215) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <43F64203.7080202@wxs.nl> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:26036 Archived-At: This is a multi-part message in MIME format. --------------010001030205050602050609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hans Hagen wrote: > (concerning the definemathcharacters, we need input from taco on that > because he knows what goes on deep inside tex and has done complex > math typesetting for ages) The \definemathcharacter macro is a actually quite simple, it is mostly a syntactic wrapper around \mathcode and \delcode assignments. See the attached chunk of --module documentation text. Whether mixed bold/unbold math is feasible depends mostly on two things: * if bold symbolic fonts are available (math italic, symbol and extension) * how you define the variable symbols (latin characters) and font switches. Normally, an 'a' is of mathtype 'variable' (7), so that if you do ${\bf a}$, you get a bold (fam 6) one instead of the one from the math italic (fam 1). When you redefine its mathcode so it becomes an `ord' (0) in a `bold math italic' family (say 'A' or so. You cannot use \bi since that is a match for \it, and it will not have the same spacing rules!); afterward it no longer obey font switches. If you want to get back to the upright version in such a setup, you have to redefine te \rm command to change the math family code yet again, to 'ord' in upright math (fam 0), this time. All this shuffling about with mathcodes is needed because during a single formula, TeX stores tokens in the form (family id, chararacter). Only at the very end of the formula are the families themselves mapped to fonts (and the tokens converted to using those fonts), so changing the \textfont0 etc. assignments while in the formula does not help. I hope this is clear enough. Cheers, Taco --------------010001030205050602050609 Content-Type: application/x-tex; name="definemathcharacter.tex" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="definemathcharacter.tex" %D \macros{definemathcharacter} %D %D This macro comes in two guises, a four-argument form that is basically %D a wrapper around \type{\mathcode}, and a six-argument form that is a %D wrapper for \type{\delcode}, for use with \type{\left} or \type{\right}. %D %D \starttyping %D \definemathcharacter [=] [rel] [mr] ["3D] %D \definemathcharacter [(] [nothing] [mr] ["28] [ex] ["00] %D \definemathcharacter [)] [nothing] [mr] ["29] [ex] ["01] %D \stoptyping %D %D The {\bf first} argument indicates the character to be defined. Simple ascii %D chararacters can be given as-is, but non-printable characters and the %D digits themselves should be specified using their decimal value, so %D context defines the vertical bar like this: %D %D \starttyping %D \definemathcharacter [124] [ord] [sy] ["6A] % decimal(124) = chr (|) %D \stoptyping %D %D and if you want your zeros to come from the math italic font, %D you would have to use this: %D %D \starttyping %D \definemathcharacter [48] [ord] [mi] ["30] % decimal(48) = hex(30) = chr(0) %D \stoptyping %D %D The {\bf second} argument indicates the math type, using a symbolic %D representation that maps to a specific math type: any value higher %D than seven is folded back to zero. The list of names is: %D %D \starttable[|c|c|c|] %D \NC \bf symbolic name \NC \bf actual meaning \NC \bf remapped value \NR %D \NC ord \NC 0 \NC 0\NC\NR %D \NC op \NC 1 \NC 1\NC\NR %D \NC bin \NC 2 \NC 2\NC\NR %D \NC rel \NC 3 \NC 3\NC\NR %D \NC open \NC 4 \NC 4\NC\NR %D \NC close \NC 5 \NC 5\NC\NR %D \NC punct \NC 6 \NC 6\NC\NR %D \NC alpha \NC 7 \NC 7\NC\NR %D \NC inner \NC 0 \NC 0\NC\NR %D \NC nothing\NC 0 \NC 0\NC\NR %D \NC limop \NC 1 \NC 1\NC\NR %D \NC nolop \NC 1 \NC 1\NC\NR %D \NC choice \NC 0 \NC 0\NC\NR %D \NC box \NC 0 \NC 0\NC\NR %D \NC accent \NC 8 \NC 0\NC\NR %D \NC radical\NC 9 \NC 0\NC\NR %D \stoptable %D %D In the six-argument form, the second argument has to be `nothing', %D and the fifth and sixth argument have the same syntax as the third and %D fourth argument: they define the `large' version of a delimiter. %D %D In the four-argument form, the most interesting type is `alpha', %D because that creates a symbol that obeys font family changes (like %D \type{\bf} or \type{\it}). %D %D The {\bf third} argument is a symbolic family name that is mapped %D to a bare family number, possibly using the current mathcollection's %D font definitions (lookup \type{\definefamilysynonym} for details on %D the remapping). %D %D In the default setup, the meanings are as follows: %D %D \starttable[|c|c|c|] %D \NC \bf symbolic name \NC \bf actual meaning \NC \bf (remapped value) \NR %D \NC mr \NC 0\NC 0\NC \NR %D \NC mi \NC 1\NC 1\NC \NR %D \NC sy \NC 2\NC 2\NC \NR %D \NC ex \NC 3\NC 3\NC \NR %D \NC it \NC 4\NC 4\NC \NR %D \NC sl \NC 5\NC 5\NC \NR %D \NC bf \NC 6\NC 6\NC \NR %D \NC nn \NC 7\NC 7\NC \NR %D \NC bs \NC 8\NC 8\NC \NR %D \NC bi \NC 9\NC 9\NC \NR %D \NC sc \NC A\NC A\NC \NR %D \NC tf \NC B\NC B\NC \NR %D \NC ma \NC C\NC C\NC \NR %D \NC mb \NC D\NC D\NC \NR %D \NC mc \NC E\NC E\NC \NR %D \NC md \NC F\NC F\NC \NR %D \NC letters \NC mr\NC (0)\NC \NR %D \NC operators \NC sy\NC (2)\NC \NR %D \NC lcgreek \NC mi\NC (1)\NC \NR %D \NC ucgreek \NC mr\NC (0)\NC \NR %D \NC vargreek \NC mi\NC (1)\NC \NR %D \NC mitfamily \NC mi\NC (1)\NC \NR %D \NC calfamily \NC sy\NC (2)\NC \NR %D \NC 0 \NC mr\NC (0)\NC \NR %D \NC 1 \NC mi\NC (1)\NC \NR %D \NC 2 \NC sy\NC (2)\NC \NR %D \NC 3 \NC ex\NC (3)\NC \NR %D \NC calligraphic\NC sy\NC (2)\NC \NR %D \NC oldstyle \NC mi\NC (1)\NC \NR %D \NC blackboard \NC mr\NC (0)\NC \NR %D \NC gothic \NC mr\NC (0)\NC \NR %D \NC fraktur \NC mr\NC (0)\NC \NR %D \stoptable %D %D The {\bf fourth} argument is simply the glyph index in the family's font %D encoding. %D %D In the six-argument form, the {\bf fifth} and {\bf sixth} argument %D have the same syntax as the third and %D fourth argument: they define the `large' version of a delimiter. --------------010001030205050602050609 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --------------010001030205050602050609--