Mover a segunda linha em uma equação para a esquerda com divisão

Mover a segunda linha em uma equação para a esquerda com divisão

Eu tenho a seguinte equação:

\begin{equation}
\begin{split}
f_a(w_1,\ldots,w_m,&z_{w_1pa},\ldots,z_{w_mpa},a) = \\
&\prod_{j\in \{1,\ldots,m\} \mid z_{w_jpa} \neq \emptyset} \left( \left|z_{w_jpa} - a\right| + \left(-1\right)^{|z_{w_jpa} - a|} w_j\right)\\
\end{split}
\end{equation}

O resultado deste código é que aqui desejo mover a segunda linha da equação para a esquerda para que o rótulo da equação não use outra linha.

Responder1

Adicione \hspace*{-15pt}depois &assim:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
   \begin{split}
f_a(w_1,\ldots,w_m,&z_{w_1pa},\ldots,z_{w_mpa},a) = \\
&\hspace*{-15pt}\prod_{j\in \{1,\ldots,m\} \mid z_{w_jpa} \neq \emptyset}     \left( \left|z_{w_jpa} - a\right| + \left(-1\right)^{|z_{w_jpa} - a|} w_j\right)
\end{split}
\end{equation}
\end{document}

 \hspace* ensures that the space is given unlike other 
\hspace, \hskip commands especially when given at the 
beginning of the line.

Responder2

Exclua o último \\. Proponho quatro outras variantes, das quais multlinedrequer carregamento mathtools em vez de amsmath; tem-se a equação inteira em uma linha:

\documentclass[12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage[showframe]{geometry}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}

\begin{document}

\begin{multline}
  f_a(w_1,\ldots,w_m,z_{w_1pa},\ldots,z_{w_mpa},a) =\\%
  \prod  _{j \in \{1,\ldots,m\} ∣z_{w_jpa} \neq \emptyset} \bigl( \abs{z_{w_jpa} - a} + \left(-1\right)^{\abs{z_{w_jpa} - a}} w_j\bigr)
\end{multline}
\vskip 0.5cm

\begin{equation}
  \begin{split}
    f_a(w_1,\ldots,w_m,{}&z_{w_1pa},\ldots,z_{w_mpa},a) = \\
    &\prod  _{j \in \{1,\ldots,m\} ∣z_{w_jpa} \neq \emptyset} \left( \abs{z_{w_jpa} - a} + \left(-1\right)^{\abs{z_{w_jpa} - a}} w_j\right)
  \end{split}
\end{equation}
\vskip 0.5cm

\begin{equation}
  \begin{multlined}
    f_a(w_1,\ldots,w_m, z_{w_1pa},\ldots,z_{w_mpa},a) = \\
    \prod  _{j \in \{1,\ldots,m\} ∣z_{w_jpa} \neq \emptyset} \left( \abs{z_{w_jpa} - a} + \left(-1\right)^{\abs{z_{w_jpa} - a}} w_j\right)
  \end{multlined}
\end{equation}%
\vskip 0.5cm

\begin{equation}
  \begin{aligned}
    \MoveEqLeft f_a(w_1,\ldots,w_m, z_{w_1pa},\ldots,z_{w_mpa},a) = \\
      & \prod  _{j \in \{1,\ldots,m\} ∣z_{w_jpa} \neq \emptyset} \left( \abs{z_{w_jpa} - a} + \left(-1\right)^{\abs{z_{w_jpa} - a}} w_j\right)
  \end{aligned}
\end{equation}%
\vskip 0.5cm

\begin{equation}
  f_a(w_1,\ldots,w_m,{}z_{w_1pa},\ldots,z_{w_mpa},a) = \\
  \prod  _{\mathclap{\substack{j \in \{1,\ldots,m\} \\ z_{w_jpa} \neq \emptyset}}}\!\left( \abs{z_{w_jpa} - a} + \left(-1\right)^{\abs{z_{w_jpa} - a}} w_j\right)
\end{equation}
\end{document}

insira a descrição da imagem aqui

Responder3

Você pode definir isso colocando o comando align &. No momento você está alinhando o lado esquerdo do seu produto com za linha acima. Basta brincar com esses posicionamentos.

Duas observações: não digite \\na última linha. Se você alinhar na ,zprimeira linha, desativará o espaçamento automático após a vírgula. Por favor, faça ,{}&zisso.

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\setcounter{equation}{7}
% without any alignment.
\begin{equation}
    \begin{split}
        f_a(w_1,\ldots,w_m,z_{w_{1\mathrm{pa}}},\ldots,z_{w_{m\mathrm{pa}}},a) = \\
        \prod_{\mathclap{j\in \{1,\ldots,m\} \mid z_{w_{j\mathrm{pa}}} \neq \emptyset}} \bigl( |z_{w_{j\mathrm{pa}}} - a| + (-1)^{|z_{w_{j\mathrm{pa}}} - a|} w_j\bigr)
    \end{split}
\end{equation}

% aligned left
\begin{equation}
    \begin{split}
        &f_a(w_1,\ldots,w_m,z_{w_{1\mathrm{pa}}},\ldots,z_{w_{m\mathrm{pa}}},a) = \\
        &\prod_{\mathrlap{j\in \{1,\ldots,m\} \mid z_{w_{j\mathrm{pa}}} \neq \emptyset}} \bigl( |z_{w_{j\mathrm{pa}}} - a| + (-1)^{|z_{w_{j\mathrm{pa}}} - a|} w_j\bigr)
    \end{split}
\end{equation}

% aligned to the z as in your MWE
\begin{equation}
    \begin{split}
        f_a(w_1,\ldots,w_m,{}&z_{w_{1\mathrm{pa}}},\ldots,z_{w_{m\mathrm{pa}}},a) = \\
        &\prod_{\mathclap{j\in \{1,\ldots,m\} \mid z_{w_{j\mathrm{pa}}} \neq \emptyset}} \bigl( |z_{w_{j\mathrm{pa}}} - a| + (-1)^{|z_{w_{j\mathrm{pa}}} - a|} w_j\bigr)
    \end{split}
\end{equation}
\end{document}

insira a descrição da imagem aqui


fora do tópico: eu recomendaria escrever = na segunda linha. Verhttps://tex.stackexchange.com/a/172110

Responder4

Este é um trabalho para multline; Alterei o subscrito complicado usando \substackisso para evitar torná-lo muito longo. Observe que eu prefiro a primeira versão não ajustada.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

This is the default rendering
\begin{multline}
f_a(w_1,\ldots,w_m,z_{w_1pa},\ldots,z_{w_mpa},a) = \\
\prod_{\substack{j\in \{1,\ldots,m\} \\ z_{w_jpa} \neq \emptyset}} 
  \Bigl( \lvert z_{w_jpa} - a\rvert + (-1)^{|z_{w_jpa} - a|} w_j\Bigr)
\end{multline}
and this happens if you add some balanced spaces
\begin{multline}
\hspace{4em}
f_a(w_1,\ldots,w_m,z_{w_1pa},\ldots,z_{w_mpa},a) = \\
\prod_{\substack{j\in \{1,\ldots,m\} \\ z_{w_jpa} \neq \emptyset}} 
  \Bigl( \lvert z_{w_jpa} - a\rvert + (-1)^{|z_{w_jpa} - a|} w_j\Bigr)
\hspace{4em}
\end{multline}

\end{document}

insira a descrição da imagem aqui

informação relacionada