KTUGFaq
KTUG FAQ
遣; › MemhangulClass › AcroEdit&value=Yhchoe/ġ̵ › 占십몌옙占쏙옙占쏙옙占쏙옙占쏙옙見占 › CrimsonEditor ›
TeX α ̱ ϴ. ɾ ϸ ϴ ̿ܿ Ͽ ϰ ʹٸ ϸ ȴ.
\newcommand\bme{\newwrite\example@out\immediate\openout \example@out hello.exa}% fopen \newcommand\hello[2][\@empty]{% \ifx#1\@empty%1 No option \def\temp@val{1 : }% \else% Option \def\temp@val{#1 : }% \fi% \immediate\write\example@out{\temp@val #2}#2}% fwrite \newcommand\eme{\immediate\closeout\example@out}% fclose
뿹 .
\bme \hello[3]{With parameter} \hello{Without parameter} \eme
̿Ͽ ڵ ȯ ¶
α hello.exa ǰ Ͽ տ ϵǾ ִ. ̸ ruby ̿ϸ( ٸ -perl/python/lua/tcl ̿ ִ .) itemize/enumerate ϴ ڵ ٲ ִ. ̴ .
# Program : Filter.rb # Input : File name # Output : LaTeX - description or item source code that is intended to be \input{} # Global variable __LEVEL__ sets the level that is to be printed. # example) if __LEVEL__ = 2, 1 XXX is not printed $LEVEL = 1 $WHAT = "enumerate" def process(filename_) f = File.new('res.tex','w') f << "\\begin{#{$WHAT}}\n" File.open(filename_) do |file| file.each_line do |line| if line =~ /^(\d+)\s:\s(.*)$/ # $1 -> number, $2 -> string if ($LEVEL <= $1.to_i) f << '\item ' << $2 << "\n" end else puts 'No match' end end end f << "\\end{#{$WHAT}}\n" f.close() end if $0 == __FILE__ # Argument Check if ARGV.length > 1 puts "Usage : " + $0 + " filename" exit end puts 'processing >> ' + ARGV[0] file = ARGV[0] process(file) end