自动转vim颜色主题到listing颜色设置。vimcolor2texlistings.pl
发表于 : 2011-12-22 21:20
自动转vim颜色主题到listing颜色设置。
指定vim的主题。不指定,缺省使用desert。
tex里面,导言区
然后就可以直接使用
效果
其实,不如 viewtopic.php?f=21&t=357924 的好。主要是那边,颜色堆栈溢出,不好处理。
指定vim的主题。不指定,缺省使用desert。
代码: 全选
● vimcolor2texlistings.pl >autolst.tex
● vimcolor2texlistings.pl /usr/share/vim/vim72/colors/shine.vim >autolst.tex
代码: 全选
\input{autolst.tex}
代码: 全选
%\color{white}
%\setmainfont{Courier 10 Pitch}
\begin{lstlisting}[language=perl]
foreach (`/usr/bin/cflow -l $in`){
chomp;
s/\(.*$//; s/^\{\s*//; s/\}\s*/\t/;
my($n,$f)=split /\t/,$_;
$index[$n]=$f;
if($n){
# 说明
$_="$index[$n-1]->$f";
push @output,"node [color=\"$color[$n-1]\" shape=$shape[$n]];edge [color=\"$color[$n-1]\"];\n$_\n" if(! $count{$_}++);
}
else{push @output,"$f [shape=box];\n";}
}
\end{lstlisting}
%\setmainfont{Vera Sans YuanTi}
%\color{black}