4

I Want to do give two solutions to an equation, and do something like that:

                      / 0
If c = 0    =>    x =
                      \ -b/a

What I want

Edit: I've tried the cases environment or using \left\{ ... \right., still a good idea but not exactly what wanted.

JnxF
  • 886
  • 2
    How about the cases environment from amsmath? See e.g. http://tex.stackexchange.com/questions/9065/large-braces-for-specifying-values-of-variables-by-condition – Torbjørn T. Nov 03 '12 at 19:15
  • 2
    I would suggest you simply If $c=0$, then $x\in\{0,-b/a \}$. – Gonzalo Medina Nov 03 '12 at 19:18
  • @TorbjørnT. I think we should point that is similar question with (http://tex.stackexchange.com/questions/9065/large-braces-for-specifying-values-of-variables-by-condition) unless JnxF wants something different – karathan Nov 03 '12 at 19:49
  • @TorbjørnT. I tried what you or Jorge Campos suggested, but I don't like it too much what does it looks like. – JnxF Nov 03 '12 at 19:59
  • 1
    @JnxF Well, I haven't seen that lines in math texts ever. I think that's why Torbjørn and G.Medina suggested alternatives. – c.p. Nov 03 '12 at 23:40

5 Answers5

7

I would suggest something simple (without additional symbols that really don't bring anything good to the expression), as the first approach below; I also included something reproducing the image in the original question, but I don't like this option (of course, this is nothing but my personal opinion):

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}

\newcommand\tikzmark[1]{%
  \tikz[remember picture,overlay,baseline=-0.5ex]\node[inner sep=3pt] (#1) {};}

\begin{document}

\[
\text{If } c=0\text{, then } x\in\{0,-b/a \}.
\]

\[
\text{If } c=0\text{, then } x=\tikzmark{a}\mspace{15mu} 
\begin{array}{l}\tikzmark{b}0 \\ \tikzmark{c}-b/a \end{array}
\]
\begin{tikzpicture}[remember picture,overlay]
\draw (a) -- (b);
\draw (a) -- (c);
\end{tikzpicture}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • I also think like you. To say that x belongs to the set of answers would be most appropriate without having to use "drawings" to indicate something that already has a nomenclature. But in this case, I needed it for educational purposes, and would not include nomenclature. Thanks. Very useful. – JnxF Nov 03 '12 at 20:33
  • I'm more inclined to use words: "If c=0, then x=0 or x=-b/a". I dislike very much the "two case" notation: x can't be equal to two different things. – egreg Nov 04 '12 at 14:05
  • I just used that notation because my students used to use this notation in their written exercises last years, so I don't want to write down a notation nomenclature. I appreciate all your opinion. Thanks. – JnxF Nov 04 '12 at 14:44
6

For a change, without tikz:

\documentclass{article}
\usepackage{amsmath,amssymb,graphicx}

\newcommand\neline{%
\raisebox{1ex}{\rotatebox{-20}{\ensuremath\diagup}}}
\newcommand\seline{%
\raisebox{-1ex}{\rotatebox{20}{\ensuremath\diagdown}}}
\newlength{\mylength}
\settowidth{\mylength}{\neline}

\begin{document}


\[
\text{If } c=0\text{, then } x = \neline\kern-\mylength\seline \begin{array}{l}0 \\ -b/a \end{array}
\]

\end{document}

enter image description here

As suggested by Enrico, it is better to use \makebox[0pt][l]{\neline}, then we don't have to measure the width. Further we can merge \neline and \seline to make a single macro:

\documentclass{article}
\usepackage{amsmath,amssymb,graphicx}
%
\newcommand\neline{%
\makebox[0pt][l]{\raisebox{1ex}{\rotatebox{-20}{\ensuremath\diagup}}}
\raisebox{-1ex}{\rotatebox{20}{\ensuremath\diagdown}}}
%
\begin{document}    
\[
\text{If } c=0\text{, then } x = \neline \begin{array}{l}0 \\ -b/a \end{array}
\]    
\end{document}
2

You can use, in math mode, the command cases from amsmath. What you want could be something like this:

x = \begin{cases} 0,  \\ 
    -\frac{b}{a},  \end{cases}

You might want to add text:

x = \begin{cases} 0 , \mbox{when ...}  \\
    -\frac{b}{a}, \mbox{otherwise} \end{cases}
David Carlisle
  • 757,742
c.p.
  • 4,636
2

Here's a slightly different option:

\documentclass{article}

\begin{document}
\[
    \mbox{If } c=0\mbox{, then } x=\mathop{\left\langle\phantom{x^2}\right.}^1_{-\frac{b}{a}}
\]
\end{document}

enter image description here

Scott H.
  • 11,047
0

you could also consider using the "cases" environment (but leaving the condition part empty).

\[
\text{If } c=0\text{, then } x=\begin{cases} 
0  & \\ 
-\frac{b}{a} &  
\end{cases}
\]
drini
  • 1,478