mathmaker
0.6(alpha)
|
This machine knows how to write LaTeX commands & math expressions. More...
Public Member Functions | |
def | __init__ |
Constructor The created machine is set to the beginning of an expression, its language is the default one (from cfg file or in case of any problem, from text.DEFAULT_LANGUAGE) its encoding is set to the default one (from cfg file or in case of any problem, from latex.DEFAULT_ENCODING) | |
def | write_document_header |
Write the complete LaTeX header of the sheet to the output. | |
def | write_document_begins |
Writes to the output the command to begin the document. | |
def | write_document_ends |
Writes to the output the end of document command. | |
def | write_exercise_number |
Writes to the output the command displaying an exercise's title. | |
def | write_jump_to_next_page |
Writes to the output the jump to next page command. | |
def | reset_exercises_counter |
Writes to the output the exercises counter reinitialize command. | |
def | write_new_line |
Writes to the output the new line command. | |
def | write_new_line_twice |
Writes to the output two commands writing two new lines. | |
def | write_math_style2 |
Prints the given string as a mathematical expression. | |
def | write_math_style1 |
Prints the given string as a mathematical expression. | |
def | write |
Writes to the output the given string emphasize='bold'|'italics'|'underlined'. | |
def | translate_font_size |
turn the size keyword in LaTeX matching keyword | |
def | write_set_font_size_to |
Writes to the output the command setting the text size. | |
def | write_layout |
Writes a table filled with the given [strings]. | |
def | type_string |
Creates a LaTeX string of the given object. | |
def | insert_dashed_hline |
Draws a horizontal dashed line. | |
def | insert_vspace |
Puts a vertical space (default 1 cm) | |
def | insert_picture |
Draws and inserts the picture of the drawable_arg. | |
def | set_font_size_offset |
Sets the font_size_offset field. | |
def | set_redirect_output_to_str |
Sets the redirect_output_to_str field to True or False. | |
Public Attributes | |
text_sizes | |
font_size_offset | |
create_pic_files | |
encoding | |
language | |
language_code | |
markup | |
out | |
redirect_output_to_str |
This machine knows how to write LaTeX commands & math expressions.
def machine.LaTeX.LaTeX.__init__ | ( | self, | |
language, | |||
options | |||
) |
Constructor The created machine is set to the beginning of an expression, its language is the default one (from cfg file or in case of any problem, from text.DEFAULT_LANGUAGE) its encoding is set to the default one (from cfg file or in case of any problem, from latex.DEFAULT_ENCODING)
expression_begins | True if machine's at an expression's beginning |
**options | Any options |
Definition at line 63 of file LaTeX.py.
References machine.LaTeX.LaTeX.create_pic_files, machine.LaTeX.LaTeX.encoding, machine.LaTeX.LaTeX.font_size_offset, machine.LaTeX.LaTeX.language, machine.LaTeX.LaTeX.language_code, machine.LaTeX.LaTeX.markup, machine.LaTeX.LaTeX.out, machine.LaTeX.LaTeX.redirect_output_to_str, and machine.LaTeX.LaTeX.text_sizes.
def machine.LaTeX.LaTeX.translate_font_size | ( | self, | |
arg | |||
) |
turn the size keyword in LaTeX matching keyword
Reimplemented from machine.Structure.Structure.
Definition at line 364 of file LaTeX.py.
References machine.LaTeX.LaTeX.font_size_offset, and machine.LaTeX.LaTeX.text_sizes.
Referenced by machine.LaTeX.LaTeX.write_document_header(), and machine.LaTeX.LaTeX.write_set_font_size_to().
def machine.LaTeX.LaTeX.write_document_header | ( | self | ) |
Write the complete LaTeX header of the sheet to the output.
Reimplemented from machine.Structure.Structure.
Definition at line 127 of file LaTeX.py.
References machine.LaTeX.LaTeX.encoding, machine.LaTeX.LaTeX.language, machine.LaTeX.LaTeX.redirect_output_to_str, and machine.LaTeX.LaTeX.translate_font_size().
def machine.LaTeX.LaTeX.write_layout | ( | self, | |
size, | |||
col_widths, | |||
content, | |||
options | |||
) |
Writes a table filled with the given [strings].
size | : (nb of lines, nb of columns) |
col_widths | : [int] |
content | : [strings] : borders='all' : unit='inch' etc. (check the possibilities...) def write_table(self, size, col_widths, content, **options): n_col = size[1] n_lin = size[0] result = "" center = "" new_line_sep = "\\\\" + "\n" |
if 'center' in options: center = ">{\centering}" new_line_sep = "\\tabularnewline" + "\n"
if 'borders' in options and options['borders'] == 'all': v_border = "|" h_border = "\\hline \n" Writes content arranged like in a table. In the case of latex, it will just be the same.
size | : (nb of lines, nb of columns) |
col_widths | : [int] |
content | : [strings] : borders=0|1|2|3... (not implemented yet) : unit='inch' etc. (check the possibilities...) |
Reimplemented from machine.Structure.Structure.
Definition at line 461 of file LaTeX.py.
References machine.LaTeX.LaTeX.redirect_output_to_str.