30

I think Philosophy.SE ought to have LateX availability in text input, because there are going to be a lot of formal logic questions. How can we get LateX, or a comparable math typesetting feature, on Philosophy Stack Exchange?


Here are some suggested direct solutions:

Things that could be implemented:

(See here for more references.)

Things that Philosophy.SE already supports:

  • HTML markup for logical symbols
  • Unicode (which includes logical symbols)
  • Images

Which means you can directly display mathematical notation if you generate any of the above yourself and insert it.


Here are some suggested workarounds (do-it-yourself):

I specifically want to highlight a “workaround” as something you have to do yourself, outside of Stack Exchange, if there is no built-in feature.

Render it as an image

In a web app:

  • texpaste offers Latex rendering within a webpage, the output of which can be screenshot and attached in an SE post as an image (source code here).

On your machine/locally:

Use a browser plug-in/browser extension to insert Unicode logic symbols:

  • (See one of the answers below)

Write logical symbols directly as HTML

  • Since Stack Exchange supports HTML markup in question and answer bodies, simply refer to Wikipedia to find the command for a variety of logical symbols.

This request was apparently “formally declined”, but I do not see information about when. If it was back in 2011, I suggest reopening the request for reconsideration, and I also suggest we separate the three distinct sub-questions of a) why we would want it, b) how it could be implemented, and c) why it has been hereunto declined.

2
  • 1
    There are many duplicate posts, and so I thought to write here instead of posting anew. Has this request been reviewed, especially because of the graduation of Philosophy SE? Or is the official answer still 'no'?
    – user8572
    Aug 2, 2016 at 18:34
  • This question should be split into two in my opinion - 1. Can we have math formatting enabled by Stack Exchange, and 2. What are workarounds for inserting math formatting? Apr 3 at 11:01

4 Answers 4

14

Currently, only a handful of sites on the Stack Exchange network support LaTeX notation. Implementing support has been requested for some of the other sites, namely Stack Overflow, but has been denied.

The official argument from the team is that supporting this is an extremely heavy dependency, and that parsing LaTeX equations is an extremely expensive operation on the client side.

Certainly for sites like Mathematics where it's absolutely necessary, the massive dependency is an easier pill to swallow. And on sites like Stack Overflow, where it would only be used in exceptionally rare cases, it's a much easier decision to deny the request to support it. But on this site, I think things get much trickier. While there will be some questions dealing with formal logic that will require such mathematical-style proofs, there are also a lot more questions that deal with more abstract concepts which words will express just fine.

But do consider that there are simpler workarounds. Using straight HTML is a simple option for simple equations like 2πr2/6. And as KennyTM suggests, there's always old-school ASCII art. For those who like things a bit fancier and also happen to know the LaTeX engine, you can use an online service that generates the equations as images, which are easily embedded into a post (we have dedicated image-hosting for all sites on the network). For example, CodeCogs's Equation Editor has been recommended by several users.

Update: As the tag added to this question indicates, adding this has been officially declined by the team. We'll need some really compelling arguments to justify adding it. The above-mentioned workarounds seem perfectly sufficient to me, considering how often formal proofs are needed.

