2

I'm dealing with a math system and the code is the following:

\documentclass{report}
\usepackage{mathtools}
\begin{document}
\begin{spreadlines}{1.ex}
        \begin{equation}
        \chi_{_\mathrm{f}}=\mu^T
        \left\{
            \begin{alignedat}{2}
                (R_{x_\mathrm{f}} - R_{x_\mathrm{fs}}) = 0 \;\xrightarrow{R_{x_\mathrm{fs}} =0} \; (R_{x_\mathrm{f}} = 0)\\
                (R_{y_\mathrm{f}} - R_{y_\mathrm{fs}}) = 0 \;\xrightarrow{R_{y_\mathrm{fs}}=0} \; (R_{y_\mathrm{f}} = 0)\\
                (R_{z_\mathrm{f}} - R_{z_\mathrm{fs}}) = 0 \;\xrightarrow{R_{z_\mathrm{fs}}=0} \; (R_{z_\mathrm{f}} = 0)\\
                (V_{x_\mathrm{f}} - V_{x_\mathrm{fs}}) = 0 \;\xrightarrow{V_{x_\mathrm{fs}}=0} \; (V_{x_\mathrm{f}} = 0)\\
                (V_{y_\mathrm{f}} - V_{y_\mathrm{fs}}) = 0 \;\xrightarrow{V_{y_\mathrm{fs}}=0} \; (V_{y_\mathrm{f}} = 0)\\
                (V_{z_\mathrm{f}} - V_{z_\mathrm{fs}}) = 0 \;\xrightarrow{V_{z_\mathrm{fs}}=0} \; (V_{z_\mathrm{f}} = 0)\\ 
                m_f \text{free}\\
            \end{alignedat}
        \right.
        \end{equation}
        \end{spreadlines}
\end{document}

The output is the following:

enter image description here

  1. How could I remove the extra space that the code generate in the final line within the system? I have no clue why the last row starts there. It would be nice having it aligned on the left side like all the other rows or centered at least.

  2. How can I correctly outdistance "m_f" and "free" each other?

Thank you!

1
  • you have used alignedat{2} so it is expecting 3 alignment points (&) per row but you have specified no alignment at all. so everything is right aligned as the first cell before the first alignment point which is why they are all flush right. – David Carlisle Apr 13 at 18:24
3

I think gathered is preferable in this case to alignedat since there are no alignments per se. Then, I added a space at the beginning of \text{ free} to introduce the desired space. Finally, I led with an \mkern8mu and trailed with an \hfill on the last line to achieve left alignment of the final line (without them, the text is centered).

\documentclass{report}
\usepackage{mathtools}
\begin{document}
\begin{spreadlines}{1.ex}
        \begin{equation}
        \chi_{_\mathrm{f}}=\mu^T
        \left\{
            \begin{gathered}
                (R_{x_\mathrm{f}} - R_{x_\mathrm{fs}}) = 0 \;\xrightarrow{R_{x_\mathrm{fs}} =0} \; (R_{x_\mathrm{f}} = 0)\\
                (R_{y_\mathrm{f}} - R_{y_\mathrm{fs}}) = 0 \;\xrightarrow{R_{y_\mathrm{fs}}=0} \; (R_{y_\mathrm{f}} = 0)\\
                (R_{z_\mathrm{f}} - R_{z_\mathrm{fs}}) = 0 \;\xrightarrow{R_{z_\mathrm{fs}}=0} \; (R_{z_\mathrm{f}} = 0)\\
                (V_{x_\mathrm{f}} - V_{x_\mathrm{fs}}) = 0 \;\xrightarrow{V_{x_\mathrm{fs}}=0} \; (V_{x_\mathrm{f}} = 0)\\
                (V_{y_\mathrm{f}} - V_{y_\mathrm{fs}}) = 0 \;\xrightarrow{V_{y_\mathrm{fs}}=0} \; (V_{y_\mathrm{f}} = 0)\\
                (V_{z_\mathrm{f}} - V_{z_\mathrm{fs}}) = 0 \;\xrightarrow{V_{z_\mathrm{fs}}=0} \; (V_{z_\mathrm{f}} = 0)\\ 
                \mkern8mu m_f \text{ free}\hfill
            \end{gathered}
        \right.
        \end{equation}
        \end{spreadlines}
\end{document}

enter image description here

3

Three possibilities. The various parts have different widths, so it's difficult to get sensible alignments, so I recommend the last one.

\documentclass{report}
\usepackage{mathtools}

\begin{document}

\begin{equation}
\chi_{_\mathrm{f}}=\mu^T
\left\{
  \begin{alignedat}{4}
  &(R_{x_\mathrm{f}} - R_{x_\mathrm{fs}}) &&= 0
    &&\xrightarrow{R_{x_\mathrm{fs}} =0} (R_{x_\mathrm{f}} = 0)\\
  &(R_{y_\mathrm{f}} - R_{y_\mathrm{fs}}) &&= 0
    &&\xrightarrow{R_{y_\mathrm{fs}}=0} (R_{y_\mathrm{f}} = 0)\\
  &(R_{z_\mathrm{f}} - R_{z_\mathrm{fs}}) &&= 0
    &&\xrightarrow{R_{z_\mathrm{fs}}=0} (R_{z_\mathrm{f}} = 0)\\
  &(V_{x_\mathrm{f}} - V_{x_\mathrm{fs}}) &&= 0
    &&\xrightarrow{V_{x_\mathrm{fs}}=0} (V_{x_\mathrm{f}} = 0)\\
  &(V_{y_\mathrm{f}} - V_{y_\mathrm{fs}}) &&= 0
    &&\xrightarrow{V_{y_\mathrm{fs}}=0} (V_{y_\mathrm{f}} = 0)\\
  &(V_{z_\mathrm{f}} - V_{z_\mathrm{fs}}) &&= 0
    &&\xrightarrow{V_{z_\mathrm{fs}}=0} (V_{z_\mathrm{f}} = 0)\\[1ex]
  &\text{$m_{\mathrm{f}}$ free}
  \end{alignedat}
\right.
\end{equation}

\begin{equation}
\chi_{_\mathrm{f}}=\mu^T
\left\{
  \begin{alignedat}{3}
  &(R_{x_\mathrm{f}} - R_{x_\mathrm{fs}}) = 0
    &&\xrightarrow{R_{x_\mathrm{fs}} =0} (R_{x_\mathrm{f}} &= 0)\\
  &(R_{y_\mathrm{f}} - R_{y_\mathrm{fs}}) = 0
    &&\xrightarrow{R_{y_\mathrm{fs}}=0} (R_{y_\mathrm{f}} &= 0)\\
  &(R_{z_\mathrm{f}} - R_{z_\mathrm{fs}}) = 0
    &&\xrightarrow{R_{z_\mathrm{fs}}=0} (R_{z_\mathrm{f}} &= 0)\\
  &(V_{x_\mathrm{f}} - V_{x_\mathrm{fs}}) = 0
    &&\xrightarrow{V_{x_\mathrm{fs}}=0} (V_{x_\mathrm{f}} &= 0)\\
  &(V_{y_\mathrm{f}} - V_{y_\mathrm{fs}}) = 0
    &&\xrightarrow{V_{y_\mathrm{fs}}=0} (V_{y_\mathrm{f}} &= 0)\\
  &(V_{z_\mathrm{f}} - V_{z_\mathrm{fs}}) = 0
    &&\xrightarrow{V_{z_\mathrm{fs}}=0} (V_{z_\mathrm{f}} &= 0)\\[1ex]
  &\text{$m_{\mathrm{f}}$ free}
  \end{alignedat}
\right.
\end{equation}

\begin{equation}
\chi_{_\mathrm{f}}=\mu^T
\left\{
  \begin{alignedat}{1}
  &(R_{x_\mathrm{f}} - R_{x_\mathrm{fs}}) = 0
    \xrightarrow{R_{x_\mathrm{fs}} =0} (R_{x_\mathrm{f}} = 0)\\
  &(R_{y_\mathrm{f}} - R_{y_\mathrm{fs}}) = 0
    \xrightarrow{R_{y_\mathrm{fs}}=0} (R_{y_\mathrm{f}} = 0)\\
  &(R_{z_\mathrm{f}} - R_{z_\mathrm{fs}}) = 0
    \xrightarrow{R_{z_\mathrm{fs}}=0} (R_{z_\mathrm{f}} = 0)\\
  &(V_{x_\mathrm{f}} - V_{x_\mathrm{fs}}) = 0
    \xrightarrow{V_{x_\mathrm{fs}}=0} (V_{x_\mathrm{f}} = 0)\\
  &(V_{y_\mathrm{f}} - V_{y_\mathrm{fs}}) = 0
    \xrightarrow{V_{y_\mathrm{fs}}=0} (V_{y_\mathrm{f}} = 0)\\
  &(V_{z_\mathrm{f}} - V_{z_\mathrm{fs}}) = 0
    \xrightarrow{V_{z_\mathrm{fs}}=0} (V_{z_\mathrm{f}} = 0)\\[1ex]
  &\text{$m_{\mathrm{f}}$ free}
  \end{alignedat}
\right.
\end{equation}

\end{document}

enter image description here

2

You appear to be missing the entire point of using an alignedat environment: It exists so you don't have to engage in (presumably tedious) visual formatting via spacing directives such as \;. But if you don't provide any & alignment markers, there's little or no reason for using alignedat (or align, aligned, flalign, etc.) to begin with.

Anyway, I'd get rid of the \; spacers and insert well-placed alignment markers instead.

enter image description here

\documentclass{report}
\usepackage{mathtools}
\newcommand\fs{\mathrm{fs}} % handy shortcut macro

\begin{document}
\begin{spreadlines}{1ex}
\begin{equation}
\chi^{}_{\mathrm{f}}=\mu^T
\left\{
\begin{alignedat}{3}
   (R_{x_\mathrm{f}} - R_{x_{\fs}}) &= 0 \xrightarrow{R_{x_{\fs}}=0}  &&(R_{x_\mathrm{f}} &= 0)\\
   (R_{y_\mathrm{f}} - R_{y_{\fs}}) &= 0 \xrightarrow{R_{y_{\fs}}=0}  &&(R_{y_\mathrm{f}} &= 0)\\
   (R_{z_\mathrm{f}} - R_{z_{\fs}}) &= 0 \xrightarrow{R_{z_{\fs}}=0}  &&(R_{z_\mathrm{f}} &= 0)\\
   (V_{x_\mathrm{f}} - V_{x_{\fs}}) &= 0 \xrightarrow{V_{x_{\fs}}=0}  &&(V_{x_\mathrm{f}} &= 0)\\
   (V_{y_\mathrm{f}} - V_{y_{\fs}}) &= 0 \xrightarrow{V_{y_{\fs}}=0}  &&(V_{y_\mathrm{f}} &= 0)\\
   (V_{z_\mathrm{f}} - V_{z_{\fs}}) &= 0 \xrightarrow{V_{z_{\fs}}=0}  &&(V_{z_\mathrm{f}} &= 0)\\ 
   m_{\mathrm{f}} \text{ free}\qquad\\
\end{alignedat}
\right.
\end{equation}
\end{spreadlines}
\end{document}
3
  • Thank you so much guys, having all these options it's helpful to better understand the way to manage math systems. – Catarella Apr 13 at 20:22
  • By the way, @Mico I'm referring to you because you've kept the original environment I'm using. Is there a way to better align "m_f free" with the rest of equations? I've noticed that it is slightly moved on the left side compared to the general vertical alignment. – Catarella Apr 13 at 20:31
  • 1
    @Catarella - Actually, my thinking was that by making the start of the final row stand slightly to the left of the (nearly) vertical line established by the preceding line items, the final row would be less likely to be overlooked or ignored. Put differently, I violated a typographic rule of thumb ("keep things neatly aligned") in order to better achieve greater readability. However, if you value neat and tidy alignment more than I do, I suggest you replace \qquad in the final row with something like \kern1.6em. (\qquad is equivalent to \kern2em, and \quad is equivalent to 1em.) – Mico Apr 13 at 21:06

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.