未分類

tex の表で、複数行を1行内に入れる方法

投稿日:

multirow パッケージを使っておき、表内で multirow で入力する。

\usepackage{multirow}
\begin{document}

\begin{table}
\begin{tabular}{ |c|c|c|c| }
\hline
1 & 2 & 3 \\
\hline
\multirow{3}{8em}{good morning, good evening} & A & B \\
& C & D \\
& E & F \\
\hline
\end{tabular}
\end{table}

\end{document}

結果

-未分類

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

python3 で文字列を区切り文字を指定してリストに変換する方法

split メソッドを使う。 例 str1 = ‘this, is, a, pen’ str2 = str1.split(‘,’) print(str2) 結果 [‘this’, ‘ is’, ‘ a …

no image

tex の分数のシグマ記号(和)がつぶれないようにする

分子・分母にシグマ記号(和記号)を使うと、小さくつぶれて見にくいことがある。対策として、\displaystyle を使う。 例 $\frac{\displaystyle \sum_{i=1}^{\i …

no image

tex で行列の省略した部分を書く方法

斜めの点列を \ddots として書くのがコツ。\matrix を使うためにパッケージ amsmath を使う。 例 \usepackage{amsmath} \begin{document} $$ …

no image

c++ で文字列(string)の長さを取得する方法

length() で取得する。 例 #include <iostream> #include <string> using namespace std; int main () { str …

no image

c++ で文字列を「区切り文字」を使って分ける方法

string の find を使って、区切り文字の場所を取得し、その位置で区切る。 例 #include <iostream> #include <string> using namesp …