Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to include an equation similar to the following in my text and have failed doing so in various tries, including using the align-environment of the amsmath-package.

example image

Basically, the text before and after the delimiters is supposed to be centered, as well as the operator in the equation, the space between the delimiters and the operator however should consist of two lines.

If I would transfer my current code to the example image, it would look like this:

\begin{equation}
    \text{Ex} =
    \bracevert
    \begin{align}
        a^2 + 300 * b\\
        70 < c
    \end{align}
    -
    \begin{align}
        200 + 60 * a\\
        a < 250 < b >= c
    \end{align}
    \bracevert
\end{equation}

Final Result:

This is the LaTeX outcome of my own equation (which should make more sense than the example I provided) using the code found in the answers below. Thanks to both of you! final result

share|improve this question
    
the - in the middle is really a minus-sign? I don't understand it's purpose hence it's difficult to typeset it –  tohecz Jan 27 '13 at 15:54
    
Well, I admit that I chose a pretty poor example, I don't believe someone could get anything out of that equation. However, I do have a slightly longer, more complex equation that needs to be typeset like this which would've most likely caused even more confusion. So for now, please disregard the mathematical aspect of the equation. –  Big-Blue Jan 27 '13 at 15:58
    
Should the lower right corner read "a < 250 < b ≥ c"? In what field is this used? Can you point to something similar to see? –  egreg Jan 27 '13 at 16:00
    
I'll use it for cryptography. The closest image I found on the fly was the one in the Description of concept-section of this Wikipedia article, imagine futher lines under the Pr[]-parts defining F and G. As mentioned in the first comment, please disregard the math aspect of the equation, including the sloppy use of operators like >= instead of ≥. –  Big-Blue Jan 27 '13 at 16:07
1  
@Big-Blue: Use \Pr rather Pr to denote probability. –  Aditya Jan 27 '13 at 19:37

2 Answers 2

up vote 5 down vote accepted

I am not sure to have correctly understood, perhaps something like

\documentclass{article}
\usepackage{amsmath}
\begin{document}\thispagestyle{empty}
\begin{equation}
  \text{Ex} =
  \left\bracevert
  \begin{aligned}
    &a^2 + 300 * b\\
    &70 < c
  \end{aligned}
  \mathrel-
  \begin{aligned}
    &200 + 60 * a\\
    &a < 250 < b >= c
  \end{aligned}
  \right\bracevert
\end{equation}
\end{document}

equation

share|improve this answer
    
Thanks for your answer! I like the outcome of your code a slight bit better because of the left-alignment. –  Big-Blue Jan 27 '13 at 16:27

I'm not sure if I understood your intentions, but something like this is doable.

enter image description here

\documentclass{article}

\pagestyle{empty}

\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{mathtools}

\begin{document}

\begin{equation}
    \text{Ex} =
    \Biggl\bracevert
    \begin{array}{cc}
        a^2 + 300 b\\
        70 < c
    \end{array}
    \Bigr\}-\Bigl\{
    \begin{array}{cc}
        200 + 60 a\\
        a < 250 < b,\ c \leq b
    \end{array}
    \Biggr\bracevert
\end{equation}

\end{document}

Couple remarks (as usual):

  • I changed 300*b to 300b, and <= to \leq.
  • AFAIK it's frowned upon to use inequalities of both directions in one consecutive sequence of relations, so I split the last part into two.
  • I decided to make the sizing of the vertical lines and braces manually to make the inner ones small enough and the outer ones large enough.
share|improve this answer
    
Thank you for your concern! I now updated the question with a comparison of your and jfbu's version for future reference and also because it should make more sense than the example I originally provided. –  Big-Blue Jan 27 '13 at 16:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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