载入中。。。 'S bLog
 
载入中。。。
 
载入中。。。
载入中。。。
载入中。。。
载入中。。。
载入中。。。
 
填写您的邮件地址,订阅我们的精彩内容:


 
latex写论文,pdf字数统计方法
[ 2012/4/24 21:21:00 | By: 梦翔儿 ]
 

latex写论文,pdf字数统计成了一个问题,好在收集一些资料后终于得以解决
http://topic.csdn.net/u/20110301/15/5d09a943-8319-4093-bf79-357ef9dfea62.html

$ cat cwc_utf8.pl
#!/usr/bin/perl -w
 
my $s;
my $x;
my $y;
my $ncword = 0;
my $cword = 0;
 
while (<>) {
    $s = $_;
    $s =~ s/\s//g;
    $x = () = $s =~ /[\x00-\x7f]+?/g;
    $y = () = $s =~ /[^\x00-\x7f]+?/g;
 
    $ncword += $x;
    $cword += $y;
}
 
$cword /= 3;
 
print "\n字数统计\n";
print "\t非中文(不含空格):\t$ncword\n";
print "\t中文:\t\t\t$cword\n";
 
$s = $ncword + $cword;
print "\t共计:\t\t\t$s\n";

写入Makefile:

$ cat Makefile
TARGET := thesis

all: wordcount
    @okular $(TARGET).pdf 2> /dev/null

pdf: wordcount

report:clean
    xelatex $(TARGET)
    bibtex  $(TARGET)
    xelatex $(TARGET)
    xelatex $(TARGET)

wordcount:report
    pdftotext $(TARGET).pdf
    @cwc_utf8.pl $(TARGET).txt

clean:
    @make -C chapter clean
    @rm -vfr *.pdf *.out *.log *.toc *.aux *.bak *.bbl *.blg *.txt

可惜pdftotext有些小偏差,生成的txt文件少了几个字符,和http://felix-cat.com/tools/wordcount/的统计结果有些出入,不过只�**浪愕幕熬凸挥昧�

from:http://stesen.wikidot.com/wc

 
 
  • 标签:latex pdf 字数统计 
  •  
    Re:latex写论文,pdf字数统计方法
    [ 2013/4/12 11:22:17 | By: zhtlancer(游客) ]
     
    zhtlancer(游客)赞,一直没有找到能比较好的统计字数的编辑器,看来只能用这招了~
     
     
    发表评论:
    载入中。。。

     
     
     

    梦翔儿网站 梦飞翔的地方 http://www.dreamflier.net
    中华人民共和国信息产业部TCP/IP系统 备案序号:辽ICP备09000550号

    Powered by Oblog.