4

I'm having a bit of trouble representing the following equation. equation

Some attempts I've made are below.

\begin{tabular}{c}
\centering
$x \Rightarrow \hat{x}$ \\ 
$\hat{z} = 
 \begin{cases}
 \hat{x} \times 2 & \text{if} x > 0\\
 0 & \text{if} x < 0 
 \end{cases}$ \\ 
$\hat{z} \Rightarrow z $ 
\end{tabular} 

Another unsuccessful option:

\begin{eqnarray}
x \Rightarrow \hat{x} \nonumber\\
\hat{z} = \begin{cases} \hat{x} \times 2 & \text{if} x > 0\\0 & \text{if} x 
 < 0\end{cases} \nonumber \\
\hat{z} \Rightarrow z \nonumber
\end{eqnarray}

Suggestions welcome.

1 Answer 1

8

The various align environments from the amsmath package are the most useful for aligning math content along one or more alignment points. Centering of math is most easily achieved by invoking display math via \[...\].

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{aligned}
x &\Rightarrow \hat{x} \\ 
\hat{z} &= 
 \begin{cases}
 \hat{x} \times 2 & \text{if } x > 0\\
 0 & \text{if } x < 0 
 \end{cases} \\ 
\hat{z} &\Rightarrow z  
\end{aligned}
\]
\end{document}

enter image description here

2
  • 2
    I surmise some of the upvotes are a reward for me refraining from mentioning stackengine. Oops. I guess I just blew it. Sep 29, 2017 at 13:07
  • Thank you very much for the speed in answering this raised question. I think that other solutions will emerge over time. However, this solution met the expectation and solved the problem. Sep 29, 2017 at 14:23

You must log in to answer this question.

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