geocompx / geocompy

Geocomputation with Python: an open source book and online resource for getting started in this space
https://py.geocompx.org/
Other
259 stars 47 forks source link

PDF/HTML book options #234

Open michaeldorman opened 3 months ago

michaeldorman commented 3 months ago

I think in the current setup book_options_pdf.py always overrides book_options.py, even in the HTML version. That is. book_options_pdf.py is always being run even, and since it comes later in the code it overrides book_options.py.

image

Specifically pd.options.display.max_colwidth=13 in the PDF settings makes columns too narrow in the HTML. Here is an example where this matters (we want to show the POLYGON EMPTY text):

image

Is there a way to switch between book_options_pdf.py and book_options.py? @Nowosad

Nowosad commented 3 months ago

I've spent some time today chasing some ideas, but it seems that no obvious/straightforward solution exist (e.g., see https://github.com/quarto-dev/quarto-cli/discussions/3260). My current suggestion would be just to comment out the pdf chunks atm, and only uncomment them before building the PDF version of the book.

Nowosad commented 3 months ago

Or... maybe we could try somethings like this:

::: {.content-visible when-format="html"}

code

:::

Nowosad commented 3 months ago

Sadly -- no.

michaeldorman commented 3 months ago

I've spent some time today chasing some ideas, but it seems that no obvious/straightforward solution exist (e.g., see quarto-dev/quarto-cli#3260). My current suggestion would be just to comment out the pdf chunks atm, and only uncomment them before building the PDF version of the book.

Thanks @Nowosad , commenting out until we need the PDF is a good idea, will use that