Open dbitouze opened 1 month ago
@dbitouze I did not investigate where the \subsubsection*
mark-up originates but defining appropriately the sphinxclasssd-tab-set
, sphinxclasssd-tab-item
and sphinxclasssd-tab-content
LaTeX environment could transmogrify the mark-up you show into the one you wish.
edited to do s/sphinx/sphinxclass/
sorry
I tried with
% Support **experimental** pour les tab-set de sphinx-design
% cf https://github.com/executablebooks/sphinx-design/issues/218
% ATTENTION C'EST FRAGILE CAR IL NE FAUT PAS QUE LE MARK-UP LATEX DE
% sphinx-design CHANGE (surtout pour sd-tab-item)
\newenvironment{sphinxclasssd-tab-set}{\begin{description}}{\end{description}}
\newenvironment{sphinxclasssd-tab-item}[3]{\item[#3]\leavevmode}{}
% pas besoin pour le moment de définir sphinxsd-tab-content
in the preamble and it gives an acceptable result. The above has been tested with success on a big project, now it may not be at all a sufficient test as that project might have been using sphinx-design
tab-set
always the same way. About the \leavevmode
the contents were often code-blocks and for some reason I needed it to avoid overlap in the output (that may be an upstream Sphinx issue, not sure, to be checked at later date).
@dbitouze I should probably have proposed
\newenvironment{sphinxclasssd-tab-item}[3]{\sphinxlineitem{#3}}{}
following more closely your initial advice with \sphinxlineitem
.
I think \sphinxlineitem
main purpose is to handle situations with a label but no contents, which may not be probable here, but it also avoids collision with a literal block as content, so no \leavevmode
addition is needed. Besides this is indeed the mark-up produced by Sphinx from
Term
::
hello
which gives
\begin{description}
\sphinxlineitem{Term}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{hello}
\end{sphinxVerbatim}
\end{description}
and renders correctly.
You could use sphinxclasssd-tab-content
to do something for example with \sphinxsetup
to modify the characteristics of the rendered verbatim blocks which are the contents, style them especially. But this could also be done already at sphinxclasssd-tab-item
level. I don't know if multiple tab-content
can appear in one tab-item
.
Context
Currently, tabs such as:
are converted for the PDF's LaTeX output into the following
.tex
code:This solution is sub-optimal because it introduces a level of structure (sub-sub-section) that may not be consistent with the context.
Proposal
Something such as what results from a definition list would be much better:
Tasks and updates
No response