Opened 11 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 11 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)


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

Change Properties