Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting in LaTeX output #6

Open
chrisjsewell opened this issue May 4, 2020 · 5 comments
Open

Formatting in LaTeX output #6

chrisjsewell opened this issue May 4, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@chrisjsewell
Copy link
Member

chrisjsewell commented May 4, 2020

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

@stefanodavid
Copy link

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!

@chrisjsewell
Copy link
Member Author

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?

@stefanodavid
Copy link

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.

@stefanodavid
Copy link

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)?

@chrisjsewell
Copy link
Member Author

yep that sounds possible thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants