![テーブル内の >{} はどういう意味ですか](https://rvso.com/image/391735/%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E5%86%85%E3%81%AE%20%3E%7B%7D%20%E3%81%AF%E3%81%A9%E3%81%86%E3%81%84%E3%81%86%E6%84%8F%E5%91%B3%E3%81%A7%E3%81%99%E3%81%8B.png)
これは何をするものか誰か教えてもらえますか?私は大部分を理解したと思います
\newenvironment{keywords}{%
\renewcommand{\arraystretch}{1.1}
\begin{tabular}{>{}l>{}p{13cm}}
}{%
\end{tabular}
}
答え1
>{<stuff>}<col spec>
tabular
またはarray
列指定内の は の<stuff>
先頭に挿入されます<col spec>
。これは、array
パッケージ例えば、
\begin{tabular}{>{\textbullet\space}l}
First \\ Second \\ Third
\end{tabular}
tabular
3 つの項目を含むリストのようなものを作成します。
あなたの状況では、<stuff>
は空なので、何も実行されません (削除できます)。
答え2
>{<content>}
表のパラメータ内のコマンドは、<content>
次の列の各セルに対して が実行されるか (コマンドの場合)、表示される (テキストの場合) ことを意味します (そのタイプは次の文字 (ここではとl
)から定義されますp
)。たとえば、\Large
最初の 内にコマンドを追加して にすると、キーワードの最初の列 (その名前) が表に Large として表示されます。>{}
>{\Large}
それを試してみてください:
\documentclass[]{article}
\usepackage{array}
\newenvironment{keywords}{%
\renewcommand{\arraystretch}{1.1}
\begin{tabular}{>{\Large}l>{}p{13cm}}
}{%
\end{tabular}
}
\begin{document}
\begin{keywords}
test & Here is a long keyword that will exceed one line and break to the second one\\
Another test & Here is a long keyword that will exceed one line and break to the second one\\
\end{keywords}
\end{document}
空なので、そこには何も追加されず、何も表示または実行されません。
@{}
代わりに、列間の余分なスペースを削除すると、次のように表示されます。
試す:
\documentclass[]{article}
\usepackage{array}
\newenvironment{keywords}{%
\renewcommand{\arraystretch}{1.1}
\begin{tabular}{>{}l@{}p{13cm}}
}{%
\end{tabular}
}
\begin{document}
\begin{keywords}
test & Here is a long keyword that will exceed one line and break to the second one\\
Another test & Here is a long keyword that will exceed one line and break to the second one\\
\end{keywords}
\end{document}