No escaping of mako directives, cannot easily put a percent sign in my document at the beggining of a line

Issue #112 resolved
created an issue

I am using mako to render a TeX doc and have found it rather distirbing that I was not able to figure out how to easily put a % sign (comment in TeX) as the first charachter (after any white space) in a line. The reason of course is mako thinks of it as a directive.

Looked through the documentation and did not find a way to escape the percent sign. So if a solution exists there is at least a bug in the documentation.

My Solution is to use ${'%'}

I found this to have to many characters where my purpose is to output a comment, so it is not really worth it.

-- Hatem

PS. I am a Mako user, but I did try Jinja2 for this to start (just to get a feel for it) and it failed miserably, as opposed to Mako which only complained about the TeX comments. From now on Mako is my first choice.

Comments (5)

  1. umeboshi2

    The <%text> tag is somewhat buried in the documentation with respect to somebody who is trying to quickly look up how to keep mako from parsing the parts of my template that I want to be taken literally. It would be nice if there was a small reference section that briefly listed some of this. I found this issue by googling escaping mako directives.

  2. Michael Bayer repo owner

    it is two clicks, minimal scrolling. Click on "Documentation" at, then click on It is the eighth link in the second section of the documentation, "Syntax". This section, "Syntax", includes the total of Mako syntax, and the "Tags" section, described as "a quick summary of all the tags:", lists out each tag with a short description with links to further details for each tag.

    From everything I can see this looks a lot like a "small reference section that listed out tags" and it's linked from the top page of the documentation.

  3. Log in to comment