LaTex for EEVBlog - Page 1
Forum section: electronics / general

author: Morgoroth
author_rank: Regular Contributor
timestamp: February 09, 2016, 04:44:17 pm
content: there is a chance to enable LaTex support for the EEVBlog ?, I have a small blog and I'm using mathjax, is very very easy to use, only have to edit a template on blogger and that's it, probably more complicated here, but could be very handy and worth the effort.

author: Andy Watson
author_rank: Super Contributor
timestamp: February 09, 2016, 04:52:54 pm
content: +1Although, I think this particular subject has been raised before and the response was lukewarm.

author: Maxlor
author_rank: Frequent Contributor
timestamp: February 10, 2016, 12:04:51 am
content: LaTeX? Hell, just having unicode would be nice, so you could actually use a micro or ohm symbol. That hasn't happened either, though, so don't hold your breath for mathjax

author: HAL-42b
author_rank: Frequent Contributor
timestamp: February 10, 2016, 12:08:00 am
content: +1 for LaTeX support.

author: nuno
author_rank: Frequent Contributor
timestamp: February 10, 2016, 12:23:40 am
content: I'd rather have a canvas. Some years ago I searched such thing for a site I have, but only found a plugin that would let you either write or have the canvas, but not both. Don't know what exists today.

author: EEVblog
author_rank: Unknown
timestamp: February 10, 2016, 09:55:05 am
content: I can't install it:http://custom.simplemachines.org/mods/index.php?mod=1111I get an error and ti warns me not to install. It's a 6 years old mod.

author: Morgoroth
author_rank: Regular Contributor
timestamp: February 10, 2016, 01:59:28 pm
content: seems to be another approach for this:http://www.simplemachines.org/community/index.php?topic=535624.msg3805548#msg3805548only you have to edit a template files and that's it, no mod at all, refer to attached images for reference, one from simplemachines forum, another from mathjax documentation, and finally how I did it to enable LaTeX.

author: MatthewEveritt
author_rank: Unknown
timestamp: February 10, 2016, 05:02:22 pm
content: Quote from: EEVblog on February 10, 2016, 09:55:05 amA pity, the reason for the error seems to simply be a pretty minor formatting issue. Just different enough to not work.If you're going to go to the bother of manually fixing things it doesn't really seem worth it for something six years out of date.Quote from: Morgoroth on February 10, 2016, 01:59:28 pmThis seems to work really well. It does seem to require manually including the script, but I would be surprised if there was a mod available to make that easy.I'd recommend usingCode:<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['\\$','\\$'], ['\\(','\\)']]}});</script><script type="text/javascript"src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>so \$math\$ is inline as well as the default \(math\). This is just a personal preference, but it seems the most like native LaTeX that doesn't wreak havoc when single $ signs are used.

author: Morgoroth
author_rank: Regular Contributor
timestamp: February 10, 2016, 05:38:38 pm
content: I bet you had problems with the 'async' attribute, if it was, you can solve it in this way:Code:<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script><script type="text/javascript" async="async"src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"></script>

author: MatthewEveritt
author_rank: Unknown
timestamp: February 10, 2016, 05:57:36 pm
content: I didn't have problems, I was just using a trivial file to play with the script. I agree that async might be a sensible addition.I'd advice against using inlineMath: [['$','$']] as sentences like " $10 each, or three for $25", or whatever, will become unreadable.

author: Morgoroth
author_rank: Regular Contributor
timestamp: February 10, 2016, 06:15:30 pm
content: you're right about the inline delimiter, the problem is I have to change all the LaTeX references in the blog, so, work for night late.thanks for the tip.

author: MatthewEveritt
author_rank: Unknown
timestamp: February 10, 2016, 09:36:23 pm
content: Dave, on the off-chance that we can persuade you :Looks like there is a mod that makes this really easy :http://custom.simplemachines.org/mods/index.php?mod=2686.Once it's installed you get a new option under "Admin->Configuration->Modification settings->Custom </head> and </body> Scripts". Just pastCode:<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['\\$','\\$'], ['\\(','\\)']]}});</script><script type="text/javascript" async="async"src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>Hit save and it should be done.I just tested it on SMF 2.0.11 (clean install just for this) and it works like a charm. Obviously there's always a chance that it'll conflict with some other mod you have installed, but it doesn't seem likely.

