aarya has asked for the wisdom of the Perl Monks concerning the following question:

Hi Everyone,

I am facing some problem in creating a table, my sample data and latex pdf.tt file contents are pasted on http://pastebin.com/t5V1AK1m. The problem is in my sample data "comments key value" creating the problem.

I can't use % tx.comments % with \multicolumn{6}{c}{ % tx.comments % } the contents of comments is variable in length so I am printing in a separate row.

In my current pasted code if I print with % tx.comments % it print the data but under on Ist column of table, and width of first column is become large based on contents of comments. I want to print it in next row.

if I print \textbf{% tx.serial %} \\ or any other variable except comments then it prints but when I print \textbf{% tx.comments %} \\ it gives the below error.

Couldn't render template "src/diner/bill_pdf.tt: latex error - pdflatex exited with errors: ! File ended while scanning use of \textbf . ! Emergency stop. ! ==> Fatal error occurred, no output PDF file produced!

I am not able to find what is wrong with this comments key data, while it working for other keys value. Even other keys also works with \multicolumn too.

Thanks. Amit Bondwal
  • Comment on (OT) Template toolkit latex table issue

Replies are listed 'Best First'.
Re: (OT) Template toolkit latex table issue
by Corion (Patriarch) on Sep 23, 2016 at 05:30 UTC

    This is not a Perl problem but more a problem with your generated LaTeχ code. pdflatex tells you that a \textbf command was problematic. So you should look at the created .tex file and look what it is that pdflatex doesn't like. Maybe it's malformed input.

    Once you have determined that, we can maybe help you improve your program so it generates better LaTeχ .

      Hi thanks for your comment, I am facing problem with only tx.comments key value if I put any other keys it's works fine with both \textbf and \multicolumn. I unable to differentiate what is the issue with that if it's latex issue then it should not work with other keys values too.

        Have you considered looking at the .tex output files your program creates? These would be to me the most obvious thing to look at to find what LaTeχ dislikes. From there, you can maybe investigate further.

        Is there any way, how can I check it is malformed input? that will be very helpful