Class: ReVIEW::LaTeXBox
Instance Method Summary collapse
-
#initialize ⇒ LaTeXBox
constructor
A new instance of LaTeXBox.
- #tcbox(config) ⇒ Object
Constructor Details
Instance Method Details
#tcbox(config) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/review/latexbox.rb', line 15 def tcbox(config) ret = '' %w[column note memo tip info warning important caution notice].each do |name| if config['pdfmaker'].nil? || config['pdfmaker']['boxsetting'].nil? || config['pdfmaker']['boxsetting'][name].nil? || config['pdfmaker']['boxsetting'][name]['style'].nil? next end = '[]' = '[]' if config['pdfmaker']['boxsetting'][name]['options'] = "[#{config['pdfmaker']['boxsetting'][name]['options']}]" = end if config['pdfmaker']['boxsetting'][name]['options_with_caption'] = "[#{config['pdfmaker']['boxsetting'][name]['options_with_caption']}]" end ret << <<EOT \\renewenvironment{review#{name}}[1][]{% \\csdef{rv@tmp@withcaption}{true} \\notblank{##1}{ \\begin{rv@#{config['pdfmaker']['boxsetting'][name]['style']}@caption}{##1}#{} }{ \\csundef{rv@tmp@withcaption} \\begin{rv@#{config['pdfmaker']['boxsetting'][name]['style']}@nocaption}#{} } }{ \\ifcsdef{rv@tmp@withcaption}{ \\end{rv@#{config['pdfmaker']['boxsetting'][name]['style']}@caption} }{ \\end{rv@#{config['pdfmaker']['boxsetting'][name]['style']}@nocaption} } } EOT end ret end |