我在 beamer 课程中,使用 tikz。我想使用 xcolor 包中的颜色,但无法使其工作。这是我的序言。
\documentclass[usenames, dvipsnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertine}
%\usepackage[font={small}, labelfont=bf]{caption}
%\usepackage{subcaption}
\usetheme{Cuerna}
%\usepackage{amsmath,commath,amssymb,amsthm,blkarray}
%\usepackage{bbm}
%\usepackage{mathtools}
%\usepackage{booktabs}
%\usepackage{array}
%\usepackage{siunitx}
%\newcommand{\imp}[1]{\textbf{#1}}
%\renewcommand{\vv}[1]{\mathbf{#1}}
%\DeclareMathOperator{\inff}{inf \;}
%\DeclareMathOperator{\supp}{sup \;}
\usepackage{tikz}
\usepackage{pgfplots}
%\usepackage{physics}
\addtobeamertemplate{navigation symbols}{}{%
\usebeamerfont{footline}%
\usebeamercolor[fg]{footline}%
\hspace{1em}%
\insertframenumber/\inserttotalframenumber
}
\setbeamercolor{itemize item}{fg=midnightblue}
\setbeamertemplate{itemize items}{\begin{tikzpicture}
\shade[ball color=midnightblue!50!white, preaction={fill=black,
opacity=.25,transform canvas={xshift=1mm,yshift=-1mm, yscale=0.5}}] (0,0) circle (0.6ex);
\end{tikzpicture}}
\title{Project}
\author{Name}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{Introduction}
\begin{frame}
\begin{itemize}
\item something random
\end{itemize}
\end{frame}
\end{document}
我见过类似的问题,但没有任何建议起作用,例如明确加载包 xcolor,或更改加载顺序。
答案1
如果你想向
xcolor
包传递选项,请使用xcolor={usenames, dvipsnames}
颜色名称
MidnightBlue
不是midnightblue
}
末尾缺少一个\addtobeamertemplate{navigation symbols}{}{}%
(在当前形式下,此命令不执行任何操作......)\renewcommand{\vv}[1]{\mathbf{#1}}
无法工作,因为vv
之前没有定义
\documentclass[xcolor={usenames, dvipsnames}]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[font={small}, labelfont=bf]{caption}
\usepackage{subcaption}
\usetheme{Cuerna}
\usepackage{amsmath,commath,amssymb,amsthm,blkarray}
\usepackage{bbm}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{array}
\usepackage{siunitx}
\newcommand{\imp}[1]{\textbf{#1}}
\newcommand{\vv}[1]{\mathbf{#1}}
\DeclareMathOperator{\inff}{inf \;}
\DeclareMathOperator{\supp}{sup \;}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{physics}
\addtobeamertemplate{navigation symbols}{}{}%
\setbeamercolor{itemize item}{fg=MidnightBlue}
\setbeamertemplate{itemize items}{\begin{tikzpicture}
\shade[ball color=MidnightBlue!50!white, preaction={fill=black,
opacity=.25,transform canvas={xshift=1mm,yshift=-1mm, yscale=0.5}}] (0,0) circle (0.6ex);
\end{tikzpicture}
}
\begin{document}
\begin{frame}
content...
\begin{itemize}
\item test
\end{itemize}
\end{frame}
\end{document}