13

I want to have the following:

A graph can be cut in several ways including 
\begin {enumerate*} [label=\itshape\alph*\upshape)]
\item minimum cut, \item normalised cut and \item average cut. 
\end {enumerate*} 
In our project we have surveyed the Normalised Cut (Ncut)  algorithm for image segmentation.

A graph can be cut in several ways including 1) minimum cut, 2) normalised cut and 3) average cut. In our project we have surveyed the Normalised Cut (Ncut) algorithm for image segmentation.

0

3 Answers 3

21

You'll get an inline enumerated list if you (a) load the enumitem package with the inline option and (b) use the enumerate* environment:

enter image description here

\documentclass{article}
\usepackage[inline]{enumitem}
\begin{document}
A graph can be cut in several ways including 
\begin {enumerate*} [label=\itshape\alph*\upshape)]
\item minimum cut, \item normalised cut and \item average cut. 
\end {enumerate*} 
In our project we have surveyed the Normalised Cut (Ncut)  algorithm for image segmentation.
\end{document}
9

With the enumitem package and the inlineoption, it's easy. Use the shortlabels option to have a simpler way to format your labels, just like the enumerate package. Note that no punctuation is necessary: it is the environment that takes care of it.

\documentclass[12pt, a4paper]{report}

\usepackage[utf8]{inputenc}
\usepackage[textheight = 24cm]{geometry}
\pagestyle{empty}
\usepackage{lipsum}
\usepackage[inline, shortlabels]{enumitem}
\setlist{itemjoin ={,\enspace},itemjoin* = { and\enspace}}

\begin{document}

A graph can be cut in several ways including
\begin {enumerate*} [1) ]%
\item minimum cut \item normalised cut \item average cut.
\end {enumerate*}
In our project we have surveyed the Normalised Cut (Ncut)  algorithm for image segmentation.

\end{document} 

enter image description here

1
  • I just noticed that your screenshot doesn't correspond fully to the code you posted. (E.g., note the double instance of "and".) Please fix when it's convenient for you. Good news: your code still works. :-)
    – Mico
    Commented Dec 2, 2022 at 9:58
8

Roll your own inlineenum environment, if you are so inclined:

enter image description here

\documentclass{article}
\newcounter{inlineenum}
\renewcommand{\theinlineenum}{\alph{inlineenum}}
\newenvironment{inlineenum}
  {\unskip\ignorespaces\setcounter{inlineenum}{0}%
   \renewcommand{\item}{\refstepcounter{inlineenum}{\textit{\theinlineenum})~}}}
  {\ignorespacesafterend}
\begin{document}

A graph can be cut in several ways including
\begin{inlineenum}
  \item minimum cut,
  \item normalised cut and
  \item average cut. 
\end{inlineenum}
In our project we have surveyed the Normalised Cut (Ncut)  algorithm for image segmentation.

\end{document}

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