Author Topic: So now we can get mathy in here?  (Read 13174 times)

0 Members and 1 Guest are viewing this topic.

Offline TheAmmoniacalTopic starter

  • Supporter
  • ****
  • Posts: 1188
  • Country: no
So now we can get mathy in here?
« on: February 12, 2016, 05:25:26 am »
Apparently he installed LaTeX, was that the reason for the downtime?

For inline:
Code: [Select]
\( code here \)\(  e^{i \pi} = cos(\theta) + i \sin(\theta) \)

Code: [Select]
$$ usual math mode $$$$ e^{i \pi} = cos(\theta) + i \sin(\theta)$$
$$ \oint_C {E \cdot d\ell = - \frac{d}{{dt}}} \int_S {B_n dA} $$
Woo!
« Last Edit: February 12, 2016, 05:41:04 am by TheAmmoniacal »
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 37740
  • Country: au
    • EEVblog
Re: So now we can get mathy in here?
« Reply #1 on: February 12, 2016, 05:26:31 am »
Apparently he installed LaTeX, was that the reason for the downtime?

No it was not.
I installed a header script that point to some Latex server thingo. I do not know the details. Someone posted it in another thread so I added it and it supposedly works. I know nothing about LaTex.
« Last Edit: February 12, 2016, 05:28:14 am by EEVblog »
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: So now we can get mathy in here?
« Reply #2 on: February 12, 2016, 05:53:33 am »
Its MathJax..

Both it and MathML display beautifully on my machine.

You just need to have fonts that contain the right glyphs, no longer do they need to render small parts in bitmaps. Firefox and variants have supported MathML for well over a decade. 

LaTeX used to have to be rendered by various kludges like the amazingly complicated latex2html.

Which churned equations into a mix of html and small gifs..

what
« Last Edit: February 12, 2016, 06:02:35 am by cdev »
"What the large print giveth, the small print taketh away."
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19525
  • Country: gb
  • 0999
Re: So now we can get mathy in here?
« Reply #3 on: February 12, 2016, 08:49:10 am »
I can't see any formulae, just code.
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2184
  • Country: au
Re: So now we can get mathy in here?
« Reply #4 on: February 12, 2016, 08:55:02 am »
I'm seeing properly rendered formulae on my tablet with the bog standard android browser :-+
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: So now we can get mathy in here?
« Reply #5 on: February 12, 2016, 09:34:56 am »
I'm missing something. I hit the 'Insert Code' button on the top (the hash button) then place my LaTeX code between the start and end commands. However, when I preview all I see is the code rather than the formula, what am I doing wrong?
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2184
  • Country: au
Re: So now we can get mathy in here?
« Reply #6 on: February 12, 2016, 09:47:15 am »
I'm missing something. I hit the 'Insert Code' button on the top (the hash button) then place my LaTeX code between the start and end commands. However, when I preview all I see is the code rather than the formula, what am I doing wrong?
Don't use that. Quote Ammoniacal's first post to see what you need to use as quoting it will reveal the formatting.

Preview doesn't seem to work on windows IE but if I hit post the rendered text appears

$$ \sqrt{\frac {C_{2}R_{2}-R_{1}\left (2C_{1}+C_{2}\right)}{4C_{1}^{2}C_{2}\pi^{2}\left (R_{1}^{3}+R_{1}^{2}R_{2}\right )}} $$
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2184
  • Country: au
Re: So now we can get mathy in here?
« Reply #7 on: February 12, 2016, 09:49:18 am »
I suspect "Preview" rendering may need patching also :-//
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19509
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: So now we can get mathy in here?
« Reply #8 on: February 12, 2016, 10:10:27 am »
I'm missing something. I hit the 'Insert Code' button on the top (the hash button) then place my LaTeX code between the start and end commands. However, when I preview all I see is the code rather than the formula, what am I doing wrong?

If your browser surpresses JavaScript (e.g. NoScript plugin), you may need to enable JavaScript from mathjax.org.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21686
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: So now we can get mathy in here?
« Reply #9 on: February 12, 2016, 10:26:29 am »
\( x = \frac{-b}{2a} \pm \sqrt{b^2 - 4ac} \)

Thanks Dave! :-+ :-+ :-+ :-+ :-+ :-+

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12298
  • Country: au
Re: So now we can get mathy in here?
« Reply #10 on: February 12, 2016, 10:34:47 am »
\( x = \frac{-b}{2a} \pm \sqrt{b^2 - 4ac} \)

Thanks Dave! :-+ :-+ :-+ :-+ :-+ :-+

Tim

\( x = \frac{{-b} \pm \sqrt{b^2 - 4ac}} {2a}\)

Ah - that's how it works.

« Last Edit: February 12, 2016, 10:36:59 am by Brumby »
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12298
  • Country: au
Re: So now we can get mathy in here?
« Reply #11 on: February 12, 2016, 10:36:23 am »
I'm missing something. I hit the 'Insert Code' button on the top (the hash button) then place my LaTeX code between the start and end commands. However, when I preview all I see is the code rather than the formula, what am I doing wrong?

