未分類

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

tex でかけ算の記号 x (✕)を表示する

かけ算記号を表示するには、$\times$ を使う。 例 $2 \times 3$ 結果

no image

c++ で文字列を合成(連結)する方法

c言語では、sprintf 関数を使って文字列を合成(連結)することができる。いっぽう、c++ では、文字列を string で表して「+」演算子で文字列を合成することができる。 例 #include …

no image

tex で脚注を表示する方法

\footnote を使う。 例 \footnote{this is a footnote.} 結果

no image

python3 で、文字列が別の文字列に含まれているかどうか判定する方法

in 演算子を使うことが最も簡単。 例 str1 = “こんにちは” str2 = “んにち” if str2 in str1:  print(“含まれています”) else:  print(“含まれ …

no image

tex で文字の上の点を入力する方法

テキストモードでは \. 数式モードでは \dot{} を使う。 例 \.{a}$\dot{x}$ 結果