I am writing a paper that has lots of equations and it gets tedious having to retype my layout for each equation. Is there a way to automatically generate my next few lines of code after I type \begin{equation}
For example, currently I have this:
\documentclass [a4paper,12pt]{report}
\usepackage{amsmath}
\usepackage{array,tabularx,calc}
\newlength{\conditionwd}
\newenvironment{conditions}[1][where:]
{%
#1\tabularx{\textwidth-\widthof{#1}}[t]{
>{$}l<{$} @{${}={}$} X@{}%>{\raggedright\arraybackslash}X@{}
}%
}
{\endtabularx\par\addvspace{\belowdisplayskip}}
\begin{document}
A computational model was devloped by \citet{brown1977glue} which performs the necessary calculations for transformed section analysis. The program calculates the maximum moment (m) using equation \ref{eqn:PROLAM moment}
\begin{equation}
m_i = \frac{E_s}{E_j} \left( \frac{I_sF_i}{C_i} \right)
\label{eqn:PROLAM moment}
\end{equation}
where:
\begin{itemize}[labelindent=20pt,leftmargin=*,widest=$M_x$,align=left,itemsep=0pt]
\item[$E_s$] is the MOE for the standard material
\item[$E_j$] MOE for the $i$-th lamination
\item[$F_i$] Allowable stress of the $i$-th lamination
\item[$I_s$] Is the moment of inertia of the transformed section
\item[$C_i$] "Distance between the neutral axis of the transformed section and the extreme fiber of the $i$-th lamination"
\end{itemize}
\end{document}
Which produces a layout like this:
Is it possible for me type out something like \begin{equationlist}
or \equationlist
and have the following code automatically generated:
\begin{equation}
\label{eqn:MY_LABEL}
\end{equation}
where:
\begin{itemize}[labelindent=20pt,leftmargin=*,widest=$M_x$,align=left,itemsep=0pt]
\item[]
.
.
.
\end{itemize}
I'm unsure if this has been asked anywhere else, i'm not exactly sure what to search for. I could just scroll up in my code and copy paste but generating this automatically would save me loads of time.
Edit: I am using Overleaf as my Tex editor
\begin{itemize}[labelindent=20pt,leftmargin=*,widest=$M_x$,align=left,itemsep=0pt]
over and over again, you could define your own list-like environment that automatically applies these options. If you decide to change the spacing later on, you only need to change it in the preamble once and it is applied throughout the document. – leandriis May 22 '20 at 16:08widest=
This equation's just happened to be$M_x$
. so this would be a parameter that changed everytime. Is it possible to set up this list-like environment with a changeable parameter? If so, any idea how I would go about it? – Aaron Rhodes May 22 '20 at 17:01widets=...
locally:\documentclass{article} \usepackage{enumitem} \newlist{myconditions}{itemize}{1} \setlist[myconditions]{labelindent=20pt,leftmargin=*,align=left,itemsep=0pt} \begin{document} \begin{myconditions}[widest=$M_x$] \item[$E_s$] is the MOE for the standard material \end{myconditions} \begin{myconditions}[widest=long item label] \item[long item label] is the MOE for the standard material \end{myconditions} \end{document}
– leandriis May 22 '20 at 17:06