Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-15-2018, 09:02 AM   #226
xd1986k
Member
xd1986k began at the beginning.
 
xd1986k's Avatar
 
Posts: 10
Karma: 10
Join Date: Dec 2014
Device: Kindle Fire HDX 7, Ipad
Hello.
Would it be possible to set images to ignore margins set for text? Setting margins to zero and negative margin does not seem to help.
xd1986k is offline   Reply With Quote
Old 06-27-2018, 06:09 AM   #227
lqiyun
Junior Member
lqiyun began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2018
Device: None
Centreline for Two-page view

Hi, does anyone know how to generate a background that looks like this, especially for two-page views? (see the image attached below, or click the link for the image)


https://entuedu-my.sharepoint.com/pe...age_design.jpg

I'm referring to specially the middle portion of the page, where one can use this gradient effect to divide the page into two, for a more "bookish" feel. (where I marked it out with a red arrow)
Is there any way to do this, or perhaps to create a simple line down the middle as a simpler alternative?


Thanks!

Last edited by lqiyun; 06-27-2018 at 06:14 AM.
lqiyun is offline   Reply With Quote
Advert
Old 06-27-2018, 06:48 PM   #228
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Moderator Notice
That image link requires me to login to Microsoft.

Please upload the image to this site via the Manage Attachments feature; in Advanced mode, scroll down and you'll see a button, or click the paper-click icon in the top tollbar

BR
BetterRed is offline   Reply With Quote
Old 11-13-2018, 11:48 PM   #229
MikeMJ
Constant Reader
MikeMJ began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Apr 2012
Device: HTC Sensation 4G (Kindle software)
Footnotes

The Calibre viewer that comes with Calibre 3.34 (Windows 64-bit) displays footnotes in a separate window, in a tiny font. I am reading a book where the footnotes are formatted as
Code:
<p class="tx">
.

I've tried using the following CSS in the User Stylesheet of the Viewer:
Code:
p .tx {
 font-size: medium !important;
}
but this doesn't seem to have any effect.

Can anyone help me figure out what I'm doing wrong?
MikeMJ is offline   Reply With Quote
Old 11-14-2018, 12:02 AM   #230
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,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
user stylesheets aren't applied to the popup window, IIRC. And its font size comes from the font sizes in the viewer preferences, + any font sizes actually specified in the footnote markup
kovidgoyal is offline   Reply With Quote
Advert
Old 11-15-2018, 11:21 PM   #231
Pacific9
Junior Member
Pacific9 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2018
Device: Linux Desktop
I've been trying to insert a page break after each paragraph, in such a way that I have to flip to a new page every single paragraph. The reason for this is that I will be summarizing thousands of paragraphs and I figure it would be easier to keep track if I broke them apart into individual pages.
I'm a css noob and I've had some success with "page-break-after" but I haven't figured out a way to properly implement this using the viewer's stylesheet. Any help would be appreciated.
Pacific9 is offline   Reply With Quote
Old 11-16-2018, 12:19 AM   #232
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,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
p, div { page-break-after: always !important }
kovidgoyal is offline   Reply With Quote
Old 12-14-2018, 02:49 PM   #233
speedyg
Junior Member
speedyg began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2015
Device: Galaxy Tab S
First of all, thanks much for Calibre. It's marvelous.

I'm trying to use the viewer function for the first time and my book (epub) is showing as double spaced. I've added the following to User Stylesheet:

body {
color: rgb(230,213,77) !important;
background-color:rgb(64,43,30) !important;
line-height: 1 !important;
text-align:justify;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:3em;
}

Everything except line-height seems to work fine. I've also tried defining line-spacing.
Nothing I do changes the line height or spacing. When I use the same code on w3schools.com CSS TryIt page it displays exactly as I'd expect.

Am I doing something wrong?

Thanks.

Last edited by speedyg; 12-14-2018 at 03:46 PM.
speedyg is offline   Reply With Quote
Old 12-15-2018, 02:19 AM   #234
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,380
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by speedyg View Post
First of all, thanks much for Calibre. It's marvelous.

I'm trying to use the viewer function for the first time and my book (epub) is showing as double spaced. I've added the following to User Stylesheet:

body {
color: rgb(230,213,77) !important;
background-color:rgb(64,43,30) !important;
line-height: 1 !important;
text-align:justify;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:3em;
}

Everything except line-height seems to work fine. I've also tried defining line-spacing.
Nothing I do changes the line height or spacing. When I use the same code on w3schools.com CSS TryIt page it displays exactly as I'd expect.

Am I doing something wrong?

Thanks.
Given that a unitless line-height operates as a multiplier on the element's font size and you don't have a font size declaration visible, that might be an issue. You could try adding a font-size: 1em; declaration and see if that has any effect when you change the line-height though that 1em font size is relative to the parent element font-size declaration and if no parent element declaration, defaults to the renderer's default. It is better to use unitless line-heights in conjunction with font-size since using em and % for line heights can give interesting inheritance effects (for certain values of interesting...).

Another possibility is if there are any line height declaration on lower level elements. Take a close look at the classes used with <p> tags (or <div> tags for those ebook creators who insist on using <div> instead of <p> for paragraphs.)

