Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double bulletpoints when using bulletText #1074

Open
zengtronic opened this issue Aug 16, 2022 · 3 comments
Open

Double bulletpoints when using bulletText #1074

zengtronic opened this issue Aug 16, 2022 · 3 comments
Labels

Comments

@zengtronic
Copy link

zengtronic commented Aug 16, 2022

Description of problem
When i'm using bulletText in the Stylesheet to customize the bulletpoints it comes to a strange behavior. It places the bullettext again (but without color) under the listitem.

Is it a feature or a bug? 馃槃

The used style code is following:

  bullet-list:
    spaceAfter: 8
    bulletText: "x" 
    bulletColor: #FF0000

What is the expected output? What do you see instead?
Expected:
x xyz
x 123

What I get:
image

馃枼 Versions
python: 3.7

rst2pdf: 0.99

reportlab: 3.6.11

sphinx: 3.5.4

Which operating system are you using? => Windows 11 Enterprise

Other questions
BTW I have also three questions where I didnt find an answer yet and probably no extra issue is needed:

  • How can I disable the table header repeat on a page break? It even repeats the first table line when its a normal row (not thead)
  • How can I hide an Element in rst2pdf (like display: none in html/css)
  • How can I disable Image rescaling when its too tall for the frame (it should instead place it on the next page). The picture itself is very small (64x64px) but always got tiny after a page break.
@lornajane
Copy link
Contributor

That's really interesting, but probably not desired! I sometimes see the bullets on the next line, and this happens because it's actually a table layout and on some setups the "column" that the bullet points are in is too narrow and it sort of wraps. In my stylesheets I have something like this to fix the problem:

  bullet-list:
    colWidths: ['40', null]
    commands:
    - - VALIGN
      - [0, 0]
      - [-1, -1]
      - TOP
    - - RIGHTPADDING
      - [0, 0]
      - [1, -1]
      - 0
    - - LEFTPADDING
      - [0, 0]
      - [1, -1]
      - 6

Hopefully this helps!

@lornajane
Copy link
Contributor

I see your other questions as well, I don't think the table should repeat its row when it's broken across pages. I would like to see the example though if you can share it, so I can take a look.

You can't hide an element but you can sort of skip sections, https://lornajane.net/posts/2013/hiding-sections-with-rst2pdf is how I did this, not a new post but I don't think this part has changed.

Image rescaling is quite ... special. Is it an image or a figure? It rescales when it thinks the container it is being added to is too small for the item, so it probably matters if it is in text or a table or something else. Maybe this helps you to diagnose, it's difficult to help without seeing the document!

@zengtronic
Copy link
Author

zengtronic commented Aug 18, 2022

That's really interesting, but probably not desired! I sometimes see the bullets on the next line, and this happens because it's actually a table layout and on some setups the "column" that the bullet points are in is too narrow and it sort of wraps. In my stylesheets I have something like this to fix the problem:

 ...the fix code....

Hopefully this helps!

image
Not really. If i try to let it overlay it just gets under it as in the issue screenshot.

I see your other questions as well, I don't think the table should repeat its row when it's broken across pages. I would like to see the example though if you can share it, so I can take a look.

Example:
Screenshot 2022-08-16 113822
If it breaks the table further down it sometimes repeats the first row, sometimes a random other dark grey row and sometimes it works as it should 馃槃 The table is fully build in code (from content of a directive) and only consists of following node types: table, tgroup, colspec, tbody, row, entry, paragraph (and everything whats nested inside)

I just tested to replace the styling class (because it contained the word "heading") to just "abc" - exact same problems... So no converting to thead from the class name :D I really wonder why only the gray ones get repeated :o (BTW in current rendering the functional description gets repeated, not prototype )

Image rescaling is quite ... special. Is it an image or a figure? It rescales when it thinks the container it is being added to is too small for the item, so it probably matters if it is in text or a table or something else. Maybe this helps you to diagnose, it's difficult to help without seeing the document!

Its rendered as a 2 col 1 row Table, like this (node types in UPPERCASE ;) ). And well... its an Image but also "code-only" with nodes.image.

____________________________________________________
|  IMAGE |  PARAGRAPH (the title of it)             |
|        |  NESTED CONTENT (the description of it)  |
-----------------------------------------------------

Python code of that table: 
  asset_uri = 'path to the image'
  title = 'the title :D'
  
  table = nodes.table(classes=['anotation-table'])
  tgroup = nodes.tgroup(cols=2)
  tgroup += nodes.colspec(colwidth=15)
  tgroup += nodes.colspec(colwidth=85)
  tbody = nodes.tbody()
  row = nodes.row()
  entry1 = nodes.entry()
  entry1 += nodes.image(alt=self.admonition_type, height='1.19cm', uri=asset_uri)
  entry2 = nodes.entry()
  heading = nodes.paragraph(classes=['anotation-table-heading'])
  heading += nodes.Text(title)
  entry2 += heading
  self.state.nested_parse(self.content, self.content_offset, entry2)
  row += [entry1, entry2]
  tbody += [row]
  tgroup += tbody
  table += tgroup

Here an example how it looks when its on top of the next page:
admonitons
Its more or less always occurs only on top of a page. And well... the second table cell also needs its space so i dont know why it even rescales that image :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants