I want to write conditional equations with one-sided curly brackets in Spaced Repetition software Mnemosyne. I have latex installed. I want an equation somewhat similar to the following

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. I believe you are looking for cases environment from the package amsmath, as explained for instance here: tex.stackexchange.com/questions/9065/… – yo' Mar 11 '15 at 12:05
  • 2
    Oh, I now realize that you probably ask about how to do this in a 3rd party software, right? I'm afraid that in that case, it is off-topic here. – yo' Mar 11 '15 at 12:13
  • If you are really just searching for LaTeX-code, it would be \documentclass{article}\usepackage{mathtools}\begin{document}\[f(x)=\begin{cases*}\frac{x^2-x}{x},&if $x\geq1$\\0,&otherwise\end{cases*}\]\end{document} – LaRiFaRi Mar 11 '15 at 12:40
  • @yo' -- looking at the documentation for the mnemosyne project, it does have the ability to use latex code ("need latex and dvipng installed"). documented here: mnemosyne-proj.org/help/adding-media.php – barbara beeton Mar 11 '15 at 12:56

if i read the instructions on this page (http://mnemosyne-proj.org/help/adding-media.php) correctly, here's what you'd input:

 f(x) =
    x^2 - x, & \text{if $x \ge 1$}\\
    0, & \text{otherwise}

whether this actually works depends on whether mnemosyne includes amsmath in its complement of recognized packages. but if it does not, then it would not be unreasonable to request the developers to add it. better yet would be to add mathtools which loads amsmath, corrects some known bugs, and adds useful extensions.

  • Tried that but it's not working.I found this page, on modifying the last code to my requirement, I got the following result :image from mnemosyne – Sisir Simha Mar 11 '15 at 14:06

I've found a solution on this page. Modifying it to my requirement, the following is the result in Mnemosyne:

enter image description here

and this is the code written to achieve that

f(x) = \left\{ \begin{array}{ll}
         \frac{x^2 -x}{2}, & \mbox{if $x \geq 1$};\\
        0 ,& \mbox{otherwise}.\end{array} \right. 
  • @andrew swann: can you explain me how you made the code look neat? – Sisir Simha Mar 13 '15 at 17:02
  • Just mark the code region and then press the {} button above the input box - it indents the whole region by 4 spaces on each line, which is interpreted by markdowan as input that should be formatted as code. – Andrew Swann Mar 13 '15 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.