mdframed と titlesec 間のバグ

mdframed と titlesec 間のバグ

titlesec編集:私が使用しているバージョンは

titlesec.sty 2011/12/15 v2.10.0 セクションタイトル


私はmdframedボックスや定理のような環境を定義するために使用しています。パッケージをロードするとtitlesec、垂直方向の配置に問題が発生します。

バグのあるMWE

以下はロードされた MWE ですtitlesec:

\documentclass{article}
\usepackage{titlesec} % This is the cause of the wrong alignment
\usepackage{mdframed}

\newmdenv[%
innerleftmargin = 0pt,
innerrightmargin = 0pt,
innertopmargin = 0pt,
innerbottommargin = 0pt,
leftmargin = 0pt,
rightmargin = 0pt,
topline = false,
bottomline = false,
leftline = false,
rightline = true
]{myBox}

\mdfdefinestyle{myFramedTheoremStyle}{%
linewidth=0pt,
innertopmargin=-1pt,
innerbottommargin=8pt,
innerleftmargin=8pt,
innerrightmargin=8pt,
skipabove=10pt,
backgroundcolor=yellow}

\mdtheorem[style=myFramedTheoremStyle]{theo}{Theorem}

\begin{document}

\begin{myBox}
\section{test}
test
\begin{theo}
test
\end{theo}
\end{myBox}

\section{test}
test
\begin{theo}
Test
\end{theo}
\end{document}

ここに画像の説明を入力してください

MWEのあるべき姿

ロードしない場合はtitlesec、次のようになります。

ここに画像の説明を入力してください

私の質問

バグを修正する方法はありますか?頻繁に使用していますmdframedが、titlesec次の行のみ必要です

\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titlespacing*{\section} {0pt}{0ex plus 10ex minus -3.5ex}{-0.5ex plus .2ex}
\titlespacing*{\subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

ご協力いただきありがとうございます。


私は\section*{...}(またtitlesec、 ;私は を使用せず\section{}、そのスター付きバージョンのみを使用します)を削除し、適切なサイズと形式のテキストに置き換えるかもしれませんが、誰かが大きな問題を修正する方法を見つけたら、それも素晴らしいことです。

とにかく、このバグを見つけたので、ここで参照するのは良いことだと思います。

答え1

最新バージョンtitlesec(2016/03/21 v2.10.2) およびmdframed(2013/07/01 1.9b) では、MWE は問題なく動作します。

関連情報