Opened 16 years ago
Closed 13 years ago
#4748 closed enhancement (fixed)
extending with own latex-packages
Reported by: | Owned by: | Kamil Kisiel | |
---|---|---|---|
Priority: | normal | Component: | TracMathPlugin |
Severity: | normal | Keywords: | |
Cc: | Mitar | Trac Release: | 0.11 |
Description
Thanks for the well working plugin.
I extend the plugin with a mechanism that allows to extend the latex preamble (trac.ini).
extend_tex_preamble = \usepackage{boxedminipage}
Moreover the extension allows to rewrite the full latex preamble (trac.ini):
tex_preamble = \documentclass{article}\usepackage{amsmath,amsthm,amssymb}\usepackage{color}
If no attribute tex_preamble
is set the default value is used.
extend_tex_preamble
and tex_preamble
can be used simultaneously.
Tested on trac version 0.11.1.
Because tracmath crashes if there exists e.g. a tex file in the tmp directory which does not belong to tracmath, I also extend the filenames with the prefix tracmath
.
Attachments (2)
Change History (6)
Changed 16 years ago by
Attachment: | tracmath_new.py added |
---|
comment:1 Changed 16 years ago by
diff seems not to be uploaded:
34d33 < \begin{document} 37c36 < rePNG = re.compile(r'.+png$') --- > rePNG = re.compile(r'tracmath.+png$') 39,42c38,41 < re.compile(r'.+aux$'), < re.compile(r'.+log$'), < re.compile(r'.+tex$'), < re.compile(r'.+dvi$'), --- > re.compile(r'tracmath.+aux$'), > re.compile(r'tracmath.+log$'), > re.compile(r'tracmath.+tex$'), > re.compile(r'tracmath.+dvi$'), 70a70,71 > self.tex_preamble = self.config.get('tracmath', 'tex_preamble') or tex_preamble > self.extend_tex_preamble = self.config.get('tracmath', 'extend_tex_preamble') or '' 145c146 < key = sha.new(content.encode('utf-8')).hexdigest() --- > key = 'tracmath'+sha.new(content.encode('utf-8')).hexdigest() 157c158,160 < f.write(tex_preamble) --- > f.write(self.tex_preamble) > f.write(self.extend_tex_preamble) > f.write(r'\begin{document}')
comment:2 Changed 16 years ago by
An error will happen, if the tmp directory is set to '/tmp/tracmath'.
This is caused by the new file prefix and the split in line 242.
All other directory names work.
comment:3 Changed 14 years ago by
Owner: | changed from rlotun to Kamil Kisiel |
---|---|
Status: | new → assigned |
comment:4 Changed 13 years ago by
Cc: | Mitar added; anonymous removed |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in 0.5. You can now use your own document template.
full new file