Opened 9 years ago

Closed 7 years ago

#4748 closed enhancement (fixed)

extending with own latex-packages

Reported by: trachacks@… Owned by: Kamil Kisiel
Priority: normal Component: TracMathPlugin
Severity: normal Keywords:
Cc: Mitar Trac Release: 0.11


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) (8.0 KB) - added by anonymous 9 years ago.
full new file
ext.diff (997 bytes) - added by trachacks@… 9 years ago.
diff of original and rewritten file

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by anonymous

Attachment: added

full new file

Changed 9 years ago by trachacks@…

Attachment: ext.diff added

diff of original and rewritten file

comment:1 Changed 9 years ago by trachacks@…

diff seems not to be uploaded:

< \begin{document}
< rePNG = re.compile(r'.+png$')
> rePNG = re.compile(r'tracmath.+png$')
<              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$'),
>         self.tex_preamble = self.config.get('tracmath', 'tex_preamble') or tex_preamble
>         self.extend_tex_preamble = self.config.get('tracmath', 'extend_tex_preamble') or ''
<         key ='utf-8')).hexdigest()
>         key = 'tracmath''utf-8')).hexdigest()
<                 f.write(tex_preamble)
>                 f.write(self.tex_preamble)
>                 f.write(self.extend_tex_preamble)
>                 f.write(r'\begin{document}')

comment:2 Changed 9 years ago by trachacks@…

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 7 years ago by Kamil Kisiel

Owner: changed from rlotun to Kamil Kisiel
Status: newassigned

comment:4 Changed 7 years ago by Mitar

Cc: Mitar added; anonymous removed
Resolution: fixed
Status: assignedclosed

Fixed in 0.5. You can now use your own document template.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Kamil Kisiel.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.