LaTeX color&xcolor宏包的使用

\documentclass{article}
\usepackage{xeCJK}
\usepackage{mathpazo}
\usepackage{color,xcolor}
% predefined color---black, blue, brown, cyan, darkgray, gray, green, lightgray, lime, magenta, olive, orange, pink, purple, red, teal, violet, white, yellow.

\definecolor{light-gray}{gray}{0.95}    % 1.灰度
\definecolor{orange}{rgb}{1,0.5,0}      % 2.rgb
\definecolor{orange}{RGB}{255,127,0}    % 3.RGB
\definecolor{orange}{HTML}{FF7F00}      % 4.HTML
\definecolor{orange}{cmyk}{0,0.5,1,0}   % 5.cmyk

\begin{document}
%\pagecolor{yellow}          %设置背景色为黄色
\textcolor{green}{绿色}     %1.方法一
{\color{orange} 橙色}       %2.方法二

\colorbox{red}{\color{black}红底黑字}
\fcolorbox{red}{green}{红框绿背景} %框色+背景色

\color{blue!20}
\color{blue!20!black}
\color{blue!20!black!30!green}  %a mixture of (20*0.3) percent blue, ((100-20)*0.3) percent black and (100-30) percent green

{\color[rgb]{1,0,0} This text will appear red-colored}          % 直接使用
\textcolor[rgb]{0,1,0}{This text will appear green-colored}     % 直接使用

\end{document} 
复制代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值