summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-François B <2589111+jfbu@users.noreply.github.com>2023-03-10 10:24:16 +0100
committerJean-François B <2589111+jfbu@users.noreply.github.com>2023-03-10 10:24:16 +0100
commit9d0ff5af4153684b1e42b98103e463f08e33dff5 (patch)
treef6a25ad8f6946988ac66b664423b032785f541a7
parent00640b19add7cd4a493070943624d8c35e7142b1 (diff)
downloadsphinx-git-9d0ff5af4153684b1e42b98103e463f08e33dff5.tar.gz
LaTeX: \sphinxbox must issue \leavevmode to let TeX enter paragraph mode
-rw-r--r--sphinx/texinputs/sphinxpackageboxes.sty5
1 files changed, 5 insertions, 0 deletions
diff --git a/sphinx/texinputs/sphinxpackageboxes.sty b/sphinx/texinputs/sphinxpackageboxes.sty
index e7b5cb1f4..162b061b1 100644
--- a/sphinx/texinputs/sphinxpackageboxes.sty
+++ b/sphinx/texinputs/sphinxpackageboxes.sty
@@ -190,6 +190,11 @@
%
% For an inline box, possibly rounded.
\newcommand\sphinxbox[1][]{% #1 stands for the options, they are... optional!
+ % \leavevmode makes sure TeX switches to paragraph mode, which is necessary
+ % if this is first in a paragraph or a list element. The \sphinxAtStartPar
+ % mechanism also ensures this automatically, if not redefined, but not with
+ % lualatex as then it is by default doing nothing.
+ \leavevmode
\begingroup
\sphinxboxsetup{#1}% only "box_" options, with no "box_" prefix
\spx@boxes@fcolorbox@setup