# How to calculate the width of a space?

Using the questions:

I am trying to set my inline list inter space to one space \ using this code:

\documentclass{article}
\usepackage{enumitem}

\newlist{inlinelist}{enumerate*}{1}
\setlist*[inlinelist,1]{label=}
\usepackage{calc}

\begin{document}

some text \begin{inlinelist}[label=,itemjoin=\the\widthof{\ }]
\item First Keyword.
\item Second Keyword.
\item Third Keyword.
\end{inlinelist} more text

\end{document}


But it is not setting the correct size and it is showing some stranger text:

How can I properly calculate the size of a space \ and set the itemjoin to this value?

Two ways:

\documentclass{article}
\usepackage{enumitem}

\newlist{inlinelist}{enumerate*}{1}
\setlist*[inlinelist,1]{label=}
\newlength{\interwordspace}
\settowidth{\interwordspace}{\ }

\begin{document}

some text \begin{inlinelist}[label=,itemjoin=\hspace{\interwordspace}]
\item First Keyword.
\item Second Keyword.
\item Third Keyword.
\end{inlinelist} more text

some text \begin{inlinelist}[label=,itemjoin=\hspace{\fontdimen2\font}]
\item First Keyword.
\item Second Keyword.
\item Third Keyword.
\end{inlinelist} more text

\end{document}


Note that \widthof can only be used in the context of setting lengths and some other few cases, but not after \the (but \the would be misused, in this application, because it only produces strings of characters, see The \the command).

What about itemjoin={ }?

\documentclass{article}
\usepackage{enumitem}

\newlist{inlinelist}{enumerate*}{1}
\setlist*[inlinelist,1]{label=}

\begin{document}

some text\begin{inlinelist}[,itemjoin={ }]
\item First Keyword
\item Second Keyword
\item Third Keyword
\end{inlinelist}
more text

some text First Keyword Second Keyword Third Keyword more text
\end{document}


• Thanks! This was what I wanted when I looked into setting the item join space to a space. Somehow using the space width was doubling it. – user Sep 10 '17 at 16:18