# A problem with Hebrew and English underlined text

When I'm combined at the same line Hebrew and English, the line below is "breaking" for two lines....
e.g.

MWE:

\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{fontspec}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Bellefair}

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\uline{אאא}\textenglish[variant=american]{\uline{aaa bbb}}
\end{document}


Do you how can I fix it?

Thank you!!

• Most typographers would answer the question with "Don't use underline". :) – David Richerby May 7 '19 at 10:57

Put the \textenglish{aaa} block inside the same \uline:

\documentclass[a4paper,numbers=noenddot]{scrartcl}
\usepackage{fontspec}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\defaultfontfeatures{Scale=MatchUppercase, Ligatures=TeX}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM Medium}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM Book}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Miriam CLM Book}

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage[variant=american]{english}

\begin{document}
\uline{אאא \textenglish{aaa}}
\end{document}


I made a handful of other trivial changes, such as removing unsupported Koma options and moving the language variant to the preamble instead of every time you change language. And one noticeable one, which was to scale all the fonts to the same height.

You are best served by setting a fixed value of \ULdepth. The automatic setting you get by default depends on the font -- in particular on the depth of the characters "(j".