9

Consider the following definition:

\documentclass[a6paper]{article}
\usepackage[showframe]{geometry}
\usepackage{microtype}

\def\Dash{\unskip\thinspace\textemdash\thinspace\ignorespaces\allowbreak}

\begin{document}
Lorem ipsum doler sit amet. Here is some text that I don't know what
I'm typing but it's okay \Dash all I need is enough text for the line
break and then I can put in my custom dash at it \Dash because
\emph{I'm so clever}.  (This worked out surprisingly well.)
\end{document}

How can I define \Dash to properly protrude into the margin, as the hyphen character does?

output

10

The definition of \thinspace is

% latex.ltx, line 1315:
\def\thinspace{\kern .16667em }

so it's a kern; since it's not followed by glue it's not a feasible line break point.

You probably want \hspace{.16667em} instead of it; then \allowbreak is not needed. On the other hand, \ignorespaces does nothing at all where you place it, because its only action is to trigger expansion of \allowbreak. Spaces are ignored after \Dash anyway.

\documentclass[a6paper]{article}
\usepackage[showframe]{geometry}
\usepackage{microtype}

\newcommand\Dash{\unskip\thinspace\textemdash\hspace{.16667em}}

\begin{document}
Lorem ipsum doler sit amet. Here is some text that I don't know what
I'm typing but it's okay \Dash all I need is enough text for the line
break and then I can put in my custom dash at it \Dash because
\emph{I'm so clever}.  (This worked out surprisingly well.)
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.