2

I am writing a journal for publication and because of the page limit I have to write text within the equation line. Here is my code:

    \documentclass[final]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{multirow}
    \usepackage{amssymb,amsmath,amsthm}
    \usepackage{color}
    \usepackage{graphicx}
    \usepackage{tikz}
    %\usepackage{epstopdf}% not needed
    \usepackage{romannum}
    \usepackage{algorithm}
    \usepackage{subcaption}
    \usepackage{graphicx}
    \usepackage{float}
    \usepackage{multicol}
    \usepackage[noend]{algpseudocode}
    \usepackage{tabularx}
    %\usepackage{romannum}% twice?
    \usepackage{lipsum}% to see in context
    \newcommand{\m}{\tilde{m}}% not \def
    \begin{document}    
    \lipsum 
     \begin{align}
        \mbox{ Next,}\ m_{BCH} - m_{ar} & = 8 k^2 - 1 - (k+1) \sqrt{n} \nonumber \\
        & =  8 k^2 - \sqrt{n} k - (\sqrt{n} + 1)\nonumber\\
        & =  8 (k - r_2) ( k + r_2 - \sqrt{n}/8), \label{eq:181}
    \end{align} 
    \end{document}

But as you can see in the attached image that the text "Next" is not aligned with the left page margin. I looks like I am starting a new paragraph with "Next" which is not the case. Can somebody help me to start the text "Next" from left margin of the page without separating the text line and equation line?

enter image description here

As a user commented to use flalign , I want to say that I tried it but it didn't work.

4
  • If you write a paragraph instead of using lipsum, the same happens? Also you are missing a documentclass
    – Mane32
    Apr 13 at 14:28
  • use flalign (full length align) but also you should provide an example, so people can test answers. Apr 13 at 14:31
  • @Mane32 ; Yes, same happens. I edited the code, please see it. Apr 13 at 14:48
  • @DavidCarlisle ; It didn't work. Apr 13 at 14:49

1 Answer 1

3

You can use flalign to spread the alignment "full length" and put the text in a new first column.

enter image description here

  \documentclass[final]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{multirow}
    \usepackage{amssymb,amsmath,amsthm}
    \usepackage{color}
    \usepackage{graphicx}
    \usepackage{tikz}
    %\usepackage{epstopdf}% not needed
    \usepackage{romannum}
    \usepackage{algorithm}
    \usepackage{subcaption}
    \usepackage{graphicx}
    \usepackage{float}
    \usepackage{multicol}
    \usepackage[noend]{algpseudocode}
    \usepackage{tabularx}
    %\usepackage{romannum}% twice?
    \usepackage{lipsum}% to see in context
    \newcommand{\m}{\tilde{m}}% not \def
    \begin{document}    
    \lipsum
     \begin{flalign}
      &\mbox{Next,}&\ m_{BCH} - m_{ar} & = 8 k^2 - 1 - (k+1) \sqrt{n} \nonumber \\
     && & =  8 k^2 - \sqrt{n} k - (\sqrt{n} + 1)\nonumber\\
      && & =  8 (k - r_2) ( k + r_2 - \sqrt{n}/8), \label{eq:181}
    \end{flalign} 
    \end{document}
2
  • With your code, the distance horizontal distance between $Next,$ and $m_{BCH}$ is too wide. Is there a way to avoid that? Apr 13 at 17:21
  • Add morre &&s to the right. Since they all expand the same amount, the more you have, the smaller they get. Apr 14 at 3:14

You must log in to answer this question.

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