author: Morgoroth
author_rank: Regular Contributor
timestamp: February 10, 2016, 11:43:44 pm
content: please....

author: bitwelder
author_rank: Super Contributor
timestamp: February 11, 2016, 11:04:05 pm
content: Quote from: Morgoroth on February 10, 2016, 11:43:44 pmPicture of a cat is not the best image to move Dave, I think...

author: c4757p
author_rank: Super Contributor
timestamp: February 11, 2016, 11:22:48 pm
content: Pleeeeeeease?

author: EEVblog
author_rank: Unknown
timestamp: February 12, 2016, 12:53:19 am
content: Quote from: MatthewEveritt on February 10, 2016, 09:36:23 pmDone.I have no idea how to test it.

author: Morgoroth
author_rank: Regular Contributor
timestamp: February 12, 2016, 01:13:52 am
content: test\$V_{o}=A \cdot ( V_{+}-V_{-} ) \$nice !!!, it don't show on preview, but is a minor problem...THANK YOU VM !!!

author: MatthewEveritt
author_rank: Unknown
timestamp: February 12, 2016, 01:15:13 am
content: Awesome, thank you. It seems to work just fine.A slightly more complex test: \[\chi=<{m}>+<{m}>^2\left(\frac{\tau_c^2}{2T^2}\left[exp\left( \frac{-2T}{\tau_c}\right)-1+\frac{2T}{\tau_c}\right]\right)\]

author: liquibyte
author_rank: Frequent Contributor
timestamp: February 12, 2016, 01:15:35 am
content: I was working on it too to see what got supported.TexThe quadratic formula is $$-b \pm \sqrt{b^2 - 4ac} \over 2a$$ \byeLatexE &= \frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}}AsciiMathsum_(i=1)^n i^3=((n(n+1))/2)^2

author: MatthewEveritt
author_rank: Unknown
timestamp: February 12, 2016, 01:30:32 am
content: A couple of simple examples to show how to use \$\LaTeX\$ in forum posts.Code:In line math \$R=123\mu\Omega\$ is done with dollar signsIn line math \$R=123\mu\Omega\$ is done with dollar signsCode:Display math \[P=\frac{V^2}{R}\] is done with square brackets.Display math \[P=\frac{V^2}{R}\] is done with square brackets.

author: c4757p
author_rank: Super Contributor
timestamp: February 12, 2016, 01:44:17 am
content: \[w^{o^{o^{o^o}}}\]

author: Jeroen3
author_rank: Super Contributor
timestamp: February 12, 2016, 05:17:01 am
content: It does not work on the mobile version of the forum.

author: Ian.M
author_rank: Super Contributor
timestamp: February 12, 2016, 05:34:17 am
content: N.B. Anyone running a javascript blocker like NoScript, will need to add an exception for cdn.mathjax.org

author: HAL-42b
author_rank: Frequent Contributor
timestamp: February 12, 2016, 03:03:44 pm
content: $${\LaTeX}$$$$ \newcommand\T{\Rule{0pt}{1em}{.3em}}\begin{array}{|c|c|}\hline X & P(X = i) \T \\\hline1 \T & 1/6 \\\hline2 \T & 1/6 \\\hline3 \T & 1/6 \\\hline4 \T & 1/6 \\\hline5 \T & 1/6 \\\hline6 \T & 1/6 \\\hline\end{array}$$MathJax doesn't implement tabular, because it is really a text-mode environment. You can use the array environment as a replacement.Source

author: calli
author_rank: Regular Contributor
timestamp: March 15, 2016, 01:36:11 pm
content: Hey, thats a nice addition!However it is so long ago that I used it... 1989 my Diploma Thesis and 1999-2009 for writing my book the first three editions (then we switched to "Word" and Indesign....gnaaaa.). In case you wonder:http://blenderbuch.de/(be warned, pesky german).Cheers,Carsten

