セクションタイトルの前後の段組みリストの間隔

セクションタイトルの前後の段組みリストの間隔

リストがセクションの開始直後または直前にある場合、環境itemize内の環境の前後に一貫した間隔を設定するにはどうすればよいでしょうか?multicols

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

Foo2 のリストはenumitemリストであり、リストの前後の間隔は Foo1 のテキストの前後の間隔と一致しているようです。

Foo3 のリストは同じenumitemリストですが、環境に囲まれていますmulticols。2 列のリストの前後に垂直方向のスペースが多すぎます。

Foo4 のリストは、0pt に設定されている点を除いて Foo3 と同じです\multicolsep。前のスペースはまだ多すぎますが、それほどひどくはなく、リストの後のスペースが少なすぎます。

一貫した間隔を保つためにこれを修正するにはどうすればよいでしょうか?

コードは次のとおりです:

\documentclass{article}
\usepackage{calc}
\usepackage[vmargin=1em,hmargin=0.25in+1em,papersize={2in,2.7in}]{geometry}

\usepackage{titlesec}
\titleformat{\section}[block]{\normalfont\large\scshape}{}{0pt}{}[\titlerule]
\titlespacing*{\section}{-0.25in}{*0.25}{*0.25}[-0.25in]

\usepackage{multicol}
\usepackage{enumitem}
\SetEnumitemKey{twocol}{
  before=\raggedcolumns\begin{multicols}{2},
  after=\end{multicols},
}
\SetEnumitemKey{twocol0}{
  before=\raggedcolumns\setlength{\multicolsep}{0pt}\begin{multicols}{2},
  after=\end{multicols},
}
\setlist[itemize]{leftmargin=*,nosep,}

\begin{document}%
\section{Foo1}Aj%
\section{Foo2}\begin{itemize}\item{}Aj\end{itemize}%
\section{Foo3}\begin{itemize}[twocol,]\item{}Aj\item{}Aj\end{itemize}%
\section{Foo4}\begin{itemize}[twocol0,]\item{}Aj\item{}Aj\end{itemize}%
\section{Foo5}Aj%
\end{document}

バージョン:

  • multicol 2014/08/24 v1.8g multicolumn formatting (FMi)
  • enumitem 2011/09/28 v3.5.2 Customized lists

答え1

multicolumnオンライン環境だけが必要な場合はitemize 、パッケージに基づいた別のアプローチをお勧めしますshortlst。CTAN で見つけることができますが、ライセンス上の理由から、どのディストリビューションにも含まれていません。

tabitemize列ごとに表示される項目の環境を定義します。列の数はncキーによって制御されます (デフォルトでは 3)。次のコードで必要な結果が得られると思います。

\documentclass{article}
\usepackage{calc}
\usepackage[vmargin=1em,hmargin=0.25in+1em,papersize={2in,2.7in}]{geometry}

\usepackage{titlesec}
\titleformat{\section}[block]{\normalfont\large\scshape}{}{0pt}{}[\titlerule]
\titlespacing*{\section}{-0.25in}{*0.25}{*0.25}[-0.25in]

\usepackage{multicol}
\usepackage[inline]{enumitem}
\SetEnumitemKey{twocol}{
  before=\raggedcolumns\begin{multicols}{2},
  after=\end{multicols},
}
\SetEnumitemKey{twocol0}{
  before=\raggedcolumns\setlength{\multicolsep}{0pt}\begin{multicols}{2},
  after=\end{multicols},
}
\setlist[itemize]{leftmargin=*,nosep,}


    \usepackage{shortlst, xkeyval}

    \makeatletter
    \newcounter{ncol}
    \define@key{mcl}{nc}[3]{\setcounter{ncol}{#1}}%% 3 columns by default
    \newenvironment{tabitemize}[1][]{%
    \setkeys{mcl}{nc,#1}
    \settowidth{\labelwidth}{\textbullet}
    \setlength{\leftmargini}{\dimexpr\labelwidth+\labelsep\relax}%[1][3]
    \setlength{\shortitemwidth}{\dimexpr\linewidth/\value{ncol}-\labelwidth-2\labelsep\relax}%
          \begin{shortitemize}}%
    {\end{shortitemize}
     \vspace*{\dimexpr-\topsep-\partopsep\relax
     }%

\begin{document}%

\section{Foo1}Aj%
\section{Foo2}\begin{itemize}\item{}Aj\end{itemize}%
\section{Foo3}\begin{tabitemize}[nc = 2]\item{}Aj\item{}Aj\end{tabitemize}%
\section{Foo4}\begin{tabitemize}[nc = 2]\item{}Aj\item{}Aj\end{tabitemize}%
\section{Foo5}Aj%

\end{document} 

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

関連情報