Using version control it is nice to have my source done more or less with single grammatical units (sentences, phrases, whatever) occupying single source lines. But that tends to result (at least for me) in lots of lines either beginning or ending with an M-dash (---
in the source).
I am finding that when that happens the line break is typeset as a space in the document. That is, there is an space between the M-dash and one, but only one, of the words to which it is adjacent. That is, specifically numbers 1 and 2 look wrong to me in the below code. Lines 4, 5 and 6 look fine if you like it that way, but only line 3 looks the way I would like it.
\documentclass{article}
\begin{document}
1. A line in the source with an M-dash at the end---
like that one; with no space before it in the source.
2. A line in the source with an M-dash at the beginning
---like this one; also with no spaces around it.
3. A line---this one, I mean---with M-dashes in the middle,
and no spaces around them.
4. This line has an M-dash at the end of the line ---
like that; but with a space before it.
5. This one has the M-dash at the beginning of a line
--- like it? But there is a space after it.
6. This line --- the last line --- has M-dashes in the
middle, with spaces around them.
\end{document}
I would really like to A) not have to resort to something ungainly for proofreading like a macro ("\sensiblemdash" or something like that) everywhere I use a dash; B) be able to end or begin lines with dashes; C) be able to use something in source that looks more or less like a dash; and D) not have to have my document typeset with spaces on both ends of the dash. (Regarding this last, I know that it is some people's preference, but, well, not mine, although I'm open to an argument.) I don't mind typing a space on both sides in my source, but I'd like it not typeset that way.
Edit: Forgot to say:
$ latex --version
pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016/Cygwin)
kpathsea version 6.2.2
%
to the end of the lines, else a space is generated there. That is,1. A line in the source with an M-dash at the end---% like that one; with no space before it in the source. 2. A line in the source with an M-dash at the beginning% ---like this one; also with no spaces around it.
See tex.stackexchange.com/questions/7453/…%
or else risk silently losing the whole rest of the line it is on....---
ligature just type an emdash directly as—
then it is easy to define the emdash - to ignore any space before or after.