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

LaTeX: add support for styling note (hint, ...) similarly as warning ( danger, ...) #11234

Merged
merged 3 commits into from Mar 12, 2023

Conversation

jfbu
Copy link
Contributor

@jfbu jfbu commented Mar 11, 2023

Subject: build on recent refactoring to add possibility to render note-type admonitions the same way as warning-type, i.e. use for them sphinxheavybox and have all the customizability via CSS-named alike options.

Feature or Bugfix

  • Feature

Relates #11074 in so far as it is careful to keep working the possibility for user to do things such as

\renewenvironment{sphinxnote}[1]{\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}}

which was restored at #11081.

But it is not even needed to add such code to preamble now, as sphinxheavybox will be used automatically for note if one of the CSS-named alike options for it added by this PR is used, such as div.note_border-width.

Also using the new noteBgColor option (its CSS name alias is div.note_background-TeXcolor) to configure a background color, will automatically trigger usage of sphinxheavybox.

The above \renewenvironment by itself allowed only a very limited usage of sphinxheavybox, now the full range of its customizability is accessible.

@jfbu jfbu added this to the 6.2.0 milestone Mar 11, 2023
@jfbu
Copy link
Contributor Author

jfbu commented Mar 12, 2023

I will squash and merge after testing completes.

Refer then to https://www.sphinx-doc.org/en/master/latex.html#additional-css-like-sphinxsetup-keys for the documentation of the new features.

@jfbu jfbu merged commit 212ed5b into sphinx-doc:master Mar 12, 2023
21 checks passed
@jfbu jfbu deleted the latex_enhanced_notes branch March 12, 2023 10:29
jfbu added a commit that referenced this pull request Mar 12, 2023
Sorry about this, the \expanded was added to pdflatex in 2019 only
(but was available earlier to lualatex).  This is in contrast
with \unexpanded which has been available for more than 15 years.
@jfbu jfbu added the type:enhancement enhance or introduce a new feature label Mar 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
builder:latex type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant