Register to reply

Greek Letters in Reply menu

by chemisttree
Tags: characters
Share this thread:
diazona
#55
Mar20-11, 03:30 AM
HW Helper
P: 2,155
Quote Quote by Greg Bernhardt View Post
Could be wrong but I bet that is something we can easily change. In fact, thinking about it, we'll need to change it to our tex tags so past equations are preserved on once the old latex images are gone.
The Stack Exchange network uses MathJaX with $ (inline) and $$ (block) as the delimiters, so it definitely should be possible to change that. At worst I'd imagine it's a matter of changing a couple of constants in the source code.
Fredrik
#56
Mar20-11, 04:35 AM
Emeritus
Sci Advisor
PF Gold
Fredrik's Avatar
P: 9,267
It would be nice to have delimiters that are easier to type than [/itex]. $ and $$ are easy enough, but \( and \[ are not. An Alt Gr shortcut would be an OK alternative. For example, if you type "Alt Gr+i" now, "[I][/I]" is typed, and the cursor is placed between the tags. If you select some text first, the tags are placed around that block of text. We could have e.g. Alt Gr+f and Alt Gr+d for the tags. Assuming of course that this can be configured in vBulletin. If function keys can be used this way, then I would suggest F8 and F9 (or F4 and F5).
jhae2.718
#57
Mar20-11, 09:03 AM
PF Gold
jhae2.718's Avatar
P: 1,153
I suppose it shouldn't be too hard* to use '$', '$$', and tex tags to delimit TeX. That way, backwards compatibility is maintained and it's easier to type in LaTeX.


*I haven't read the source.
diazona
#58
Mar20-11, 03:21 PM
HW Helper
P: 2,155
Quote Quote by Fredrik View Post
It would be nice to have delimiters that are easier to type than [/itex]. $ and $$ are easy enough, but \( and \[ are not. An Alt Gr shortcut would be an OK alternative. For example, if you type "Alt Gr+i" now, "[I][/I]" is typed, and the cursor is placed between the tags. If you select some text first, the tags are placed around that block of text. We could have e.g. Alt Gr+f and Alt Gr+d for the tags. Assuming of course that this can be configured in vBulletin. If function keys can be used this way, then I would suggest F8 and F9 (or F4 and F5).
Whatever is done, it'll have to also work for people who don't have an AltGr key (i.e. most US keyboards).
Gokul43201
#59
Mar21-11, 12:51 PM
Emeritus
Sci Advisor
PF Gold
Gokul43201's Avatar
P: 11,155
Quote Quote by Fredrik View Post
It would be nice to have delimiters that are easier to type than [/itex].
If we have different delimiters, then Greg will have to ensure that the tex and itex tags used in all previous posts be automatically changed to the new ones, so we don't lose the ability to read old TeX. I don't know if that is trivial to do.
Fredrik
#60
Mar21-11, 03:27 PM
Emeritus
Sci Advisor
PF Gold
Fredrik's Avatar
P: 9,267
Quote Quote by diazona View Post
Whatever is done, it'll have to also work for people who don't have an AltGr key (i.e. most US keyboards).
They don't have Alt Gr keys!? That country is just completely crazy.

Quote Quote by Gokul43201 View Post
If we have different delimiters, then Greg will have to ensure that the tex and itex tags used in all previous posts be automatically changed to the new ones, so we don't lose the ability to read old TeX. I don't know if that is trivial to do.
I expect that it will only be trivial if we can have several different delimiters mean the same thing.
Gokul43201
#61
Mar21-11, 04:18 PM
Emeritus
Sci Advisor
PF Gold
Gokul43201's Avatar
P: 11,155
Quote Quote by Fredrik View Post
I expect that it will only be trivial if we can have several different delimiters mean the same thing.
Of course! That sounds simple enough to do.
jhae2.718
#62
Mar21-11, 04:35 PM
PF Gold
jhae2.718's Avatar
P: 1,153
It shouldn't be too hard. I read over the source a bit, and multiple delimiters could probably be done just by changing the regexp.

(Is it just my editor, or did the MathJax developers throw all the code into one line?)
Greg Bernhardt
#63
Mar21-11, 04:54 PM
Admin
Greg Bernhardt's Avatar
P: 9,334
Quote Quote by jhae2.718 View Post
(Is it just my editor, or did the MathJax developers throw all the code into one line?)
The code is minified.
jhae2.718
#64
Mar21-11, 06:19 PM
PF Gold
jhae2.718's Avatar
P: 1,153
Okay, just found the unpacked and commented source.

Just found this:
http://www.mathjax.org/docs/1.1/upgr...tex-delimiters
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    jax: ["input/TeX","output/HTML-CSS"],
    extensions: ["tex2jax.js"],
    tex2jax: {
      inlineMath: [ ['$','$'], ['\\(','\\)'] ],
      processEscapes: true
    }
  });
</script>
<script type="text/javascript" src="/MathJax/MathJax.js"></script>
Also, in tex2jax.js:
MathJax.Extension.tex2jax = {
  version: "1.1",
  config: {
    element: null,             // The ID of the element to be processed
                               //   (defaults to full document)

    inlineMath: [              // The start/stop pairs for in-line math
//    ['$','$'],               //  (comment out any you don't want, or add your own, but
      ['\\(','\\)']            //  be sure that you don't have an extra comma at the end)
    ],

    displayMath: [             // The start/stop pairs for display math
      ['$$','$$'],             //  (comment out any you don't want, or add your own, but
      ['\\[','\\]']            //  be sure that you don't have an extra comma at the end)
    ],

    skipTags: ["script","noscript","style","textarea","pre","code"],
                               // The names of the tags whose contents will not be
                               // scanned for math delimiters

    ignoreClass: "tex2jax_ignore",    // the class name of elements whose contents should
                                      // NOT be processed by tex2jax.  Note that this
                                      // is a regular expression, so be sure to quote any
                                      // regexp special characters

    processClass: "tex2jax_process",  // the class name of elements whose contents SHOULD
                                      // be processed when they appear inside ones that
                                      // are ignored.  Note that this is a regular expression,
                                      // so be sure to quote any regexp special characters

    processEscapes: false,     // set to true to allow \$ to produce a dollar without
                               //   starting in-line math mode

    processEnvironments: true, // set to true to process \begin{xxx}...\end{xxx} outside
                               //   of math mode, false to prevent that

    preview: "TeX"             // set to "none" to not insert MathJax_Preview spans
                               //   or set to an array specifying an HTML snippet
                               //   to use the same preview for every equation.

  },
Fredrik
#65
Mar22-11, 02:18 AM
Emeritus
Sci Advisor
PF Gold
Fredrik's Avatar
P: 9,267
Cool. I don't know javascript, but it looks like it's trivial to configure whatever we want as math delimiters, and like they have made it trivial to have several different ones that mean the same thing. I'm a bit confused by the fact that you seem to be able to configure it in two different places, but I'm guessing that the tex2jax: {blah-blah} command essentially says, "use these definitions instead of the ones you find in that stupid file".

So it probably won't be a problem at all to use all of these:

[itex] [/itex]
\( \)
$ $

[tex] [/tex]
\[ \]
$$ $$

No wait...I do see a problem: Old posts that include $ signs. Not sure how to deal with those. Maybe someone can run a script to replace them all with \$. Or maybe we should just stick with the old delimiters. They would be less annoying if we can configure say F8 and F9 to type a pair of them.
jhae2.718
#66
Mar22-11, 07:11 AM
PF Gold
jhae2.718's Avatar
P: 1,153
It does appear trivial to modify delimiters. The first block with the configuration options seems to override the settings found in the actual source. I posted both code blocks as I wasn't sure which would be best to modify in the case of PF.


Register to reply

Related Discussions
MFG menu of TV Computing & Technology 1
They are listed as Greek when they aren't really Greek History & Humanities 45
Greek letters General Discussion 1
How many permutation of six letters, a,b,c,d,e,f i got the answer for 5 letters.urnt Calculus & Beyond Homework 2