Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conceal non-line breaking space ~ (tie character) with a regular space #2654

Closed
kiryph opened this issue Mar 2, 2023 · 3 comments
Closed

Comments

@kiryph
Copy link
Contributor

kiryph commented Mar 2, 2023

The tilde character ~ or in this context called tie character (https://latexref.xyz/_007e.html ) can be concealed with a regular space.

before~after
The tie character, ~, produces a space between before and after at which the line will not be broken. By default the white space has length 3.33333pt plus 1.66666pt minus 1.11111pt (see Lengths).

Note that the word ‘tie’ has this meaning in the TeX/Texinfo community; this differs from the typographic term “tie”, which is a diacritic in the shape of an arc, called a “tie-after” accent in The TeXbook.

Here LaTeX will not break the line between the final two words:

Thanks to Prof.~Lerman.
In addition, despite the period, LaTeX does not use the end-of-sentence spacing (see @).

Ties prevent the end of line separation of things where that could cause confusion. They also still allow hyphenation (of either of the tied words), so they are generally preferable to putting consecutive words in an \mbox (see \mbox & \makebox).

@lervag
Copy link
Owner

lervag commented Mar 3, 2023

Well, yes, this does sound like a no brainer. But it feels "too easy"...

Also, thanks for giving the very relevant reference! I appreciate that, it helps in understanding the core idea - I already know about ~, but I never actually read this reference before!

lervag added a commit that referenced this issue Mar 3, 2023
@lervag lervag closed this as completed Mar 3, 2023
@kiryph
Copy link
Contributor Author

kiryph commented Mar 4, 2023

I noticed that

\documentclass{article}
\usepackage{natbib}

\begin{document}
(p.~181)
\citet[Sect.~3]{MyRef:2023}
\end{document}

is concealed as
Screenshot 2023-03-04 at 07 58 18

I would have expected that the tilde is also hidden in the optional argument of \citet.

@lervag
Copy link
Owner

lervag commented Mar 4, 2023

Done. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants