wu :: forums
« wu :: forums - [ FAQ : how to write (and view) math symbols ] »

Welcome, Guest. Please Login or Register.
Sep 19th, 2018, 10:52pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   suggestions, help, and FAQ
(Moderators: william wu, towr, Eigenray, Grimbal, ThudnBlunder, SMQ, Icarus)
   [ FAQ : how to write (and view) math symbols ]
« No topic | Next topic »
Pages: 1 2  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: [ FAQ : how to write (and view) math symbols ]  (Read 370329 times)
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
[ FAQ : how to write (and view) math symbols ]  
« on: Feb 16th, 2007, 8:42am »
Quote Quote Modify Modify

WILLYWUTANG AND THE DISAPPEARING MATH SYMBOLS
 
Willywutang runs an online forum where, among other things, puzzles of a mathematical nature are discussed.  Once uopn a time, Willywu added support in the forum software for users to easily include a large number of common (and not-so-common) mathematical symbols in their posts.  But then, for performance reasons Willywu upgraded the forum software to a newer version and hasn't had the time to restore his customized math symbol support.  How can Willywu's users still see the intended symbols (instead of obscure text) when viewing old posts and enter math symbols in their new posts?
 


ANSWER: This User Script!
 
A "user script" is a piece of program code which can be automatically run by a web browser to change the way a web page looks or works when it's viewed.  While a few browsers have built-in support for user scripts, most require some sort of add-on software (e.g. Greasemonkey for the Firefox browser) to be installed first, and some can't support them at all (see "What if my browser doesn't support user scripts" below).
 
 
HOW TO USE:
 
Once you have the above user script installed (see "How to Install" below), two things will immediately change: in any old post with math symbols, (e.g. this one) you should now see the actual symbol (e.g. ) rather than the text (e.g. [smiley=bbr.gif]); and when editing or creating a post you should see a math symbol "menu" below the row of faces and an "Insert Symbols" checkbox at the bottom.
 
To use a math symbol in your post, either choose it from the appropriate page of the menu, or, if you know its name (you can see a symbol's name in the menu by hovering your mouse over it, or for those familiar with LaTeX, almost all the built in and AMS symbols should be defined here), simply type a backslash (\) followed by the symbol name and a space (if you want a space between the symbol and whatever comes next, remember to type two spaces after the symbol name).  For example, typing \pi will generate a symbol in your post, typing "\sqrt \pi" will give , and typing "\sum  \x" (two spaces) will give with a space between.  If you're typing symbol names directly, remember to also check the Insert Symbols checkbox below the text as well (if you use the menu the box will be checked automatically).
 
Finally, if you're quoting a post which used math symbols you'll see them as text (e.g. \pi) in your post (and the Insert Symbols checkbox will be checked for you automatically by defalut), but they will show as proper symbols in the preview and when you submit your post.  That's all there is to it!
« Last Edit: Feb 16th, 2007, 11:24am by SMQ » IP Logged

--SMQ

SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
How to Install  
« Reply #1 on: Feb 16th, 2007, 8:43am »
Quote Quote Modify Modify

HOW TO INSTALL:
 
If you know you're already using user scripts in your web browser, you can skip these instructions and just click the This User Script link above, and either the script will be automatically installed or you can download and save it in your user scripts directory.  If you've never set up a user script before, follow the instructions in the appropriate section for your browser below (accurate as of 20 August 2007).
 
If you don't know what web browser you're using, there's a good chance it's Microsoft Internet Explorer if you're on a PC/Windows computer, or Safari if you're on an Apple Macintosh (Mac).  A good place to look is at the very top of the window; the name of the browser will usually be at the start or end of the title bar there.  If you "just click the internet", you're probably using Internet Explorer.
 
Mozilla Firefox (version 1.5 or later) and Netscape Navigator (version 9 or later): the Greasemonkey extension for Firefox introduced the concept of user scripts to the world, and is still the most used.
  • Click the Greasemonkey link above
  • Click the Install Now link on that page
  • Click Restart Firefox in the install dialog once the installation is complete.
  • Once Firefox restarts, return to this page and click the This User Script link above; you should see a Greasemonkey Installation dialog, click Install and you're all set.
Microsoft Internet Explorer (version 6 or later): an extension called Turnabout provides user script functionality for Internet Explorer.
  • Click the This User Script link above and save the file to your computer (remember where you saved it).
  • Click the Turnabout link above
  • Look for the Turnabout Advanced link in the Download Turnabout section and click it. (Turnabout Basic doesn't allow you to install your own user scripts.)
  • Either click Run to run the installer directly (and then click Run again in the security warning once it's finished downloading), or click Save to save the installer on your computer, then go to where you saved it and double-click it to start the installation.
  • Take the default installation options (close IE and click Retry if and when prompted by the installer).
  • Once IE restarts, you should see a new toolbar; click the green Reify icon and choose Options... from the dropdown menu.
  • In the options dialog, click the Install Feature... button at the bottom, OK the security information, and open the user script file you saved in the first step; click OK in the options and you're all set.
Opera (version 8 or later): Opera has built-in support for user scripts, you just have to turn it on.
  • From the Tools menu choose Preferences...; choose the Advanced tab, choose Content on the left and click Javascript Options...
  • Choose a directory for User JavaScript files at the bottom.
  • Now click the This User Script link above, and save the file in the directory you just chose.  You should be all set!
Safari (version 1.3 or later): an extension called Creammonkey provides user script functionality for Safari.
  • Click the Creammonkey link above.
  • Click the link under download; a disk image will be automatically downloaded and mounted.
  • Open the Library folder in your user directory; if there is not an InputManagers folder there, create one.
  • Copy the Creammonkey folder from the downloaded disk image to the InputManagers folder
  • Close and restart Safari; you should see a new :) item in the menu.
  • Come back to this page and click the This User Script link above; when prompted install the script in Creammonkey and you should be all set.
Epiphany, Flock, Konqueror, SeaMonkey and others: the user script above should also work in any "modern" web browser that a) supports or has an extension to support user scripts, and b) supports the W3C DOM Specification Level 2 (or later).  The specifics are different on each web browser, but in general you just need to download and install a user script extension then download and install the above user script.
 
