-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le 31/12/2010 15:35, Philip Taylor (Webmaster, Ret'd) a écrit : > > > Ulrike Fischer wrote: > >> And please don't repeat that you "was not in any >> way trying to suggest that this is a general or universal >> solution.". You _did_ sent the first example without any code which >> restricted the effect of the catcodes changes and without any >> warnings about side-effects. This was the posting I commented as >> this is not my idea of an helpful answer. > > As is so often the case, a suggestion (intended to be > helpful) becomes a protracted argument from which > the original questioner is effectively excluded. But > as I dislike being accused of something on a fallacious > basis, let me re-cite the original correspondence : > > François (1) : > >> I would like to know why the numbers are different if typed with or >> without the $ sign: >> >> Using \setmainfont{Linux Libertine O} 7 is smaller than $7$ >> >> Is it possible to correct this? I want the same size (ie. $7$) >> >> Of course I can always write $7$, but is there another way. > > François (2) : > >> Thanks for this answer. It is not too nice if you have to write: >> >> Multiply 5 by 7: $7\times 5 = 35$ > > Self (1) : > >> Bonjour, François : is this perhaps the sort of >> thing you had in mind ? >> >> \documentclass {minimal} >> \usepackage {fontspec} >> \setmainfont {Linux Libertine O} >> \begin {document} >> Multiply 5 by 7: $7\times 5 = 35$ >> >> \catcode `\5 = \active >> \catcode `\7 = \active >> \def 5{\ifmmode \string 5 \else $5$\fi} >> \def 7{\ifmmode \string 7 \else $7$\fi} >> Multiply 5 by 7: $7\times 5 = 35$ >> >> \end {document} >> >> Obviously you can \catcode and \def all digits >> from zero to nine in a simple loop to cope with >> the general case. > > My answer thus addressed François' problem /as stated/ : > it did not suggest that it was a solution to such > problems in general (although I can see that it /might/ > be possible to misinterpret the last paragraph : when > I spoke of "the general case", I was referring to the > case of all the digits from zero to nine, not to the > entire class of problems of which François' was one > example). > > Yes, I completely agree that "[I] sent the first > example without any code which restricted the > effect of the catcodes changes and without any > warnings about side-effects.", but I also assumed > that my answer would be interpreted within the context > of the question being asked, and not within the context > of such questions in general. > > ** Phil.
Philip, there is some problem with your answer: Yes I wrote: >>> Using \setmainfont{Linux Libertine O} 7 is smaller than $7$ >>> >>> Is it possible to correct this? I want the same size (ie. $7$) But it is because I did not think at all that it was possible to change the shape of the digits when latex is in math mode. I know how to use latex for many things but I am not aware of all mechanisms and when I tested your answer, I thought that it was a good solution to my problem, with some restrictions though: I don't know much about the 'catcode' but it seemed to me that this way of doing could affect some other latex commands using digits, and I understood immediadly what could be the disaster with the example given by Ulrike, indeed I will need to use tikz in the same article and I think that if I had chosen your solution, I could have waste a lot of time before understanding that the problem was coming from your solution. I think that many people are like me: using latex and finding some solutions to their problems but without going deeply into the technical part of it. Mastering the side effects of a solution like yours is not obvious and you should have given some information about the possible dangers. Ulrike's solution is a very interesting one because it gives some homogeneity to the text when you have to mix text and mathematics in a paragraph, I mean, when your text is not fully a mathematical text. Anyway thanks for these answers. F. - -- François Patte UFR de mathématiques et informatique Université Paris Descartes 45, rue des Saints Pères F-75270 Paris Cedex 06 Tél. +33 (0)1 4286 2145 http://www.math-info.univ-paris5.fr/~patte -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAk0d9+8ACgkQdE6C2dhV2JUjQwCgtm4WcChc8dyEATdxJJsUbIkC hwUAn2nAPy5Md62Pp1UKBJ+/Wpae4pKS =t3fI -----END PGP SIGNATURE----- -------------------------------------------------- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex