brechtm / rinohtype

The Python document processor
http://www.mos6581.org/rinohtype
GNU Affero General Public License v3.0
499 stars 59 forks source link

rinohtype not correctly processing document links #373

Closed techauthoruk closed 1 year ago

techauthoruk commented 1 year ago

Is there an existing issue for this?

PDF produced by rinohtype

If I produce my Sphinx output using LaTeX, internal links are displayed correctly (i.e. they show the correct section/subsection names) as in this example:

latex

When I process the same document using rinohtype, the section link just displays a chapter title:

rinoh

I would expect all the internal links to display in rinohtype in the same way they do in LaTeX.

Source files

See the screenshots above

Versions

rinohtype 0.5.5 (in development)
Sphinx 5.1.1
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.35
brechtm commented 1 year ago

This changed in 0.5.2, as I reasoned this is how references are traditionally made in print (since you didn't have hyperlinks back then). I can see how this can be confusing however, since the output differs from the HTML output. I was wondering how the LaTeX builder handled these!

Please see these links on how to adjust the style sheet to output named links instead:

Closing as duplicate of #244

techauthoruk commented 1 year ago

Thanks for this @brechtm

I am obviously making some basic error here. If I add:

[linked reference]
type = custom

to the (global) Sphinx.rts file, the inline references are resolved correctly for my use case. I created a custom file which sits in the Source directory with my content. It's correctly referenced in conf.py, but adding the linked reference part is ignored.

So my conf.py has this:

rinoh_documents = [dict(doc='index',        # top-level file (index.rst)
                        target='manual',
                        template='SEaB.rtt',
                        stylesheet='SEaB.rts',  
                        title='FLEXIBUSTER',
                        author='Operating and Maintenance Manual',
                        logo='img/logo.png')]

In my custom stylesheet I have added:

[STYLESHEET]
name = SEaB custom style
base = sphinx

[linked reference]
type = custom
;this seems to make no difference - only applies from base stylesheet

but it doesn't get applied. Obviously me who is missing something, but I don't know what!

brechtm commented 1 year ago

rinoh_documents doesn't take a stylesheet. You need to set the style sheet in your template configuration file.