Questions tagged [hyphenation]

190 questions
421
votes
7 answers

No line-break after a hyphen

I'm looking to prevent a line break after a hyphen - on a case-by-case basis that is compatible with all browsers. Example: I have this text: 3-3/8" which in HTML is this: 3-3/8” The problem is that near the end of a line, because of the…
Sparky
  • 98,165
  • 25
  • 199
  • 285
156
votes
17 answers

Detecting syllables in a word

I need to find a fairly efficient way to detect syllables in a word. E.g., Invisible -> in-vi-sib-le There are some syllabification rules that could be used: V CV VC CVC CCV CCCV CVCC *where V is a vowel and C is a consonant. E.g., Pronunciation…
user50705
  • 1,623
  • 2
  • 11
  • 6
125
votes
10 answers

How do I get LaTeX to hyphenate a word that contains a dash?

In a LaTeX document I'm writing, I get an overfull hbox warning because of the word "multi-disciplinary", which happens to be rendered at the end of a line. I can get rid of this particular warning by changing it into multi-discipli\-nary, but the…
Gyom
  • 3,773
  • 5
  • 29
  • 38
89
votes
6 answers

What's the opposite of a nbsp?

A   character is a space which doesn't allow for line breaking.

lorem ipsum here are some words and so on

| lorem ipsum | | here are some words and so | | on | What's the opposite…
nickf
  • 537,072
  • 198
  • 649
  • 721
51
votes
6 answers

Hyphenation in Android

As part of internationalizing an Android application I have come across the need to dynamically word wrap or hyphenate at the right position. All my strings are externalized in strings.xml files but I have not found any documentation about…
Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
42
votes
4 answers

Is it possible to enable auto-hyphenation in HTML/CSS?

My client has requested to enable auto-hyphenation on this page: http://carlosdinizart.com/biography/ , and I realized I've never actually seen it done on a web-page. Is it possible to set up auto-hyphenation in an HTML document with just HTML/CSS?…
hanazair
  • 819
  • 1
  • 10
  • 22
37
votes
2 answers

Preventing \texttt LaTeX tag from letting its content passing over the margin

In my report, I'm writing some class names or variable names inside of a paragraph, and I want these names to be rendered in a monospace font. Example: This is my class name: \texttt{baseAdminConfiguration}. Sometimes when the single word inside of…
jersub
  • 472
  • 1
  • 4
  • 7
30
votes
6 answers

UILabel: wrap and/or break inside word(s) with hyphen(s)

How do I set a UILabel lineBreakMode to break words and add hyphens to broken words? a label with a broken wo- rd should look like this
David Ben Ari
  • 2,259
  • 3
  • 21
  • 40
23
votes
4 answers

How to automatically apply ISBN hyphenation?

I've got ISBN numbers (10-digits and 13 digits) without the dashes. Now I'm looking for a way to add those dashes automatically. I found some useful information…
thasmo
  • 9,159
  • 6
  • 27
  • 32
20
votes
2 answers

Which JavaScript library should I use for client-side hyphenation?

I would like to implement client-side hyphenation via JavaScript on some large texts on my site. (I know about CSS3 hyphenation and will use it instead when available, but it's usually not available.) I have been using Hyphenator.js, and it works…
davidtheclark
  • 4,666
  • 6
  • 32
  • 42
18
votes
3 answers

WebKit Hyphenation

Has anyone successfully been able to implement hyphenation in any of the WebKit browsers? I've tried the CSS3 hyphenation style as well as -webkit-hyphens: auto. No dice for either of those. Or maybe I'm doing something wrong? Note: I've only tried…
dandax
  • 1,267
  • 3
  • 15
  • 22
17
votes
3 answers

How to represent class names in LaTeX?

what do you see as best way of presenting class names in LaTeX documents (writing about a piece of software). I'm currently using \texttt (monospaced typewrite font) which otherwise works fine but my class names end up goind "over" the margins. So,…
Touko
  • 11,359
  • 16
  • 75
  • 105
16
votes
1 answer

Python Regex for hyphenated words

I'm looking for a regex to match hyphenated words in Python. The closest I've managed to get is: '\w+-\w+[-w+]*' text = "one-hundered-and-three- some text foo-bar some--text" hyphenated = re.findall(r'\w+-\w+[-\w+]*',text) which returns list…
Sixhobbits
  • 1,508
  • 3
  • 17
  • 26
15
votes
2 answers

Show hyphens only when necessary? (soft-hyphens doesn't cut it)

Is it possible to use hyphens, or soft-hyphens in CSS, in such a way that hyphens are not rendered unnecessarily? My goal is to keep the original text as much as possible and break any words unless absolutely critical because they are too long to…
Drkawashima
  • 8,837
  • 5
  • 41
  • 52
14
votes
2 answers

Passing keyword arguments with a hyphen

I have a keyword argument function: def f1(**kw): for key,val in kw.iteritems(): print "key=%s val=%s" % (key,val) f1(Attr1 = "Val1", Attr2 = "Val2") # works fine. f1(Attr1-SubAttr = "Val1", Attr2 = "Val2") # complains about keyword…
Kumar
  • 143
  • 1
  • 4
1
2 3
12 13