My Problem is that, I want to build a letter generator, which first builds a latex-file from user input, and then compiles this via latex to PDF.
The template contains multiple lines like this:
\setkomavar{signature}{{{.Name}}}
The latex
part is \setkomavar{signature}{}
, and the template
part from go is {{.Name}}
.
When I try to load the template, it throws this error:
panic: template: letter.tmpl:72: unexpected "}" in command
Is there a trick to help the parser handling such a situation?
Thanks in advance,
Tino
A better solution is actually to just use the built in whitespace operators, like:
\setkomavar{signature}{ {{- .Name -}} }
The -
at the beginning and end will remove whitespace between that token and the next non-template token.
Hope that helps, see the docs for more detail
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With