未分類

tex で行に色をつける方法

投稿日:

xcolor パッケージを使っておく。rowcolor で指定する。

\usepackage[table]{xcolor}
\begin{document}

\begin{table}
\begin{tabular}{ |c|c|c|c| }
\hline
\rowcolor{blue!90!yellow!20} 1 & 2 & 3 \\
\hline
A & B & C\\
\hline
1 & 2 & 3 \\
\hline
\end{tabular}
\end{table}

\end{document}

結果

-未分類

執筆者:


comment

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

関連記事

no image

matplotlib で x軸・y軸ラベルをつける

plt.xlabel と plt.ylabel を使う。 例 import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, …

no image

tex で方程式を文書の中央揃えにする(eqnarray→ align)

amsmath パッケージを使ったうえで、align を使う。次の例では eqnarray の代わりに、align を使っている。 例 \usepackage {amsmath}  \begin{do …

no image

C言語で文字をアルファベット順にずらす

C言語で文字をずらすには、char 型の変数に1を加えればよい。 例 #include <stdio.h> int main(void) { char c; c = ‘a’; c++; p …

no image

python3 で文字列の最後の文字を削除する方法

文字列の最後に [:-1] を付けると、最後の文字を削除することができる。 例 res = ‘あいうえお'[:-1] print(res) 結果 あいうえ

no image

tex でダガー記号を入力する方法

ダガー記号には、$\dagger$ を使う。上付きにしたい場合には、$^$ と組み合わせる。 例 $A^{\dagger}$ 結果