Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-22-2011, 03:09 AM   #1
habanr
Junior Member
habanr began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2011
Location: Europe
Device: Amazon Kindle
Is it possible to define rules for non break space?

I try to find way, how automatically insert non break space after some Czech language one letter words (prepositions, conjunctions) as "s", "a", "v", "z" which cannot be alone at the end od line as an orphan and must be (because of typographic rules) connected with following word using non break space. Is there any way, how to define on user level such rules in Calibre? Another problem is with quotes. English quotes the same at the beginning and at the end of quoted phrase e.g. "something", but in Czech proper quotes are „something“ (left alt + 0132, left alt + 0147)
habanr is offline   Reply With Quote
Old 02-22-2011, 04:25 AM   #2
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
You can use the search and replace feature to do something like this. You could try this for a start:
Code:
(?<=\b(s|a|v|z)\b)\s
Replace with:
Code:
&nbsp;
Edited - the original version was looking for a space before the letter instead of after.

Last edited by ldolse; 02-22-2011 at 04:28 AM.
ldolse is offline   Reply With Quote
Old 02-22-2011, 04:30 AM   #3
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
For quotes you could do 1 or two steps - if your book already uses curly or 'smart' quotes then you can use search and replace to replace the open quote with a czech style one. If it is using ASCII quotes then you can do a two step conversion - first convert with the 'Smarten Punctuation' option enabled under look and feel. Then re-convert a second time, and use the Search and Replace feature to replace the open quote.
ldolse is offline   Reply With Quote
Old 02-22-2011, 07:10 AM   #4
habanr
Junior Member
habanr began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2011
Location: Europe
Device: Amazon Kindle
Quote:
Originally Posted by ldolse View Post
You can use the search and replace feature to do something like this. You could try this for a start:
Code:
(?<=\b(s|a|v|z)\b)\s
Replace with:
Code:
&nbsp;
Edited - the original version was looking for a space before the letter instead of after.
Previous "Search & Replace" causes the conversion to crash see.

calibre, version 0.7.46
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1 (Válka s Mloky)

Convert book 1 of 1 (Válka s Mloky)
Resolved conversion options
calibre version: 0.7.46
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_justification': u'left',
'chapter': u"//*[(name()='h1' or name()='h2') or @class = 'chapter']",
'chapter_mark': u'pagebreak',
'comments': None,
'cover': 'c:\\users\\userxxx\\appdata\\local\\temp\\calibre _0.7.46_tmp_e40dlm\\calibre_0.7.46_qpcxra.jpeg',
'debug_pipeline': u'D:\\Books-import\\Debug',
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_compress': False,
'enable_heuristics': False,
'extra_css': None,
'fix_indents': True,
'font_size_mapping': None,
'format_scene_breaks': False,
'html_unwrap_factor': 0.4,
'input_encoding': u'utf-8',
'input_profile': <calibre.customize.profiles.InputProfile object at 0x05659050>,
'insert_blank_line': True,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': True,
'language': None,
'level1_toc': u'//h:h1',
'level2_toc': u'//h:h2',
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': True,
'margin_bottom': 4.0,
'margin_left': 4.0,
'margin_right': 2.0,
'margin_top': 2.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'mobi_ignore_margins': False,
'no_chapters_in_toc': False,
'no_inline_navbars': True,
'no_inline_toc': False,
'output_profile': <calibre.customize.profiles.KindleOutput object at 0x05659370>,
'page_breaks_before': u'/',
'personal_doc': u'[PDOC]',
'prefer_author_sort': False,
'prefer_metadata_cover': False,
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': 'c:\\users\\userxxx\\appdata\\local\\temp\\calibre _0.7.46_tmp_e40dlm\\calibre_0.7.46_bgnjop.opf',
'remove_first_image': False,
'remove_paragraph_spacing': True,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': u'',
'rescale_images': False,
'series': None,
'series_index': None,
'smarten_punctuation': True,
'sr1_replace': u'&nbsp;',
'sr1_search': u'(?<=\\b(s|a|v|z)\\b)\\s',
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
Python function terminated unexpectedly
[Error 32] The process cannot access the file because it is being used by another process: u'D:\\Books-import\\Debug\\input\\OEBPS\\Text' (Error Code: 1)
Traceback (most recent call last):
File "site.py", line 103, in main
File "site.py", line 85, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 110, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 31, in gui_convert_override
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 878, in run
File "shutil.py", line 244, in rmtree
File "shutil.py", line 244, in rmtree
File "shutil.py", line 253, in rmtree
File "shutil.py", line 251, in rmtree
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'D:\\Books-import\\Debug\\input\\OEBPS\\Text'
habanr is offline   Reply With Quote
Old 02-22-2011, 07:36 AM   #5
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,838
Karma: 12535517
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by habanr View Post
Previous "Search & Replace" causes the conversion to crash see.

WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'D:\\Books-import\\Debug\\input\\OEBPS\\Text'
This is a Windows error. Either close the program (editor) you have or had the text section open with or reboot your machine to release those wonderful Windows locks that get put on some files. Read for more info on how to unlock files.
DoctorOhh is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
10x10 / 100 Words and Pictures that Define the Time Colin Dunstan Lounge 2 12-16-2013 04:36 PM
An observation on ratings...how do you define your scale? texasnightowl Calibre 12 08-18-2010 01:59 PM
@page rules mtravellerh Calibre 1 12-28-2008 05:01 PM
How define my favorite connection ? Kiba iRex 0 07-22-2008 09:29 AM
Rules Alexander Turcic Flea Market 0 05-13-2008 03:35 AM


All times are GMT -4. The time now is 03:42 AM.


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