LaTex下tcolorbox宏包的安装及使用
来源:互联网 发布:linux top命令参数 编辑:程序博客网 时间:2024/06/05 12:03
1. texlive2011安装tcolorbox
1. 在线安装:tlmgr --gui打开texlive manager,菜单tlmgr下:载入缺省的网络仓库,之后update all installed
终端 tlmgr install tcolorbox即可。(比较慢)
2. 手工安装:下载下来tcolorbox的zip包:http://ctan.org/tex-archive/macros/latex/contrib/tcolorbox
按照README中所说的:把 'tcolorbox.sty' 'tcblistings.code.tex' 'tcbtheorems.code.tex' 'tcbdocumenation.code.tex' 'tcbskins.code.tex'这几个文件放到你的local Tex file tree中,我的Texlive是\texlive\2011\texmf-dist\tex\latex\tcolorbox,把其它的文件放在texlive\2011\texmf-dist\doc\latex\tcolorbox中。dos窗口中输入texhash刷新数据库,之后texdoc tcolorbox可以打开其帮助文档说明安装成功
2. tcolorbox使用
使用包括4个方面。
2.1 基本使用
跟beamer下的定理框一样:
\documentclass{article}\usepackage{tcolorbox}\begin{document}\begin{tcolorbox}[colback=blue!5,colframe=blue!75!black,title=My title] My box with my title.\end{tcolorbox}\begin{tcolorbox}[colback=yellow!5,colframe=yellow!75!black,title=My title] I can do this also with a title. \tcblower Lower part of my box.\end{tcolorbox}\begin{tcolorbox}[colback=yellow!10,colframe=red!75!black,title=Here I am] I'm invisible until you find me.\end{tcolorbox}\end{document}
环境中使用命令\tcblower表分隔上下部分
其中colback表背景颜色,colframe表边框颜色,title设定标题,colupper, collower分别表上下部分颜色,coltext文本颜色,coltitle标题颜色,还有一些设定边距的选项,可以用texdoc tcolorbox查看帮助。
2.2 listing环境
\tcbuselibrary{listings}来使用listings环境
该环境主要用来用做latex源码与编译结果的对照。
例如:
\begin{tcblisting}{colback=red!5,colframe=red!75!black}This is a \LaTeX\ example which displays the text as source codeand in compiled form.\end{tcblisting}
将会在上部分保持环境中的源码,而在下部分显示对应编译后结果。
还可以对源码部分显示行号:
\begin{tcblisting}{colback=red!5,colframe=red!25,left=6mm,listing options={style=tcblatex,numbers=left,numberstyle=\tiny\color{red!75!black}}}This is a \LaTeX\ example which displays the text as source codeand in compiled form. Additionally, we use line numbers here.\end{tcblisting}
2.3 theorems环境
跟beamer中作用一样用来显示定理定义之类的东西。
2.4 documentation环境
感觉用处不是太大
- LaTex下tcolorbox宏包的安装及使用
- Ubuntu/Mint下LaTeX宏包安装及更新
- latex的宏包安装
- [Latex]ifhen 宏包的使用
- Latex,SlackwareLinux下安装宏包,字体要点
- latex宏包安装小结
- Latex之安装宏包
- 使用latex撰写elsevier论文,latex表格,插图以及调用的安装包
- linux 下 latex 的安装
- Windows下Latex的安装
- LaTeX 中算法有关宏包和命令的使用
- LaTeX技巧018:xcolor宏包的使用
- listings 是专用于代码排版的 LaTeX宏包(及使用xltxtra进行中文支持)
- ubuntu下latex的使用
- Latex的安装配置使用
- LATEX windows XP 安装及使用
- LATEX windows XP 安装及使用
- (centos)安装latex及使用技巧说明
- MFC中设置静态文本的字体颜色、背景透明以及解决字体重叠
- Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/sshnews,J2EEApplication=none,
- 最长公共子序列(Longest Common Subsequence LCS)
- 用 WebBrowser 访问百度
- LISP 维基百科
- LaTex下tcolorbox宏包的安装及使用
- lisp 方言sechme圣经 -- SICP
- Drupal 7 设置上传文件的限制大小
- objective c -- helloword
- lisp方言--scheme
- NIS服务器
- OTcl与C++交互—AODV路由协议
- lisp家族之Clojure
- Linux Kernel Makefiles