Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 09-22-2021, 06:16 AM   #1
Morea
Junior Member
Morea began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2021
Device: none
Feature Request: Make soft hyphen unicode character visible

Hi,

instead of generally using the Hyphenate this plugin I like to manually add soft hyphens to selected (long) words.

My problem: after doing so, I cannot see the added soft hyphen in the Calibre Editor. They are invisible.

Could please Calibre show a character for that soft hyphen in the hyphenated word, a greyed-out "-" or something like that?

This would make editing much easier in my opinion.

Morea is offline   Reply With Quote
Old 09-22-2021, 07:23 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just use a unicode symbol for them that isnt used in the text such as a special dash – or a centered dot · . Then you can use search and replace to easily switch them visible or invisible.
kovidgoyal is offline   Reply With Quote
Old 09-22-2021, 10:16 AM   #3
Morea
Junior Member
Morea began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2021
Device: none
But that would be a little bit too handmade solution for my taste. It could need to do several times search and replace along different html files. And when I forget the last one, I have funny characters in my ebook.

Why can't Calibre use a visible character for shy on its own like Libreoffice Writer does?
Morea is offline   Reply With Quote
Old 09-22-2021, 11:06 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can search and replace all html files with a single click.
kovidgoyal is offline   Reply With Quote
Old 09-22-2021, 11:19 AM   #5
Morea
Junior Member
Morea began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2021
Device: none
Yes I know. But what entity code do I have to search for?

And who gets the idea to search for invisible characters when he wants to find out the reason for a behaviour of his book file?

That's not very intuitive, in my opinion.
Morea is offline   Reply With Quote
Old 09-22-2021, 11:24 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Soft hyphens are not a very intuitive thing in the first place. In fact, they are a horrible kludge, which I would encourage you not to inflict on your books. They break all sorts of things, like searching.

And if you want to search for a soft hyphen use regex mode, with the find string as

\xad
kovidgoyal is offline   Reply With Quote
Old 09-22-2021, 11:37 AM   #7
Morea
Junior Member
Morea began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2021
Device: none
Quote:
They break all sorts of things, like searching.
Why?

Perhaps you can give up such a feature in English, but not in German with its long and composited words... you will never find all German word combinations in a dictionary.
Morea is offline   Reply With Quote
Old 09-22-2021, 11:54 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because when you search for abcdef it wont match abcdef in the book because in the book it will contain soft hyphens inside abcdef. Now some software goes the extra mile to try to work around that, but it is a huge pain. And there is no reason german or any other, language cannot be hyphenated dynamically.
kovidgoyal is offline   Reply With Quote
Old 09-22-2021, 12:23 PM   #9
Morea
Junior Member
Morea began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2021
Device: none
Nice to see that Calibre Viewer seems to goes that extra mile.
But my book reader does not.

So the solution for my bookreader is a bigger german dict file.

Thank you for your explanations!
Morea is offline   Reply With Quote
Old 09-22-2021, 01:45 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Would you not be better finding a different program to read your eBook that supports hyphenation?
JSWolf is offline   Reply With Quote
Old 09-22-2021, 06:43 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Morea View Post
Why?

Perhaps you can give up such a feature in English, but not in German with its long and composited words... you will never find all German word combinations in a dictionary.
Soft Hyphens are very bad.

I wrote about some of the reasons why in 2018: "Auto-Hyphenate" (many of those linked posts going back to 2013 + 2008!).

Across various devices/programs, they break:
  • Search
  • Spellchecking
  • Dictionaries
    • Where you press+hold to get a definition.
  • Highlighting
  • Copy/Pasting
  • Auto-Hyphenation
    • Especially in non-English languages.
    • Some languages have hyphenation rules where:
      • different/duplicate letters appear
      • accents drop off
      • hyphens needed at the end AND beginning of lines
  • ...

Like JSWolf said, much better to use a device/app that has built-in hyphenation for your language.

Almost all modern devices/apps have this now... for example, Kobos/Kindles already have built-in German hyphenation.

If you are on a very old device, perhaps there is a case to apply HyphenateThis! to your personal copy... but definitely never use it in an ebook meant for sale.

Note: Hyphenation Dictionaries work by patterns.

They list combinations of letters where hyphens can occur, then apply that across the entire text.

It's not like they list hundreds of thousands of every word known to man:

