Skip to content

Doc: Wrap text in large grids#14724

Merged
rouault merged 6 commits into
OSGeo:masterfrom
geographika:wms-grid
Jun 5, 2026
Merged

Doc: Wrap text in large grids#14724
rouault merged 6 commits into
OSGeo:masterfrom
geographika:wms-grid

Conversation

@geographika
Copy link
Copy Markdown
Collaborator

@geographika geographika commented Jun 5, 2026

Fixes table formatting issues described in #2592 and #2563.

The same RST simple table format was used for both tables, as it is easier to read and edit in plain text. CSS was added for wrapping in HTML output (rather than a scrollbar). Some example URLs were shortened to fit within the column width.

To fix the PDF, additional settings were added to the preamble (settings inserted at the top of the document):

  • \newcolumntype{P}[1]{>{\raggedright\hspace{0pt}\sloppy}p{#1}} - a new P column type that allows for text wrapping of long chunks of text / XML. raggedright turns off justification, sloppy helps LaTeX find a break for wrapping. \hspace{0pt} inserts a zero-width breakpoint so long strings can break
  • \setlength{\emergencystretch}{3em} - helps with the wrapping by stretching text
  • \setlength{\LTleft}{0pt} and \setlength{\LTright}{0pt} fixed issues with the table widths and gaps at the side (the longtable used by Sphinx for wide tables)
  • https://ctan.org/pkg/xurl might be a useful option, but I avoided adding another package for now

Before:

image

After:

image

@rouault
Copy link
Copy Markdown
Member

rouault commented Jun 5, 2026

To fix the PDF, additional settings were added to the preamble

could you add the very helpful explanation of those cryptic commands in conf.py and that they are used for table formatting?

@rouault rouault merged commit cb54113 into OSGeo:master Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants