phantom を使用して LaTeX 環境 (itemize) を非表示にできますか?

phantom を使用して LaTeX 環境 (itemize) を非表示にできますか?

\phantom次のような環境の内容を非表示にする方法はありますかitemize?

これは実行されません:

\phantom{\begin{itemize}
          \item Hi!
         \end{itemize}}

出力でコンテンツを強調表示したくないので、テキストを白に変更するだけでは十分ではありません。

答え1

いいえ、そのようには使えません\phantom\parbox中身を隠すために内部の\phantomを使うことはできますが、その中身が占めるスペースは確保しておく必要があります。commentあるいは、commentスペースを完全に抑制して内容を非表示にするパッケージ:

\documentclass[draft]{article}
\usepackage{comment}

\begin{document}

a
\begin{comment}
\begin{itemize}
\item First.
\item Second.
\end{itemize}
\end{comment}
b

a\par
\noindent\phantom{\parbox{\linewidth}{%
\begin{itemize}
\item First.
\item Second.
\end{itemize}}}\par
b

\end{document}

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

関連情報