KTUGFaq

KTUG FAQ

α:
йȣ:
Money will say more in one moment than the most eloquent lover can in years.
占쏙옙占싹몌옙占식∽옙占ConservativeRockListnersGroup&value=TeXǸŷKC2008/Troubles&value=ŬͽŸ占쏙옙占십뤄옙체/GSUB&value=함초롬체/GSUBProgress/2006-03&value=ѱTrueType۲û
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

^
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2007-02-05 08:53:38
Processing time 0.0385 sec