15
  • 1
    I see - you're probably right. I didn't realize it was a computational issue. I'm sure we'll be able to do without. And I guess if it's a really technical question then it could be asked on mathstack
    – Chuck
    Jun 8, 2011 at 12:53
  • 1
    Is there an alternative that would suffice? I can't imagine the TeX needs are anything close to mathstack. Theres always just typing the unicode code points in manually :-)
    – machinaut
    Jun 9, 2011 at 3:07
  • 1
    @ajray: I suggested three alternatives in my answer. Check the last paragraph. (Although, admittedly, the pi symbol looks strange in whatever font this is. I don't much care for the font, by the way...) Jun 9, 2011 at 6:02
  • 1
    In Math.SE, the LaTeX is only rendered when the question includes LaTeX. So wouldn't there be no cost for people who don't want to ask/answer questions involving this?
    – Xodarap
    Jun 15, 2011 at 23:58
  • 1
    @Xodarap: From my understanding, there's still a cost to deploy it on the site. But I'm not entirely sure. You'd have to ask one of the Stack Exchange developers, someone who knows a lot more about web design than myself. A comment to balpha's answer to this question might be worth considering. He'd probably be able to fill in the details if you're wondering about this. Jun 16, 2011 at 4:25
  • 2
    Yes, using images is a very sensible alternative to pulling in something like MathJax. I went to use it on one of my sites once and almost fell off my chair when I saw how many files / resources it used up. If you have Microsoft Office / LibreOffice, you can use the equation editor to create the equation and then just take a screenshot of it and clip it. Jun 25, 2011 at 0:31
  • 2
    I personally believe that MathJax availability will greatly enhance the overall image. Philosophy already bears a soft-tag and for us to discuss concepts as Lob's Theorem or use Modus Ponens, it would require the feature.
    – user1207
    Dec 22, 2011 at 1:15
  • I found a service that produces mathML, which renders much more nicely in my browser than the images from other services. Could that be a possibility? PD: also this.
    – Trylks
    Sep 21, 2013 at 12:06
  • Question/request: It would be nice to have the common ASCII symbols produced by the answer submission interface, somehow. I imagine it wouldn't be too difficult to add a button which, when clicked, gives a panel of often-used logic symbols which you can then click on, and which then adds your desired symbol to the text box. That way you don't have to scan the internet trying to fetch these symbols every time you want to use them in a response.
    – Addem
    Apr 24, 2015 at 3:34
  • 1
    Alternatively, it would at least be nice to have them collected and displayed in the side-bar so that you can copy-paste them manually whenever you want them.
    – Addem
    Apr 24, 2015 at 3:35
  • It would be great to have at least an easy way to access the following unicode symbols: → ↔ ¬ ∧ ∨ ∀ ∃ ⊢⊨ (and maybe ◇ ◻)
    – viuser
    Aug 8, 2016 at 19:50
  • 2
    A real explanation why MathJax is so problematic would be nice. What makes it a "massive dependency"? Yes, it's heavy on the client side. But it doesn't slow down those pages of a MathJax-enabled SE site where no LaTeX is used (like this one). And the core MathJax.js file is tiny, like 50 KB, rest is only loaded when it's needed. Now a real problem: users write LaTeX-code in the titles of their posts! If those show up in "Related" MathJax has to be fully loaded and slows everything down.
    – viuser
    Aug 9, 2016 at 23:38
  • @wolf-revo-cats this explains why it is a heavy dependency. But as for your request, it inspired me to make a user script, see my answer.
    – user2953
    Sep 1, 2016 at 18:16
  • 1
    If it's easier on the server to load images, couldn't one add a feature which converts math TeX into images inserted inserted in the appropriate places? Imposing the inconvenience of having to go and write math somewhere else and then paste it in or install a browser plugin is kind of wild. Mar 29 at 14:23
  • We'll need some really compelling arguments to justify adding it”. Or, what if we needed some really compelling arguments to justify not enabling it? Apr 3 at 11:17
12

I have created a user script that adds a Math button to the editor, which then inserts HTML sequences as a lightweight solution compared to MathJax. For logic it should work just fine.

More information on StackApps, view source code or install (to install you need a browser plugin like GreaseMonkey).

Screenshots:

enter image description here

enter image description here

If you think other symbols may be useful, just let me know.

2
  • 2
    Modal operator symbols would be useful too.
    – E...
    Sep 2, 2016 at 6:33
  • @EliranH I added square and lozenge (wasn't sure if that is what you meant). You can reinstall the script. From then on, it will automatically update. Thanks!
    – user2953
    Sep 2, 2016 at 8:20
2

You can use this AutoHotkey script to convert LaTeX input into Unicode characters.

"Ctrl+Alt+Shift+U" toggles it on and off (look at the bottom right icon to see it's in suspense mode (icon S) of active mode (icon H).

Test: αβΓ∞¹₂ℝ

2
  • Is that Windows-only? Apr 3 at 10:57
  • @JuliusHamilton yes
    – Ooker
    Apr 3 at 11:25
2

Made an edit earlier this evening to this question converting LaTeX to a Mathjax output: Axioms for modal logics based upon counterfactuals

I used the following technique:

  1. Copy each LaTex code between the "$" signs in the edit window.
  2. Paste it into P. Lutus' "Interactive LaTeX Editor" https://arachnoid.com/latex/
  3. Use the MathJax Render Mode.
  4. Copy the output and paste it over the code in the question.

This seemed to work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .