Text Formatting ⇒ Ignored hyphens between random words and numbers
Ignored hyphens between random words and numbers
%-----------------------------------------
\documentclass[12pt,a4paper]{report}
\begin{document}
Elastic–plastic, stress-strain, model-independent, , high-resolution\\
350–-354, 130--136
\end{document}
%-----------------------------------------
On my installation this produces hyphens between "Stress-strain", "model-independent" and "high-resolution" but doesn't for "elastic–plastic". It also produces a long dash for "130--136" but only a normal hyphen for "350--354".
I am at a loss to explain this, particularly since it only arises for a single reference and hundreds of others work fine - can anyone help?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Ignored hyphens between random words and numbers
Code: Select all
\documentclass[12pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
Elastic–plastic, stress-strain, model-independent, , high-resolution\\
350–-354, 130--136
\end{document}
Re: Ignored hyphens between random words and numbers
When I include either of these options the missing hyphens appear as if a \H{U} command was entered.
Any idea what this means?
Ignored hyphens between random words and numbers
- 1. use UTF-8 input encoding with an editor which actually does support it, or
2. use dashes "TeX-way", i.e.: one dash for "short" dash, two dashes for an en-dash and three dashes for an em-dash. Here's how your example should look in this case:
Code: Select all
\documentclass[12pt,a4paper]{report}
\usepackage[T1]{fontenc}% it is a good idea to have this in any case, utf-8 or not
\begin{document}
Elastic--plastic, stress-strain, model-independent, ---, high-resolution\\
350--354, 130--136
\end{document}
Re: Ignored hyphens between random words and numbers
The obvious solution is just to delete the hyphens which don't appear and re-type them - it will look the same but be interpreted very differently. Seems stupidly simple now - thanks for your help meho_r!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Ignored hyphens between random words and numbers
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10