2

I need do align some (not all) of equations to the left. So also I want to avoid weird formatting of them

so that is what $\displaystyle ...$ does enter image description here

Interline space is tiny. To increase it, I can use \[ \] environment, but it centers equations: enter image description here

Though space between lines is ok. So I can try flalign*

{\setlength{\abovedisplayskip}{0pt}%
\begin{flalign*}
& f(\theta)=cos^a(\theta)&\\
& cos^{2\alpha}\theta^{\circ}_{\text{ск}}=1/2&\\
& \alpha=0.5\cdot\frac{log0.5}{log(cos(18^\circ))}=6.91&\\
& cos^{2\alpha}\theta^{\circ}_{\text{Д}}=t=0.013&\\
& \theta_\text{Д}=arccos(\sqrt[2\alpha]{t_\text{ед}})=43.24&\\
\end{flalign*}%
}

enter image description here

As you can see, interline space decreases again (but it is bigger than in $...$ variant), and there is also space before and after the block, though I tried to get rid of it as it is described here

I've triedalign* too

формулой для аппроксимации ДН элемента: \par\noindent
$\begin{aligned}
&f(\theta)=cos^a(\theta) &\\
&cos^{2\alpha}\theta^{\circ}_{\text{ск}}=1/2 &\\
&\alpha=0.5\cdot\frac{log0.5}{log(cos(18^\circ))}=6.91 &\\
&cos^{2\alpha}\theta^{\circ}_{\text{Д}}=t=0.013 &\\
&\theta_\text{Д}=arccos(\sqrt[2\alpha]{t_\text{ед}})=43.24 &\\
\end{aligned}$

enter image description here

It's OK about spaces before and after, but spacing between lines is decreased.

Also I can not use fleqn as I want to be left-aligned only part of the equations, not all of them.

SO what can I do?

P.S. Yes, I can add \vspace after each line, but maybe there is another,better way to do this. Thanks!

lazba
  • 102
  • 3
    unrelated to alignment but use \sin and \cos never use math italic for multi-letter names, it is designed to look like a product of one-letter variables – David Carlisle Dec 13 '21 at 14:26

2 Answers2

6

The simplest solution uses the fleqn environment, from nccmath:

\documentclass{article}
\usepackage{amsmath, nccmath}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.4pt}

\begin{document}

This equation is left-aligned: \begin{fleqn} \begin{align} & f(\theta)=\cos^a(\theta) \ & \cos^{2\alpha}\theta^{\circ}{\text{ск}}=1/2 \ & \alpha=0.5\cdot\frac{\log0.5}{\log(\cos(18^\circ))}=6.91 \ & \cos^{2\alpha}\theta^{\circ}{\text{Д}}=t=0.013\ & \theta_\text{Д}=\arccos(\sqrt[2\alpha]{t_\text{ед}})=43.24 \end{align}% \end{fleqn}

\end{document}

enter image description here

Bernard
  • 271,350
  • As I said in the original post, I don't want to use fleqn because I want only some of equations flush left, not all. How can I centerothers& – lazba Dec 13 '21 at 15:36
  • 6
    @lazba please look again at Bernard's answer. The package gives a fleqn environment specifically so you can apply it to just some equations – David Carlisle Dec 13 '21 at 15:42
  • Oh, really! my fault – lazba Dec 13 '21 at 15:54
4

You may use the \IEEEeqnarray environment along with the * type glue to align the equations to the left. The related manual is available here. Appendix F of this manual describes the usage of the environment. Also, you can control the vertical spacing above and below the equation using the solution from the question you linked.

\documentclass{article}
\usepackage{amsmath}
\usepackage{IEEEtrantools}
\usepackage{lipsum}
\usepackage{showframe}

\begin{document} \section{Default Spacing} \lipsum[1][1] \begin{IEEEeqnarray}{l} f(\theta)=cos^a(\theta) \ \cos^{2\alpha}\theta^{\circ}{\text{ск}}=1/2 \ \alpha=0.5\cdot\frac{\log0.5}{\log(cos(18^\circ))}=6.91 \ \cos^{2\alpha}\theta^{\circ}{\text{Д}}=t=0.013 \ \theta_\text{Д}=arccos(\sqrt[2\alpha]{t_\text{ед}})=43.24 \end{IEEEeqnarray} \lipsum[1][2]

\section{User Defined Spacing} \lipsum[1][1] {\setlength{\abovedisplayskip}{0pt} \setlength{\belowdisplayskip}{0pt} \begin{IEEEeqnarray}{l} f(\theta)=cos^a(\theta) \ \cos^{2\alpha}\theta^{\circ}{\text{ск}}=1/2 \ \alpha=0.5\cdot\frac{\log0.5}{\log(cos(18^\circ))}=6.91 \ \cos^{2\alpha}\theta^{\circ}{\text{Д}}=t=0.013 \ \theta_\text{Д}=arccos(\sqrt[2\alpha]{t_\text{ед}})=43.24 \end{IEEEeqnarray}}% \lipsum[1][2]

\section{Default Spacing} \lipsum[1][1] \begin{IEEEeqnarray}{l} f(\theta)=cos^a(\theta) \ \cos^{2\alpha}\theta^{\circ}{\text{ск}}=1/2 \ \alpha=0.5\cdot\frac{\log0.5}{\log(cos(18^\circ))}=6.91 \ \cos^{2\alpha}\theta^{\circ}{\text{Д}}=t=0.013 \ \theta_\text{Д}=arccos(\sqrt[2\alpha]{t_\text{ед}})=43.24 \end{IEEEeqnarray} \lipsum[1][2]

\end{document}

enter image description here

Imran
  • 3,096