Beamerでスライドを作った時に文章をハイライトしたいなと思って色々調べたログ。
\colorboxコマンドを使う
color packageの\colorbox
コマンドで文章の背景に色をつける。
\usepackage{color}
document環境に以下を記述。
\colorbox{yellow}{ハイライト}された文章
TikZを使う
\tikz
コマンドで文章のハイライトをやる。
\usepackage{tikz} \usetikzlibrary{positioning}
document環境に以下を記述。
\tikz[baseline=(x.base)]{\node(x)[rectangle, fill={yellow}, rounded corners]{ハイライト};}された文章
rounded cornersでrectangleで指定した四角形の角を丸くできる。\newcommand
でマクロにしておくと便利かも。
\newcommand{\tikzhl}[2]{\tikz[baseline=(x.base)]{\node(x)[rectangle, fill={#1}, rounded corners]{#2};}} \tikzhl{yellow}{ハイライト}された文章