看板LaTeX
标 题Re: [问题] 请问如何看到并编辑tex的原始档?
发信站SayYA 资讯站 (Fri Apr 20 19:23:42 2007)
转信站ptt!ctu-reader!news.nctu!SayYa
※ 引述《Edward (蒙古大夫 2.0)》之铭言:
> ※ 引述《[email protected] (Liang)》之铭言:
> > 我手上有一些副档名为tex的档案,需要对里面的内容做更动
> > 我用texmacs是看得到里面的内容,可是内容似乎有点问题
> > 所以我希望直接看到文字档的东西
> > 请问:
> > 如何将.tex转档成普通文字档?
> > 另外,这些档案有附图档和字型档,但是开启.tex档时没有自动加入
> > 请问,图形的话是否要一个一个手动加入?字型的话需要加在那个子目录?
> > 谢谢大家帮忙,感激不尽~
> 使用 detex。
看了这篇觉得 detex 应该需要安装
在 ubuntu 上
aptitute search detex 发现没有 package
http://www.cs.purdue.edu/homes/trinkle/detex/
# tar source
http://www.cs.purdue.edu/homes/trinkle/detex/detex-2.7.tar
google 一下 发现这篇
http://ubuntuforums.org/showthread.php?t=7570
无法 从 source make 的问题
gcc -O -c -o detex.o detex.c
xxx.l:42: error: conflicting types for ‘malloc’
make: *** [detex.o] Error 1
修改 Makefile
#line 114
#DEFS += ${DEFS} -DNO_MALLOC_DECL
DEFS = -DNO_MALLOC_DECL
重新 make
sed -f states.sed detex.l > xxx.l
lex xxx.l
rm -f xxx.l
mv lex.yy.c detex.c
gcc -O -DNO_MALLOC_DECL -c -o detex.o detex.c
lex.yy.c:796: error: expected identifier or ‘(’ before ‘]’ token
make: *** [detex.o] Error 1
lex.yy.c 是 sed 产生的暂存档 从 Makefile 发现 已经 mv 成 detex.c 了
vi detex.c
#line 796
]]
将这两个 ]] 拿掉
/*]]*/
就成功了! make 出 这个 执行档
detex
$ cat my.tex
\documentclass{article}
\begin{document}
This is a \LaTeX\ testing example
\end{document}
$ detex my.tex
article
This is a testing example
到这边 成功可以使用 detex 了
或许有更方便的方法 不过 这是我目前知道会动的方法
--
※ Origin: SayYA 资讯站 <bbs.sayya.org>
◆ From: nlp4.et.ntust.edu.tw