Modify

Opened 8 years ago

Closed 6 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

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)

tracmath_new.py (8.0 KB) - added by anonymous 8 years ago.
full new file
ext.diff (997 bytes) - added by trachacks@… 8 years ago.
diff of original and rewritten file

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by anonymous

Attachment: tracmath_new.py added

full new file

Changed 8 years ago by trachacks@…

Attachment: ext.diff added

diff of original and rewritten file

comment:1 Changed 8 years ago by trachacks@…

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 8 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 6 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
Action
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.