1

I am looking for an environment to enumerate equations in a horizontal list with respect to their length such that they can spread into columns next to them:


Example


You can see that the integrals are short enough such that they fit in well. The fraction in (e) is so long that it spreads into the column where (c) is. What environment is most suitable for that?

  • 1
    You can use either the shortlst or the tasks package. For an example of both, you can look at this question. – Bernard Aug 11 '15 at 22:12
  • @Bernard shortlst seems to be what I want however it is not available via Miktex for some reasons. – Christian Ivicevic Aug 11 '15 at 22:34
  • 1
    Yes I know: it is neither in MiKTeX, nor in TeX Live, for licensing reasons, but you'll find it on CTAN. I once patched it to have the possibility to choose the number of columns. You have to install it by yourself in a TeXMF local root (which isn't very hard) and refresh the FNDB, that's all. – Bernard Aug 11 '15 at 22:38

3 Answers3

2

enter image description here

\documentclass{article}    
\usepackage{shortlst,amsmath}       
\begin{document}

\setlength{\shortitemwidth}{.3\linewidth}
\begin{shortenumerate}
    \item $\displaystyle a_n  = \frac{4n^3 - (-1)^nn^2}{5n + 2n^3}$
    \item $\displaystyle b_n  = \frac{(n^3 - 5n)^4 - n^{12}}{n^{11}}$
    \item $\displaystyle c_n  = \frac{n^{n + 1}}{n!}$
    \item $\displaystyle e_n  = \frac{2^{(n^3)}}{n!5^{(n^2)} - n^n}$
    \item $\displaystyle f_n  = \sqrt{n + \sqrt{2n}} - \sqrt{n + \sqrt{2n}}x$
\end{shortenumerate}

\end{document}

The shortlst can be found here and you can read the documentation also here. The package is neither in MiKTeX, nor in TeX Live, as pointed out by @Bernard for licensing reasons.

To set the maximum length of each item, you can say something like \setlength{\shortitemwidth}{.3\linewidth} to allow the items to overlap as in 3 and 5.

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
1

outputMay be like this

\begin{align*}
(a)~~ a_n & = \frac{4n^3 - (-1)^nn^2}{5n + 2n^3} & (b)~~ b_n & = \frac{(n^3 - 5n)^4 - n^{12}}{n^{11}} & (c)~~ c_n & = \frac{n^{n + 1}}{n!} \\
(d)~~ e_n & = \frac{2^{(n^3)}}{n!5^{(n^2)} - n^n}   & (e)~~ f_n & = \sqrt{n + \sqrt{2n}} - \sqrt{n + \sqrt{2n}}x
\end{align*}
1

This is a solution with shortlst patched so that you can choose the number of columns (default=3), line stretch (in case lines would overlap) and \laaabelsep, the distance between label and item body, through $3$ keys: nc, il and ls:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{shortlst, setspace, amsmath}
\usepackage{etoolbox}

\AtBeginEnvironment{shortenumerate}{\renewcommand\labelenumi{(\alph{enumi})}
\settowidth{\labelwidth}{\mbox{(m)}}}


\makeatletter
\newcounter{ncol}
\define@key{lex}{nc}[3]{\setcounter{ncol}{#1}}%% 3 columns by default
\define@key{lex}{il}[1.5]{\def\@intln{#1}}% interlining![1]
\define@key{lex}{ls}[0.6em]{\setlength{\labelsep}{#1}}%%distance between label and item body
\newenvironment{tabenumerate}[1][]{%\setlength\labelsep{0.6em}
\setkeys{lex}{nc,il,ls, #1}
\setlength{\leftmargini}{\dimexpr\labelwidth+\labelsep\relax}%[1][3]
\setlength{\shortitemwidth}{\dimexpr\linewidth/\value{ncol}-\labelwidth-2\labelsep\relax}%
\setstretch{\@intln}
\begin{shortenumerate}\everymath{\displaystyle}}%
{\end{shortenumerate}
 }%
 \newcommand\paritem[2][1]{\item \parbox[t]{#1\shortitemwidth}{\setstretch{1}#2\medskip}}
\makeatother
\renewcommand{\labelenumi}{(\alph{enumi})}

\begin{document}

\vspace*{1cm}
\begin{tabenumerate}[nc=3, il =2.5, ls =1em]
\item $ a_n = \frac{4n^3 - (-1)^nn^2}{5n + 2n^3}$
\item $ b_n = \frac{(n^3 - 5n)^4 - n^{12}}{n^{11}}$
\item $ c_n = \frac{n^{n + 1}}{n!}$
\item $ e_n = \frac{2^{(n^3)}}{n!5^{(n^2)} - n^n}$
\item $ f_n = \sqrt{n + \sqrt{2n}} - \sqrt{n + \sqrt{2n}}x$
\end{tabenumerate}

\end{document}

enter image description here

Bernard
  • 271,350