\tcblisting 忽略 parskip?

\tcblisting 忽略 parskip?

使用时tcblisting我发现\parskip似乎被忽略了。

\documentclass{article}
\parskip\baselineskip

\usepackage{tcolorbox}

\tcbuselibrary{listings}

\begin{document}
    
    \begin{tcblisting}{%listing engine=minted, %listing only,
            verbatim ignore indention at end}
        \begin{tabular}{rl}
            1 & First point \\
            2 & Another point \\
        \end{tabular}
        
        Look at the previous 2 points.
    \end{tcblisting}
    
    \begin{tabular}{rl}
        1 & First point \\
        2 & Another point \\
    \end{tabular}
        
    Look at the previous 2 points.
    
\end{document}

在此处输入图片描述

有没有办法将 parskip 添加到 tcblisting?

答案1

您可以像这样更改 tcolorbox 的 parskip:

\documentclass{article}
\parskip\baselineskip

\usepackage{tcolorbox}

\tcbuselibrary{listings}

\begin{document}
    
    \begin{tcblisting}{%listing engine=minted, %listing only,
            verbatim ignore indention at end,before lower={\parskip\baselineskip}}
\begin{tabular}{rl}
    1 & First point \\
    2 & Another point \\
\end{tabular}

Look at the previous 2 points.
    \end{tcblisting}
    
    \begin{tabular}{rl}
        1 & First point \\
        2 & Another point \\
    \end{tabular}
        
    Look at the previous 2 points.
    
\end{document}

在此处输入图片描述

相关内容