sphinx-panels
sphinx-panels copied to clipboard
Formatting in LaTeX output
All the nodes used are nodes.container which do not have any special formatting in LaTeX output, so all the content in panels/dropdown directive will just show "as is".
At a minimum, we could wrap each panel in the sphinxadmonition environments, as done for admonitions: https://github.com/sphinx-doc/sphinx/blob/f0df9ac7254bc0fed85c765fd13dcd1bf8718a58/sphinx/writers/latex.py#L1357-L1363
Hi @chrisjsewell as you write, panels are wrapped in sphinxadmonitions and this is fine. There is a problem however with badges, which in lates are rendered with e.g., \DUrole{sphinx-bs,badge,badge-primary,badge-pill}. This makes it (AFAIK) impossible to use \renewcommand to customise the output, which is rendered as plain text. Do you have any plan to change or fix this behavious? Thanks!
Hey @stefanodavid yes I haven't had time to do too much testing of the latex outputs thus far I'm afraid. I'm certainly open to improvements, did you have any suggestions on what the correct rendering should be?
Hi @chrisjsewell thanks for the prompt reply. As mentioned, the problems I found in my today's tests are:
- a dash
-in the role name - multiple roles in a same
\DUrole's curly brace.
They prevent an easy \renewcommand of the role, so all badge-related (LaTeX) role can not be customised in Latex. My best suggestion (although limited) would be to render any :badge:test, bg-primary as either \DUrole{badgeprimary}{test} (best) or \DUrole{badge}[primary]{test}, stripping any other classes badge-pill.
In this way I could use something like \renewcommand{\DUrolebadgeprimary}{\tcbox[colback=blue, coltext=white]{test}} to render the badge quite like the HTML version.
Hi @chrisjsewell, I just had the chance to try out the new tabbed directive, which is great, and I noticed that in LaTeX output the directive's title becomes a rubric. Just an idea, but what about making the same for dropdown directives? Or even better, why not add an option to render it (or both) as a custom directive (e.g., topic, a info/warning/important admonition or similar)?
yep that sounds possible thanks 👍