[Tex/LaTex] How to write a list of formulas

equationsformattingnumberingtables

I am writing a list of physical formulas, so I create this MWE:

\documentclass[12pt,a4paper]{article}

\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tasks}

\usepackage[top=1cm,bottom=1cm,left=1cm,right=1cm,marginparwidth=1.75cm]{geometry}

\begin{document}

\section*{Example 1}

\begin{tasks}(2)
\task \textbf{Example a.} $formula$
\task \textbf{Example b.} $\dfrac{x+22222}{2121}$
\task \textbf{Función X.} $f(x)=x+523134121\displaystyle\prod{xxxxxyyyyyt}$
\task \textbf{Example d.} $\dfrac{\displaystyle\lim_{x\to a}{f(x)}\vec x}{2}$
\task \textbf{Mean Value Theorem.} $abvddcdd$
\end{tasks}

\section*{Example 2}

\begin{tasks}(2)
\task \textbf{Example f.} $formula$
\task \textbf{Example g.} $another \text{formula}$
\end{tasks}

\end{document}

Example

I have many more formulas, however I find it difficult to continue in this way for five reasons:

  1. I do not know how to correctly express the disposition of the items (two columns? Three?);
  2. There are times when two formulas, one on top of the other, are stuck together, and the visual aspect is bad;
  3. At most each element has two columns: Description. $formula$. Write the text in bold for each item and $...$ are a waste of time;
  4. I do not know how to continue the numbering automatically between each section (I could change the counter but it is another waste of time because if I add a formula in the middle of the others I must manually change the value);
  5. There are some formulas that have no description, only $...$.

Does anyone know how to reduce the time spent writing each item homogeneously?

Feel free to change the tags.

Thanks!

Best Answer

My proposal is to create a new environment, with a tabular whose column definitions allow you to have bold descriptions and math formulae without code repetition.

For the numbering, I copied from How to enumerate the rows of a table.

\documentclass[12pt,a4paper]{article}

\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[top=1cm,bottom=1cm,left=1cm,right=1cm,marginparwidth=1.75cm]{geometry}

\usepackage{array}
\newcounter{rowcount}
\setcounter{rowcount}{0}
\renewcommand{\arraystretch}{2}
\usepackage{environ}
\NewEnviron{mialista}{%
\begin{flushleft}
\begin{tabular}{@{\stepcounter{rowcount}\makebox[2em][r]{\therowcount)}\hspace*{\tabcolsep}}%
>{\bfseries\raggedright\arraybackslash}p{.3\linewidth}>{$}l<{$}}        
\BODY
\end{tabular}
\end{flushleft}
}

\begin{document}

\section*{Example 1}
\begin{mialista}
Example a.&  formula\\
Example b. & \dfrac{x+22222}{2121}\\
Función X. & f(x)=x+523134121\displaystyle\prod{xxxxxyyyyyt}\\
Example d. & \dfrac{\displaystyle\lim_{x\to a}{f(x)}\vec x}{2}\\
Mean Value Theorem. & abvddcdd\\
\end{mialista}

\section*{Example 2}

\begin{mialista}
Example f. & formula\\
Example g. & another \text{\ formula}\\
\end{mialista}

\end{document}

enter image description here

Related Question