CTex listings宏包出错undefined control sequence,换成verbatim解决问题
来源:互联网 发布:java微信带参数二维码 编辑:程序博客网 时间:2024/06/01 08:24
在CTex欲显示源代码,首先使用listings宏包,
\usepackage{listings}
......
然后
\begin{lstlisting}
public static class MapClass extends MapReduceBase
implements Mapper<LongWritable, Text, Text, IntWritable> {
private final static IntWritable one = new IntWritable(1);
private Text word = new Text();
public void map(LongWritable key, Text value,
OutputCollector<Text, IntWritable> output,
Reporter reporter) throws IOException {
String line = value.toString();
StringTokenizer itr = new StringTokenizer(line);
}
}
\end{lstlisting}
接着PDFLatex,但是总是提示出错, undefined control sequence,找了很久没发现是什么问题.
将其中的代码部分改为一段C的hello world代码,则编译通过.
始终不得其解.
最后解决办法是改用verbatim宏包,
将上述代码改为用\begin{verbatim} 和\end{verbatim}包围.
则顺利通过编译.
- CTex listings宏包出错undefined control sequence,换成verbatim解决问题
- listings 宏包札记
- ubuntu 添加 listings 宏包
- Latex listings 宏包排版代码
- latex插入图片时,Undefined control sequence.
- Latex错误: Undefined control sequence. \override margin
- d:mtex/texlocal/l3packages/xparse.sty:57: Undefined control sequence
- Latax 排版问题 报错: undefined control sequence \includegraphics
- xeLetex中文完美支持Beamer+ctex宏包,请看示例
- CTEX - 在线文档 - TeX/LaTeX 常用宏包
- WinEdt+CTeX+pst-optic宏包使用初体验
- CTeX 中 MiKTeX 太旧,无法更新宏包解决方案
- listings 是专用于代码排版的 LaTeX宏包(及使用xltxtra进行中文支持)
- Latex:IEEE会议模板中出现undefined control sequence \includegraphics问题解决方法
- LaTex:插入代码的listings包和lstlisting环境
- CTEX
- u10.04下 tevlive-xetex 、texmaker 、ctex宏包 安装成功(附过程)
- (CTEX)Latex加入RevTex包
- iPhone代码片段收集
- spring aop pointcut expression 例子说明
- iphone里的动画过渡
- 蔡勒(Zeller)公式(计算星期)
- 数据结构-二叉树(1)
- CTex listings宏包出错undefined control sequence,换成verbatim解决问题
- 算法代码(2)——分治法排序
- hdoj 1615
- 菜鸟学iPhone开发-计算器实例
- iphone开发笔记(-) 退回输入键盘:自定义颜色:隐藏状态栏:
- 开博
- field module的on input和on request区别
- 【poj】1363-Rails
- Iphone SDK 实例--新手必读