Modify

Opened 7 years ago

Last modified 7 years ago

#1919 new enhancement

I would like to have something like a TexInclude-Macro

Reported by: k9ert@… Owned by: chenca
Priority: normal Component: Trac2LatexPlugin
Severity: normal Keywords:
Cc: Trac Release: 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.

Attachments (0)

Change History (1)

comment:1 Changed 7 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?

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.