Hi, I am currently writing my thesis and encountered a problem with one of the references to an academic paper. Specifically, one hyphen was deleted from wherever one was placed in the source (e.g. cat-dog produced catdog, 350–-354 produced 350–354 (short hyphen). I initially thought this could be a problem with the link between jabref, bibtex and latex but when I copied the offending reference from the bbl file and into a separate .tex file it produced the same error. Here is the trimmed source:
%-----------------------------------------
\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?
Text Formatting ⇒ Ignored hyphens between random words and numbers
Ignored hyphens between random words and numbers
Last edited by FinTex on Wed Nov 17, 2010 7:28 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Ignored hyphens between random words and numbers
Try this:
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
Thanks for the suggestion meho_r,
When I include either of these options the missing hyphens appear as if a \H{U} command was entered.
Any idea what this means?
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
Let me guess, you're using TXC, right? The problem is that you're using en-dash by entering it as a single character, and that requires UTF-8 input encoding (which TXC, if you're using it, doesn't support yet). So, you should either:
- 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
I use both TexMaker and TeXnicCenter. I have managed to set TexMaker to run in utf-8 and compile with XeTeX. Now I think I see the problem... The source now puts a square character where the problem hyphens used to appear. I suspect that this reference was copied and pasted into JabRef from a pdf file which can screw up the characters. While they appeared as hyphens in the source, they were being interpreted as unknown characters and ignored.
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!
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
Now that the problem seems to besolved, please be so kind and mark the topic accordingly as clearly written in Section 3 of the Board Rules (to be read before posting). Otherwise please tell us what is missing. Please keep that in mind for the future so that further reminders will not be necessary.
Best regards and welcome to the board
Thorsten
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10