あなたの例

あなたの例

タイトルの通り、特定の表のテキストをそのまま書きたいと思います。

表内の特定の行のフォントを変更できるとさらに便利です。

現在私が持っているものは次のとおりです。

\begin{table}[!htbp]
\fontsize{11}{9}
\begin{center}
\begin{tabular}{| l |  l | l | l |} 
\hline
\hline\hline 
Parse subtree    & String & Semantics & Agreement Features  \\ [0.7ex] 
%heading
\hline
np(noun(brad))    & brad&  [brad]  &  [masculin,singular]\\ 
verb(saves)     &  saves&  [Y,X,saves(X,Y)] &  \\
np(det(a),n(life))  & a life & [a(Z),life(Z)]  & [singular] \\
vp(v(saves),np(det(a),n(life)) & saves a life& ? & \\ [1ex] 
\hline 
\end{tabular}
\end{center}
\end{table}

答え1

パッケージを使用するとarray、テーブルセルの内容の前に展開されるマクロを指定できるようになります。例:

\begin{tabular}{>{\macros}c}

あなたの例

booktabsきれいなテーブルルールのパッケージを使用して、レイアウトを少し調整しました。

\documentclass[border=3pt]{standalone}
\pagestyle{empty}% for cropping
\usepackage{array,booktabs}
\begin{document}
\begin{tabular}{>{\ttfamily}{l}l>{\ttfamily}{l}>{\ttfamily}{l}} 
    \toprule
    \multicolumn{1}{l}{Parse subtree} & String       & \multicolumn{1}{l}{Semantics} & \multicolumn{1}{l}{Agreement Features} \\
    \midrule
    np(noun(brad))                    & brad         & [brad]                        & [masculin,singular]                    \\
    verb(saves)                       & saves        & [Y,X,saves(X,Y)]              &                                        \\
    np(det(a),n(life))                & a life       & [a(Z),life(Z)]                & [singular]                             \\
    vp(v(saves),np(det(a),n(life))    & saves a life & ?                             &                                        \\
    \bottomrule
\end{tabular}
\end{document}

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

関連情報