- hyphenate
- hyphenated
- hyphenates
- hyphenation
- hyphenations
- hyphenating

Instead, these hyphenation dictionaries list hundreds of patterns/rules like:

- "If a word ends in -ing OR -tion, you can stick a hyphen there."
- "If a word begins with anti- or semi-, you can stick a hyphen there."

Every language is going to have different patterns/rules, and people have already created these dictionaries for many of the main languages... even smaller ones like Welsh.

So even if you came up with some super cool new English word like:

- superduperliciousness

the device will auto-hyphenate correctly:

- su-per-duper-li-cious-ness

or let me toss it in my:

- hyphenatinginator
- hy-phen-ating-i-na-tor



Spoiler:
The dictionaries got those 2 made-up words almost perfect.

Could've had one between "du-per" + "at-ing".

But 99.9999+% of all auto-hyphens will be correct. There are only a few hundred words in English where the patterns got it wrong, and those exceptions are known and accounted for.


Quote:
Originally Posted by Morea View Post
Yes I know. But what entity code do I have to search for?

And who gets the idea to search for invisible characters when he wants to find out the reason for a behaviour of his book file?

That's not very intuitive, in my opinion.
Usually you notice invisible characters when things start going very wrong/strange:
  • Random question marks ? or � appearing in the middle of your EPUB
  • Red squigglies under perfectly spelled words
  • Random hyphens appearing/disappearing as you type.
  • ...

To get a list of ALL characters used in the EPUB:

In Calibre's Editor:

Tools > Reports > Characters

and in Sigil:

Tools > Reports > Characters in HTML Files

This will list "invisible characters" like Soft Hyphens, Thin Spaces, Zero-Width Joiners, etc.

You can double-click on a character in the Report, and it will fill in the correct codes in the Find box for you.

If I spot soft hyphens in the ebook, I make sure to always remove them.

Last edited by Tex2002ans; 09-22-2021 at 08:17 PM.
Tex2002ans is offline   Reply With Quote
Old 07-24-2023, 10:12 AM   #12
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,080
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
I remove them. They are for web-pages, not needed on ebooks.
Quoth is offline   Reply With Quote
Old 07-24-2023, 10:50 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Quoth View Post
I remove them. They are for web-pages, not needed on ebooks.
I am going to disagree. The one place soft-hyphens work and work very well is on a Kindle when using KF8. I use the Hyphenate This! plugin and it the Kindle handles soft-hyphens rather well.
JSWolf is offline   Reply With Quote
Old 07-24-2023, 11:45 AM   #14
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,080
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Almost no commercial or PD texts have soft hyphens of about 6,500 ebooks I've checked. I removed them from one.

I do read on the Sage mostly, but I read for years on PW1, then DXG, then PW3 and still check ebooks on mobi and azw3 on the Kindle Keyboard gen3 (maybe 1st decent 800 x 600 kindle when they retro-added azw3). The DXG was a bad buy, but I'd passed on the PW1
Then I got an original H20. I really can't see the value of adding soft hyphens.
I don't see a problem on the Sony PRS350, T2, tiny Y-Ben 4.7″, or various Android apps.
Quoth is offline   Reply With Quote
Old 07-25-2023, 10:20 AM   #15
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
Originally Posted by JSWolf View Post
I am going to disagree. The one place soft-hyphens work and work very well is on a Kindle when using KF8. I use the Hyphenate This! plugin and it the Kindle handles soft-hyphens rather well.
Roger that.

Hyphenate This works well and has language-specific dictionaries that can be loaded

I use it's option to remove soft hyphens until I'm ready to side load the book and then I add them back. Only takes a minute
phossler is offline   Reply With Quote
Reply

Tags
calibre, feature request, hyphenation


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Broken support for "soft hyphen" (SHY) quiris Marvin 17 07-07-2016 02:01 PM
Soft Hyphen lhuxley Editor 3 03-23-2015 08:02 PM
Soft hyphen Kumabjorn Writers' Corner 32 07-13-2014 12:00 AM
Feature request: make two or more files into one big file spikebrennan Calibre 4 07-19-2010 09:24 PM
Feature request: soft hyphens paulpeer Sigil 3 12-05-2009 01:43 PM


All times are GMT -4. The time now is 12:56 AM.


MobileRead.com is a privately owned, operated and funded community.