(edited to include Netscape Navigator 9)
« Last Edit: Aug 20th, 2007, 9:56am by SMQ » IP Logged

--SMQ

SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
What If My Browser Doesn't Support User Scripts?  
« Reply #2 on: Feb 16th, 2007, 8:43am »
Quote Quote Modify Modify

WHAT IF MY BROWSER DOESN'T SUPPORT USER SCRIPTS?
(Or what if I'm not comfortable with the quality or security of the user script extension(s) available for my browser?)
 
Unless William finds the time to restore the old customizations in the forum software there's currently no way to see the symbols in old posts without a user script; however, since the symbol images themselves are still available, you can enter them directly in your own posts the "hard" way: include an image in your post with a url of "http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/{name}.gif" where "{name}" is replaced with the name of the symbol image (not necessarily the exact same name you would use when entering the symbol as text using the above user script!).  For example, [img]http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols /surd.gif[/img] will produce a symbol.  For convenience, Icarus has already created a list (reproduced below) of all the available symbols and their image names for people who have to enter them directly.
 
 
LIST OF ALL AVAILABLE SYMBOLS AND THEIR IMAGE NAMES
(note that "biglongdownarrow" and "biglonguparrow" were included by mistake and don't actually exist)
 

« Last Edit: Feb 16th, 2007, 10:05am by SMQ » IP Logged

--SMQ

Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7408
Re: What If My Browser Doesn't Support User Script  
« Reply #3 on: Feb 16th, 2007, 9:57am »
Quote Quote Modify Modify

on Feb 16th, 2007, 8:43am, SMQ wrote:
(note that "biglongdownarrow" and "biglonguparrow" were included by mistake and don't actually exist)

It is ok, it doesn't have to be big and long.
« Last Edit: Feb 16th, 2007, 9:58am by Grimbal » IP Logged
Icarus
wu::riddles Moderator
Uberpuzzler
*****



Boldly going where even angels fear to tread.

   


Gender: male
Posts: 4863
Re: What If My Browser Doesn't Support User Script  
« Reply #4 on: Feb 16th, 2007, 3:49pm »
Quote Quote Modify Modify

As I promised, I've made this sticky, and unstuck the old Math Symbols FAQ. Yours is now the official version.
 
Thanks again for the superb job! Cool
IP Logged

"Pi goes on and on and on ...
And e is just as cursed.
I wonder: Which is larger
When their digits are reversed? " - Anonymous
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
*** New Version 1.1 ***  
« Reply #5 on: Feb 16th, 2007, 5:59pm »
Quote Quote Modify Modify

A new version of the user script is available which fixes a rather serious bug where a variety of normal UBB tags (e.g. [b]) were being replaced by their images (!) during editing.
 
Please make sure you have version 1.1 of the user script installed.
 
--SMQ
IP Logged

--SMQ

SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #6 on: Sep 21st, 2007, 7:59am »
Quote Quote Modify Modify

Version 1.2 of the script is now available.  The only change is that it now resizes the typing area to take up more of the window and give you more room to type.
 
--SMQ
IP Logged

--SMQ

Eigenray
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 1948
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #7 on: Oct 2nd, 2007, 9:30pm »
Quote Quote Modify Modify

Preview is non-idempotent: a single '\' character grows exponentially when there are math symbols around.
IP Logged
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #8 on: Oct 23rd, 2007, 8:02am »
Quote Quote Modify Modify

Version 1.3 -- the only change is a fix for the multiplying backslashes bug Eigenray noted above.
 
--SMQ
IP Logged

--SMQ

jpixstix
Newbie
*





   


Posts: 1
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #9 on: Sep 13th, 2008, 1:12pm »
Quote Quote Modify Modify

i don't know how to post a new subject so i am replying instead.
Math teacher asked this question:
20+1=19
How do you get this to be correct?
Any info would be appreciated.
Thanks
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13639
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #10 on: Sep 13th, 2008, 1:25pm »
Quote Quote Modify Modify

on Sep 13th, 2008, 1:12pm, jpixstix wrote:
i don't know how to post a new subject so i am replying instead.
There's a link at the top right of each board called "Start new topic", it does exactly as advertised Smiley
 
Quote:
Math teacher asked this question:
20+1=19
How do you get this to be correct?
Any info would be appreciated.
Thanks
Usually there's a further constraint like "you can only add one line"; in which case one option is: 20+1  19.  
Without that further constraint you can do numerous things. For instance you could just move the +1 to the other side.
Or, you could just redefine addition, like: a+b = 19   a,b. Or specify you're working in a different than usual area of math: 20+1=19 (mod 2).
« Last Edit: Sep 13th, 2008, 1:25pm by towr » IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
KeyBlader01
Newbie
*





   


Posts: 15
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #11 on: Oct 8th, 2008, 4:20pm »
Quote Quote Modify Modify

Has anyone figured out a way to print pages with those math scripts in which the scripts actually appear on the page? (I'm using greasemonkey and the pages that print out don't include the scripts >.<)
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13639
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #12 on: Oct 9th, 2008, 12:31am »
Quote Quote Modify Modify

One ad hoc way of doing it would be to paste together screenshots. Aside from that I have no ideas at the moment.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #13 on: Oct 9th, 2008, 5:21am »
Quote Quote Modify Modify

Ooh, I just had that "Aha!" moment as to why they're not printing: in order to show up on the forums, the images we're using are white, and when you put them on a white background to print...
 
If you tell the browser to print background colors/images (file/Page Setup... in FF), you'll blow through ink/toner like it's free, but the symbols will show. Cheesy
 
--SMQ
IP Logged

--SMQ

towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13639
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #14 on: Oct 9th, 2008, 6:18am »
Quote Quote Modify Modify

So another approach might be to save the page, batch invert the images, and then print; without wasting so much ink.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
KeyBlader01
Newbie
*





   


Posts: 15
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #15 on: Oct 9th, 2008, 6:53am »
Quote Quote Modify Modify

on Oct 9th, 2008, 6:18am, towr wrote:
So another approach might be to save the page, batch invert the images, and then print; without wasting so much ink.

 
I know you gave me the zip file already but I'm curious, how would you do that? (How do you save the page and batch invert the images?)
IP Logged
Eigenray
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 1948
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #16 on: Oct 9th, 2008, 7:05am »
Quote Quote Modify Modify

on Oct 9th, 2008, 6:53am, KeyBlader01 wrote:

 
I know you gave me the zip file already but I'm curious, how would you do that? (How do you save the page and batch invert the images?)

Save the page with your browser (choosing something like 'complete' rather than 'html only').  For Windows, IrfanView is a good multi-purpose image viewer.  It can do batch conversions including image negation.  For Linux (or Cygwin), ImageMagick's convert is very useful too.
IP Logged
Eigenray
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 1948
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #17 on: Feb 6th, 2009, 1:31pm »
Quote Quote Modify Modify

The script breaks sometimes.  It appears when I try to modify this post of mine, although it works again on preview.
 
Without understanding the code, I fixed it as follows:
Code:

@@ -438,11 +438,10 @@
 if (match.index > begin) out += text.substring(begin, match.index);
 begin = r.lastIndex;
 out += '\\' + image;
-if (begin < text.length && (text.charAt(begin) == ' ' ||
-  this.lookupPrefix(image + text.substring(begin)).length > image.length))
-{
-  out += " ";
-}
+if (begin < text.length) {
+  foo=this.lookupPrefix(image + text.substring(begin));
+  if(text.charAt(begin) == ' ' || (foo && foo.length > image.length)) out += " ";
+}
« Last Edit: Feb 6th, 2009, 1:42pm by Eigenray » IP Logged
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #18 on: Feb 9th, 2009, 6:36am »
Quote Quote Modify Modify

Version 1.4 -- the only change is a fix for the crashing bug Eigenray noted above.
 
(Eigenray, FYI, your patch addressed the symptom, but the real problem was in the lookupPrefix function itself: the word undefined needed quotes around it in lines 328 and 332.)
 
--SMQ
IP Logged

--SMQ

mathsman
Newbie
*





   
WWW

Posts: 1
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #19 on: Mar 30th, 2010, 12:56pm »
Quote Quote Modify Modify

I wish a video had been prepared
IP Logged
fizyka
Junior Member
**



Physics&Informa tics <3

   
WWW

Gender: male
Posts: 54
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #20 on: Dec 30th, 2011, 3:33pm »
Quote Quote Modify Modify

Wouldnt it will be better just to use LaTeX ?
Or the new JavaScript library for that - MathJax ?
IP Logged

fizyka , karta wzorów fizyka , książki z fizyki
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2080
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #21 on: Dec 31st, 2011, 7:27am »
Quote Quote Modify Modify

Unfortunately, either of those options would require modifying the forum server software, which only WIlliam can do, and he's a busy man.  In the mean time, this is the best solution we have.
 
--SMQ
IP Logged

--SMQ

cartoonle
Junior Member
**





   
WWW

Gender: male
Posts: 56
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #22 on: Dec 19th, 2012, 1:37am »
Quote Quote Modify Modify

Hmmm....
 
Maybe he could send message string through a special made function, before the message is inserted in database. Function would only replace all occurrences of special characters with path to appropriate image representation of that character. That function wouldn't be hard to build .... only a list of "replace that with that". I would build it myself, if somebody provides me replace list.
 
Would that work?
« Last Edit: Dec 19th, 2012, 1:47am by cartoonle » IP Logged

friv - something i've built
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13639
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #23 on: Dec 19th, 2012, 8:55am »
Quote Quote Modify Modify

Frankly, the forum is putting the server it's on under too much strain as it is without adding extra functions to its workload.
I think it's a much better idea just to upgrade to a new forum somewhere in the coming year and tackle a whole host of other problems in one fell swoop.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
cartoonle
Junior Member
**





   
WWW

Gender: male
Posts: 56
Re: [ FAQ : how to write (and view) math symbols ]  
« Reply #24 on: Dec 20th, 2012, 2:54am »
Quote Quote Modify Modify

Yes, forum upgrade would be the most elegant solution. Although this new function wouldn't be to big problem, because it would trigger only when new post would be submited ... and that is not that often, or?
Well, it was just a thought.
IP Logged

friv - something i've built
Pages: 1 2  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« No topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board