You might also want to dump the absolute units for your margins and replace them with ems or other relative units. For instance, the right and left 50px margins on my old Kobo Touch would use 100 pixels of the 600 pixel screen width while on a KA1 with a 1404 pixel wide screen or Kobo Forma with a 1440 pixel wide screen, that 100 pixels is a lot smaller percentage of the screen width. Setting the left and right margins to 8.33% would give the same width on any of the three displays with the pixels ranging from 50 to 120.

Last edited by DNSB; 12-15-2018 at 02:32 AM. Reason: Fat fingered typos...
DNSB is offline   Reply With Quote
Old 12-15-2018, 01:29 PM   #235
speedyg
Junior Member
speedyg began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2015
Device: Galaxy Tab S
Quote:
Originally Posted by DNSB View Post
Another possibility is if there are any line height declaration on lower level elements. Take a close look at the classes used with <p> tags (or <div> tags for those ebook creators who insist on using <div> instead of <p> for paragraphs.)
Thanks for the response. That was the problem. One of the referenced Style sheets in the epub file has this:

p.Normal {
-epub-hyphens:none;
color:#000000;
font-family:"Times New Roman", serif;
font-size:1em;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:2;
...

Changing the line-height setting there changes the viewer display. My understanding was that changing setting in the "body" section of the User Stylesheet would override all these settings, but that's obviously not the case.

Is there a way of creating a setting in the User Stylesheet that will always take precedence, or am I stuck with editing each book when these kinds of issues turn up?
speedyg is offline   Reply With Quote
Old 12-15-2018, 07:31 PM   #236
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You have it backwards.
The styles cascade thru the (code indented) layers unless overridden by the layer

Body is the base
a Div or blockquote might establish a special grouping
then your P
So if you set Body, the rest inherit that unless you make a new declaration.
Usually, that is the only place I set line-height: (I also use the standard 1.2)
There are a few places I do use a different line-height
Code:
<h3 class="chapter> Chap title <br />Chap sub title</h3>
a bigger LH number spaces the lines apart
theducks is offline   Reply With Quote
Old 02-19-2019, 01:28 PM   #237
mosesgreatgrandf
Junior Member
mosesgreatgrandf began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2019
Device: toshiba laptop
firststeps

firstly, thank you for your gift to humanity. the code that you have gifted to us is very useful and elegant and has served us well and will continue to spread knowledge and wisdom across the globe. As well as provide a moral code that is invaluable too us all.
Secondly guys you probably don't realise this but you are taking your first footsteps into the wonderful (ly frustrating but rewarding) world of programming,
Congratulations, stick with it and contribute to the free software movement that you are now reaping the rewards of.

mosesgreatgrandf is offline   Reply With Quote
Old 06-07-2019, 03:28 AM   #238
michailbachtin
Enthusiast
michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.michailbachtin is cognizant of many things which escape those who dream only by night.
 
Posts: 48
Karma: 103592
Join Date: Jan 2013
Device: Sony PSR-1
CSS comand to remove Spaces between Paragraphs

Downloaded Calibre news content always has a space between paragraphs.

Is there CSS Stylesheet line for Calibre's Viewer that removes the space between paragraphs?

I know that I can reformat each Epub using the "Convert" options, but that's a lot of work for every news source.

I'd be grateful for a CSS line that removes the space between paragraphs.

Cheers,

B.
michailbachtin is offline   Reply With Quote
Old 07-02-2019, 05:41 PM   #239
Syllius
Enthusiast
Syllius began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jul 2019
Device: None
CSS...

Hey, thank you so much for an amazing program. I have been very much enjoying editing the user interface with style sheets and would like to add some more personally preferred functionality with CSS if it's possible. I was able to add the book titles using the content: attr(title) and I was wondering what other data could be manipulated in this manner. I would very much like to put a total count for search results or individual libraries currently being accessed, but I am not sure what the data set would be that I am looking to access. Is there a repository somewhere that anyone could direct me? I would so greatly appreciate this. Thank you again and many blessings to you and yours.

With Respect and Humility,
Dan
Syllius is offline   Reply With Quote
Old 07-03-2019, 09:55 AM   #240
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Syllius View Post
Hey, thank you so much for an amazing program. I have been very much enjoying editing the user interface with style sheets and would like to add some more personally preferred functionality with CSS if it's possible. I was able to add the book titles using the content: attr(title) and I was wondering what other data could be manipulated in this manner. I would very much like to put a total count for search results or individual libraries currently being accessed, but I am not sure what the data set would be that I am looking to access. Is there a repository somewhere that anyone could direct me? I would so greatly appreciate this. Thank you again and many blessings to you and yours.

With Respect and Humility,
Dan
Dan
The Results/counts are on the 'status line' (Bottom Left).
3 values shown: All entries in Library, Total found or in current VL, and number selected <<always pay attention to this when doing bulk operations or can happen
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom CSS for output deckoff Calibre 1 08-28-2010 11:55 PM
ePub with custom .css on a 505 dicknskip Sony Reader Dev Corner 3 06-09-2010 11:34 PM
User stylesheets for ePub files salty-horse Sony Reader Dev Corner 12 02-23-2010 07:44 AM
ePub conversion: override existing css with a custom one sbin Calibre 1 01-09-2010 04:03 AM
Calibre's generated css for epub brewt Calibre 7 12-29-2008 09:59 AM


All times are GMT -4. The time now is 10:27 AM.


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