Although the above answers may solve the original problem, I add some hacks here for those who scratch their heads like me.
Several times we want to display a single bracket followed by a variable. For example, in BibTeX there might be something similar to this:
@MISC{hu2012-spectral, author = {Hu, Pili}, title = {Spectral Clustering Survey}, howpublished = {GitHub, https://github.com/hupili/tutorial/tree/master/spectral-clustering}, month = {May}, year = {2012} }
These bib fields come from template variables. If you write
title = {{{title}}},
jinja cannot compile and raise an error. If you write
title = { {{title}} },
there will be extra spaces. Clap around - store '{' and '}' as variables and use later.
{% set lb = '{' %} {% set rb = '}' %} ... @MISC{{lb}}{{ meta.bib_key }}, author = {{lb}}Hu, Pili{{rb}}, title = {{lb}}{{ meta.title }}{{rb}}, howpublished = {{lb}}GitHub, https://github.com/hupili/tutorial/tree/master/{{ auto.path}}{{rb}}, month = {{lb}}{{ meta.month }}{{rb}}, year = {{lb}}{{ meta.year }}{{rb}} }
It looks awkward, but it's the best I find so far. If you have a cleaner solution, please tell me.
Pili Hu Jun 16 '13 at 7:51 on 2013-06-16 07:51
source share