2

I try to use \uline from the ulem package. Moreover, I need a command to carry some text. Unfortunately, \uline doesn't wrap the text carried by the command automatically.

Code:

enter image description here

Output: enter image description here

I think \expandafter should help, but I'm unfamiliar with it.

Remark: I cannot enter Chinese in the code, so I use a picture instead. And the code is compiled with xelatex.

2 Answers 2

2

As I mentioned, \expandafter solves the problem.

Code:

enter image description here

Output:

enter image description here

0

Have you considered using soul for underlining?

\documentclass{article}
% \usepackage[normalem]{ulem}
\usepackage{soul}

\newcommand{\sometext}{%
This is a slightly long title for testing the document class. This is a slightly long title for testing the document class.}

\begin{document}
\ul{%
This is a slightly long title for testing the document class. This is a slightly long title for testing the document class.}% work

\ul\sometext% works
\end{document}

underlining more easily

1
  • 1
    Thank you. I tried, but it had another problem, i.e. it does not work with Chinese. I am not sure whether I should ask a new question. Commented Sep 30, 2015 at 3:15

You must log in to answer this question.

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