Forum Bugs

Avoid a word to be hyphenated

nico
Hello,

I would like to avoid a given word to have an hyphen. I tried the "Word joiner" character (⁠) which is supposed to prohibit line breaks¹, but it doesn’t work. This seems to be a bug in Prince.

Could you tell me how to avoid a word to be hyphenated ?

Regards,

Nicolas

¹ https://en.wikipedia.org/wiki/Non-breaking_space
jim_albright
I believe there is a file that you can put your words showing desired hyphenation in ... just add word with no hyphenation. Look for TeX hyphenation.

Jim Albright
Wycliffe Bible Translators

dauwhe
We put a span around the word, and then set hyphens: none; on the CSS for that span.
nico
Thank you Jim and Dauwhe for your answers. I tried the solution with span and it works (see example below).

Regards,

Nicolas


<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<style>
		body { hyphens: auto; }
		.no-hyph { hyphens: none; }
		@page { size: 10.7cm 17.6cm; margin: 2cm; }
	</style>
</head>
<body>
	<p>Mary Poppins says supercalifragilisticexpialidocious.</p>
	<p>Mary Poppins says <span class="no-hyph">supercalifragilisticexpialidocious</span>.</p>
</body>
</html>

Edited by nico

nico
Another possibility is to use

white-space: nowrap;


For example :

<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<style>
		body { hyphens: auto; }
		.no-hyph { hyphens: none; }
		.no-wrap { white-space: nowrap; }
		@page { size: 10.7cm 17.6cm; margin: 2cm; }
	</style>
</head>
<body>
	<p>Mary Poppins says supercalifragilisticexpialidocious.</p>
	<p>Mary Poppins says <span class="no-hyph">supercalifragilisticexpialidocious</span>.</p>
	<p>Mary Poppins says <span class="no-wrap">supercalifragilisticexpialidocious</span>.</p>
</body>
</html>
mikeday
The latest build of Prince supports the U+2060 character.

Edited by mikeday