author: Morgoroth
author_rank: Regular Contributor
timestamp: March 15, 2016, 02:17:50 pm
content: why not translate to pesky English ?

author: calli
author_rank: Regular Contributor
timestamp: March 15, 2016, 02:39:36 pm
content: Actually the second edition was translated to English and published by nonstarch press. And then they translated that into Italian and Indonesien. Quite strange languages 😁😁😈😈Carsten

author: Zbig
author_rank: Frequent Contributor
timestamp: April 10, 2016, 11:40:18 am
content: Testing Tex export from Casio FX-991EX QR code function. The calculator generates a QR code you can scan with your smart device. From there, you can e-mail yourself a link to wes.casio.com service with your result. Tex format is available there, among others. Here it goes:\$\frac{4\rm{\pi}{\left(6.37814\rm{k}\right)}^{3}}{3.2\rm{M}}\$Oh, bummer. Does anyone have a clue what went wrong?Ok, figured it out. Had to enclose the whole thing as is in the backslash-dollar tags.In case anyone is interested, that's the link the calculator has generated as a QR code:http://wes.casio.com/math/index.php?q=I-23B-+U-000000000000+M-C10000AD00+S-001410101000110E1010B0000542+R-0101892455638533010600000000000000000000+E-C81D1A342260362E3337383134E2D0C91A331B1B1A332E32E11B1EOk, I cheatedI don't really have this calculator yet. Just scanned the sample code from CASIO's marketing material on the site (image of a calculator displaying the code, actually). But I'm sold now. Running out to grab one right away!

author: Ian.M
author_rank: Super Contributor
timestamp: April 10, 2016, 02:32:42 pm
content: EEVblog's implementation of LaTex support using mathjax is currently unsafe and allows posters to inject arbitrary javascript. Seehttps://www.eevblog.com/forum/chat/so-now-we-can-get-mathy-in-here/msg868990/#msg868990Can something be done about the security issue?

author: Zbig
author_rank: Frequent Contributor
timestamp: April 10, 2016, 02:41:33 pm
content: Quote from: Ian.M on April 10, 2016, 02:32:42 pmOh, that's unfortunateHave you tried PMing Dave about that one?

author: EEVblog
author_rank: Unknown
timestamp: April 10, 2016, 11:51:02 pm
content: Quote from: Ian.M on April 10, 2016, 02:32:42 pmI can disable the feature entirely?

author: Ian.M
author_rank: Super Contributor
timestamp: April 11, 2016, 03:21:08 am
content: To enable safe mode, which prevents javascript in LaTex etc. you need to add,Safeat the end of the full URL + parameters in the line in the header that invokes Mathjax.Seehttp://mathjax.readthedocs.org/en/latest/safe-mode.html

author: EEVblog
author_rank: Unknown
timestamp: April 11, 2016, 04:13:05 am
content: Quote from: Ian.M on April 11, 2016, 03:21:08 amI don't know how to use that, I'm using a plugin.

author: Ian.M
author_rank: Super Contributor
timestamp: April 11, 2016, 04:31:49 am
content: If you are still using it the way you set up here:https://www.eevblog.com/forum/suggestions/latex-for-eevblog/msg866703/#msg866703, just edit the custom script to insert the,Safeimmediately before the">on the line with the mathjax URLCode:<script type="text/javascript" async="async"src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe"></script>

author: EEVblog
author_rank: Unknown
timestamp: April 11, 2016, 04:35:11 am
content: Quote from: Ian.M on April 11, 2016, 04:31:49 amAdded, thanks.

author: Ian.M
author_rank: Super Contributor
timestamp: April 11, 2016, 05:11:39 am
content: I've just checked the test post in the other topic. Clicking the = now does absolutely nothing so it looks like that vulnerability is now safely blocked.

author: firewalker
author_rank: Super Contributor
timestamp: August 28, 2016, 10:32:05 am
content: Is there a way to make \$\LaTeX\$ work for post Preview?Alexander.