0

I want to align the equations in the following example. Due to the class it uses which I am not sure I am allowed to upload due to copyright issues (its a class subject to copyright by Wiley), I would like to just give the code hoping my goal is obvious:

\section{Test}  
Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl     Blablablablablabl Blablablablablabl Blablablablablabl     Blablablablablabl Blablablablablabl Blablablablablabl     Blablablablablabl Blablablablablabl Blablablablablabl     Blablablablablabl Blablablablablabl Blablablablablabl     Blablablablablabl Blablablablablabl Blablablablablabl  

\noindent
\begin{minipage}[t]{0.35\textwidth}
\begin{multline}
%\begin{flalign}
m_R \ddot x_G + d_G \dot x_A + k_G x_R = r_1 G_{R1} \\- k_R x_{R0} - F_{R0} - F_{ES}(x_1,  \dot x_G, l_M)
%\end{flalign}
\end{multline}
\end{minipage} %
\begin{minipage}[t]{0.57\textwidth}
\begin{flalign}
C_{1} \dot{l}_S &= w_R - r_T- A_{S}\dot{x}_r &\\
C_{\alpha1} \dot{m}_1 &= -r_R  - \gamma_F A \sqrt{p_1} + q_l + A_{S2}\dot{x}_R.  &   
\end{flalign}
\end{minipage}

Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl 

\end{document}

This yields the following output:

enter image description here

As you can see, two things are annoying: Firstly equation 1) is placed "below" the equation block on the right. Second, the numbering in the second column is placed outside of the intended textwidth. Is there anything obvious that could improve this? Thank you in advance!

EDIT: an MWE making use of the article-class reads like the below code. The outcome is somewhat different from the original screenshow but shows similar problems.

\documentclass[11pt,
paper=a4,
bibtotocnumbered,     % Literaturverzeichnis ins Inhaltsverzeichnis
liststotocnumbered,  % Alle Listen ins     Inhaltsverzeichnis                           
DIV=calc,         % führt die Satzspiegelberechnung neu aus
%oneside,         % einseitiger Druck
tablecaptionabove,    % Tabellenüberschriften aktivieren
%BCOR=16mm,   % Bindekorrektur
headinclude,
%footinclude
]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{mathtools}

%% bei pdflatex: Übsetzung von eps-Files in pdf-Files
\usepackage{epstopdf}
\DeclareGraphicsExtensions{.eps}
%%
\begin{document}





\section{Test}  
Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl  

\noindent
\begin{minipage}[t]{0.35\textwidth}
\begin{multline}
%\begin{flalign}
m_R \ddot x_G + d_G \dot x_A + k_G x_R = r_1 G_{R1} \\- k_R x_{R0} - F_{R0} - F_{ES}(x_1,  \dot x_G, l_M)
%\end{flalign}
\end{multline}
\end{minipage} %
\begin{minipage}[t]{0.57\textwidth}
\begin{flalign}
C_{1} \dot{l}_S &= w_R - r_T- A_{S}\dot{x}_r &\\
C_{\alpha1} \dot{m}_1 &= -r_R  - \gamma_F A \sqrt{p_1} + q_l +     A_{S2}\dot{x}_R.  &   
\end{flalign}
\end{minipage}
Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl Blablablablablabl 

\end{document}
  • 1
    is there any reason why you can not complete this example using article class? If you can, that helps people test answers, if you can not, then the problem is in wiley's class not the posted code. – David Carlisle May 9 '16 at 12:47
  • Thank you for your remark. I can post an MWE in article class for sure, however, textwidth will likely be different and not exhibit the second problem I described. – user62795 May 9 '16 at 13:01
  • the first minipage is apparently too narrow for what's being put in it. that's why the equation number is placed below the equation block; make it a bit wider. try putting \leavevmode before the \noindent; that's just a guess (although the \noindent should put this into horizontal mode, it won't hurt to be sure). – barbara beeton May 9 '16 at 13:02
  • Thank you, Barbara, I'll figure it out in a second. I just extended my question with an MWE, the output is different than the original screenshot, however. – user62795 May 9 '16 at 13:04
  • The Blablabla does not break at the right margin (Latex doesn't know how to hypenate it). Just use the lipsum package for dummy text. – John Kormylo May 9 '16 at 13:09
1

The log warns you

Overfull \hbox (27.06107pt too wide) detected at line 36
 []$[]  \OML/cmm/m/it/10.95 m[][] \OT1/cmr/m/n/10.95 + \OML/cmm/m/it/10.95 d[][
] \OT1/cmr/m/n/10.95 + \OML/cmm/m/it/10.95 k[]x[] \OT1/cmr/m/n/10.95 = \OML/cmm
/m/it/10.95 r[]G[]$ 

Overfull \hbox (33.16125pt too wide) detected at line 36
 []$[] \OMS/cmsy/m/n/10.95 ^^@ \OML/cmm/m/it/10.95 k[]x[] \OMS/cmsy/m/n/10.95 ^
^@ \OML/cmm/m/it/10.95 F[] \OMS/cmsy/m/n/10.95 ^^@ \OML/cmm/m/it/10.95 F[]\OT1/
cmr/m/n/10.95 (\OML/cmm/m/it/10.95 x[]; []; l[]\OT1/cmr/m/n/10.95 )$ [] 

(ignoring the other spurious warnings about the overfull lines from the dummy text)

so the display is simply too wide for the space, you need to use align or multline or some such to split it over multiple lines.

Note that

\noindent
\begin{minipage}[t]{0.35\textwidth}
\end{multline}
\end{minipage} %
\begin{minipage}[t]{0.57\textwidth}

puts one word space between two minipages of total width .92\textwidth so they may be less than or more than a line depending on the font size relative to text width, and the right hand edge of the second box is unlikely to be aligned with the page margin.

Safer to use

 \end{multline}
\end{minipage}\hfill
\begin{minipage}[t]{0.57\textwidth}

so the minipages are always padded apart by enough to exactly fill the line.

1

Your MWE does not match the \textwidth displayed in the image, so I used geometry to increase it. I added an \fbox around each minipage to help visualize the problem. For some reason, the gap above first line of multline is larger than that for flalign. Finally, a simple \medskip will do for gaps above and below the minipages. I was just showing off.

\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{mathtools}
\usepackage{lipsum}
\begin{document}
\section{Test}  
\lipsum[1]
\vskip\abovedisplayskip\noindent
\fboxsep=0pt
\fbox{\begin{minipage}[b]{0.35\textwidth}
\abovedisplayskip=0pt
\begin{multline}
m_R \ddot x_G + d_G \dot x_A + k_G x_R = r_1 G_{R1} \\- k_R x_{R0} - F_{R0} - F_{ES}(x_1,  \dot x_G, l_M)
%\end{flalign}
\end{multline}
\end{minipage}}\hfill\fbox{%
\begin{minipage}[b]{0.57\textwidth}
\abovedisplayskip=0pt
\begin{flalign}
C_{1} \dot{l}_S &= w_R - r_T- A_{S}\dot{x}_r &\\
C_{\alpha1} \dot{m}_1 &= -r_R  - \gamma_F A \sqrt{p_1} + q_l + A_{S2}\dot{x}_R.  &   
\end{flalign}
\end{minipage}}
\vskip\belowdisplayskip
\lipsum[2]

\end{document}

demo

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.