The 'Insert Code' button allows you to have source code displayed without being interpreted and translated.... exactly the OPPOSITE of what you wanted!
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: So now we can get mathy in here?
« Reply #12 on: February 12, 2016, 10:56:38 am »
I have a feeling this will come in handy. ;D

\( D=e^{ins}\cdot p \)
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: So now we can get mathy in here?
« Reply #13 on: February 12, 2016, 11:45:46 am »
Works here  :-+, rendered properly at :

- Desktop & laptop -> Windoze -> Waterfox browser (x64 Firefox)
- Mobile -> Android -> CM Browser (CM = Cheetah Mobile)

Offline AlxDroidDev

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: br
    • Arduino Web Brasil
Re: So now we can get mathy in here?
« Reply #14 on: February 12, 2016, 12:01:38 pm »
I am using Chrome v48.0 on Windows 7 and everything appears as it should.

Let me give it a try:    \( y=\sqrt{\frac{x^2}{x+1}}\qquad \)

BTW: This is a nice site to write and test the equations, then just copy and paste the equation code here using the proper opening and closing tags: http://www.sciweavers.org/free-online-latex-equation-editor
« Last Edit: February 12, 2016, 01:49:22 pm by AlxDroidDev »
"The nice thing about standards is that you have so many to choose from." (Andrew S. Tanenbaum)
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 37740
  • Country: au
    • EEVblog
Re: So now we can get mathy in here?
« Reply #15 on: February 12, 2016, 01:34:08 pm »
Someone mentioned on twitter that Latex is a potential server security threat?  :-//
 

Offline MatthewEveritt

  • Supporter
  • ****
  • Posts: 136
  • Country: gb
Re: So now we can get mathy in here?
« Reply #16 on: February 12, 2016, 01:39:58 pm »
No idea what they're on about. All the rendering is done in the browser, not the server - all the server sees is some text strings that mean nothing to it just like any other comment.

There is another way of doing this where the server actively parses the comments looking for \$\LaTeX\$, compiles them itself and inserts the resultant image, which could be a security nightmare if done wrong. Which is why nobody does that now the browser based renders can do it.

Edit: If it's the comment I'm thinking of, about being an easy target, perhaps he's just referring to the fact that you installed something you didn't understand?
« Last Edit: February 12, 2016, 01:43:12 pm by MatthewEveritt »
 

Offline edy

  • Super Contributor
  • ***
  • Posts: 2385
  • Country: ca
    • DevHackMod Channel
Re: So now we can get mathy in here?
« Reply #17 on: February 12, 2016, 01:42:38 pm »
I see formulas on my BlackBerry Z10.
YouTube: www.devhackmod.com LBRY: https://lbry.tv/@winegaming:b Bandcamp Music Link
"Ye cannae change the laws of physics, captain" - Scotty
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: So now we can get mathy in here?
« Reply #18 on: February 12, 2016, 02:12:35 pm »
Ooh. Lets give this a go...

\(f = \frac{1} {2\pi \sqrt{LC}}\)

...shame it doesn't work in preview :(

I wonder if this will break it  ;D

Code: [Select]
[glow=grey,1,10]\(I = \frac{V}{R}\)[/glow]
\(I = \frac{V}{R}\)

Edit: I like AlxDroidDev's [glow] trick!
« Last Edit: February 12, 2016, 02:23:56 pm by Macbeth »
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: So now we can get mathy in here?
« Reply #19 on: February 12, 2016, 02:24:43 pm »
If you right-click on the equations in Firefox you can also set the scaling and other settings!
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Morgoroth

  • Regular Contributor
  • *
  • Posts: 123
  • Country: cl
Re: So now we can get mathy in here?
« Reply #20 on: February 12, 2016, 02:30:21 pm »
preview issue is easy to fix, only need to add mathjax code in template for 'post replay'/'preview'.

\$\mathfrak{F}(f) = \int_{-\infty}^\infty f(t) e^{-j2\pi ft} dt\$
----------------------------------------------------------
If works, doesn't means it is right.
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: So now we can get mathy in here?
« Reply #21 on: February 12, 2016, 02:32:46 pm »
If you right-click on the equations in Firefox you can also set the scaling and other settings!
Same with Chrome. I have a little MathJax menu...
 

Offline rrinker

  • Super Contributor
  • ***
  • Posts: 2046
  • Country: us
Re: So now we can get mathy in here?
« Reply #22 on: February 12, 2016, 02:54:46 pm »
IE as well, right click context menu and you can zoom, see the LaTeX code, whatever.
 

Offline HAL-42b

  • Frequent Contributor
  • **
  • Posts: 423
Re: So now we can get mathy in here?
« Reply #23 on: February 12, 2016, 03:33:15 pm »
Someone mentioned on twitter that Latex is a potential server security threat?  :-//

Even if so the Mathjax code on your site is rendered at cdn.mathjax.org so it shouldn't be an issue. In any case let's keep an eye out for any vulnerabilities.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: So now we can get mathy in here?
« Reply #24 on: February 12, 2016, 03:35:53 pm »
@Macbeth: I don't like the shading effect though; it makes the formulas difficult too read.

All in all I think this is a very cool and useful extension of the forum!  :-+
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf