Module: Texas::Template::Helper::TeX
- Included in:
- Runner::TeX
- Defined in:
- lib/texas/template/helper/tex.rb
Instance Method Summary collapse
-
#auto_link(text) ⇒ Object
Converts all URLs in a text in url TeX commands.
- #bold(text) ⇒ Object (also: #b)
- #h1(*args) ⇒ Object
- #h2(*args) ⇒ Object
- #h3(*args) ⇒ Object
- #h4(text) ⇒ Object
- #input(*path) ⇒ Object
- #input!(*path) ⇒ Object
- #italic(text) ⇒ Object (also: #i)
- #linebreak ⇒ Object (also: #br)
- #quote(string) ⇒ Object
- #write_template_for_input(path) ⇒ Object
Instance Method Details
#auto_link(text) ⇒ Object
Converts all URLs in a text in url TeX commands
9 10 11 |
# File 'lib/texas/template/helper/tex.rb', line 9 def auto_link(text) text.to_s.gsub(/(https*\:\/\/\S+)/, '\url{\1}') end |
#bold(text) ⇒ Object Also known as: b
13 14 15 |
# File 'lib/texas/template/helper/tex.rb', line 13 def bold(text) tex :textbf, text end |
#h1(*args) ⇒ Object
18 |
# File 'lib/texas/template/helper/tex.rb', line 18 def h1(*args); tex(:section, *args); end |
#h2(*args) ⇒ Object
19 |
# File 'lib/texas/template/helper/tex.rb', line 19 def h2(*args); tex(:subsection, *args); end |
#h3(*args) ⇒ Object
20 |
# File 'lib/texas/template/helper/tex.rb', line 20 def h3(*args); tex(:subsubsection, *args); end |
#h4(text) ⇒ Object
21 |
# File 'lib/texas/template/helper/tex.rb', line 21 def h4(text); '\paragraph{'+text+'} ~\\'; end |
#input(*path) ⇒ Object
28 29 30 31 |
# File 'lib/texas/template/helper/tex.rb', line 28 def input(*path) write_template_for_input(path) tex :input, relative_template_basename(path) end |
#input!(*path) ⇒ Object
33 34 35 36 |
# File 'lib/texas/template/helper/tex.rb', line 33 def input!(*path) write_template_for_input(path) tex :include, relative_template_basename(path) end |
#italic(text) ⇒ Object Also known as: i
23 24 25 |
# File 'lib/texas/template/helper/tex.rb', line 23 def italic(text) tex :emph, text end |
#linebreak ⇒ Object Also known as: br
38 39 40 |
# File 'lib/texas/template/helper/tex.rb', line 38 def linebreak "\\\\" end |
#quote(string) ⇒ Object
43 44 45 |
# File 'lib/texas/template/helper/tex.rb', line 43 def quote(string) "\"`#{string}\"'" end |