I want to mix boxes and characters in a paragraph. But it looks sometimes no newline inserted, a box is overfull and the following character goes outside the paper.
Here is MWE (graphics are included to mimic boxes of different sizes)
\documentclass[a4paper,12pt]{article}
\usepackage[%
includeheadfoot, headheight=15pt, headsep=14pt, footskip=25pt,
top=8mm, bottom=8mm, left=1cm, right=1cm]{geometry}
\usepackage{pgffor}
\usepackage{varwidth}
\usepackage[demo]{graphicx}
\newcommand{\layoutimgs}[1] {%
\noindent%
\foreach \imgh / \imgw in {#1} {%
\includegraphics[height=\imgh,width=\imgw]{demo}%
;\hfill%
}%
}
\begin{document}
\layoutimgs{{11mm}/{157mm}, {5mm}/{191mm}}
\end{document}
The 2nd box gets overfull and the 2nd semicolon is missing.
I expect a new line starts after the 1st semicolon.

\allowbreakin horizontal mode when a line break candidate is desired, despite the complexity of TeX line breaking algorithm. – SongHerz Nov 15 '17 at 09:50