rinohtype phinx自定义PDF中的样式

发布于 2025-02-09 03:18:27 字数 1380 浏览 0 评论 0 原文

我正在使用 rinohtype 用于将我的rst文件生成pdf。

我试图了解如何在PDF中为我的徽标和其他元素提供自定义样式。

我以某种方式感受到 default noreferrer“> default Matcher 提供有关如何执行此操作的示例。

conf.py

rinoh_documents = [dict(doc='index',        # top-level file (index.rst)
                        target='manual',
                        template='rinohtype.rtt',
                        logo='_static/rr-logo-vertical2022-1100px-transp.png')]

rhinotype.rtt

[TEMPLATE_CONFIGURATION]
name = my article configuration
template = article
stylesheet = my_stylesheet.rts

parts =
    title
    ;front_matter
    contents
language = fr
abstract_location = title

[SectionTitles]
contents = 'Contents'

[AdmonitionTitles]
caution = 'Careful!'
warning = 'Please be warned'

[VARIABLES]
paper_size = A5

[title]
page_number_format = lowercase roman
end_at_page = left

[contents]
page_number_format = number

[title_page]
top_margin = 2cm

my_stylesheet.rts

在这里,我正在尝试更改PDF中徽标的宽度。 在此处提供CSS属性的正确方法是什么?

width: 100px

I am using RinohType for generating my RST files to PDF.

I am trying to understand how to provide custom styles in the PDF for my logo and other elements.

I somehow felt the explanation in the Default matcher doesn't provide examples on how to do this.

conf.py

rinoh_documents = [dict(doc='index',        # top-level file (index.rst)
                        target='manual',
                        template='rinohtype.rtt',
                        logo='_static/rr-logo-vertical2022-1100px-transp.png')]

rhinotype.rtt

[TEMPLATE_CONFIGURATION]
name = my article configuration
template = article
stylesheet = my_stylesheet.rts

parts =
    title
    ;front_matter
    contents
language = fr
abstract_location = title

[SectionTitles]
contents = 'Contents'

[AdmonitionTitles]
caution = 'Careful!'
warning = 'Please be warned'

[VARIABLES]
paper_size = A5

[title]
page_number_format = lowercase roman
end_at_page = left

[contents]
page_number_format = number

[title_page]
top_margin = 2cm

my_stylesheet.rts

Here I am trying to change the width of my logo in the PDF.
What is the correct way to give the css properties here.

width: 100px

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尐偏执 2025-02-16 03:18:27

default Matcher /em>样式。要调整此元素的样式,您可以的样式表默认 sphinx 样式表并调整标题页徽标徽标样式:

[STYLESHEET]
name=My Style Sheet
description=My tweaks to the Sphinx style sheet
base=sphinx

[title page logo]
width = 4cm

此样式接受 flowblableStyleStyle'> flowblableStyle 样式属性。在链接的文档中,您可以看到 width 属性支持一堆单元,但不支持 px

请继续关注以获取更好的文档。该地区实际上正在发生一些事情!

PS如果您想对文档的样式进行更多更改,则找出与特定文档元素相对应的样式名称非常有用。

The default matcher defines the title page logo style. To adjust the style of this element, you can create a style sheet that builds upon the default sphinx style sheet and tweak the title page logo style:

[STYLESHEET]
name=My Style Sheet
description=My tweaks to the Sphinx style sheet
base=sphinx

[title page logo]
width = 4cm

This style accepts the FlowableStyle style attributes. In the linked documentation, you can see the width attribute supports a bunch of units but not px.

Please stay tuned for better documentation. Something is actually happening in that area!

P.S. If you want to make more changes to the styling of your document, the style log can be very useful to find out which style name corresponds to a particular document element.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文