Opened 9 years ago

Last modified 9 years ago

# I would like to have something like a TexInclude-Macro

Reported by: Owned by: k9ert@… chenca normal Trac2LatexPlugin normal 0.10

### Description

I am using the Include-Makro to include other Wiki-Pages in an existing Page. These Pages are not layouted by Trac2Latex. In the PDF, I get something like this:

¡/p¿¡div class=”system-message”¿¡strong¿Error: Failed to load processor ¡code¿TexInclude¡/code¿¡/strong


Maybe, this Macro is simple to implement but it would be very useful for people who wants to generate PDFs from more than one Wiki-Page.

### comment:1 Changed 9 years ago by k9ert@…

I forgot to mention that this uses the Plugin WikiIncludeMacro

I tried to implement it with an awful hack (I have nearly no python Knowledge). Here is the core code of a new TexWikiIncludeMacro:

class TexWikiIncludeMacro(Component):
implements(IWikiMacroProvider)

def get_macros(self):
yield 'TexWikiInclude'

def get_macro_description(self, name):
return inspect.getdoc(TexWikiIncludeMacro)

def render_macro(self, req, name, txt):
url = "http://localhost/cgi-bin/trac.cgi/wiki/%s?format=tex" % name
opener = urllib.urlopen(url)
return opener.read()


It works with an simple example but I have a problem with Umlauts (and it needs cleanup)?! Could anyone help me? I can send the source, if anyone is interested in this?

### Modify Ticket

Action
as new The owner will remain chenca.
Author

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

Note: See TracTickets for help on using tickets.