Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When using Minted to highlight a PL/pgSQL script, I get following error:

TypeError: 'NoneType' object has no attribute '__getitem__'
(File '%pythonpath%/scripts/pygments/formatters/latex.py', line 133, in _get_ttype_name)

So I tried to use the PostgresLexer, but when trying to compile, this gives errors because square brackets aren't properly escaped:

\begin{minted}[fontsize=\footnotesize,frame=single]{postgresql}
-- Function: dist_calc(bigint[])
-- DROP FUNCTION dist_calc(bigint[]);

CREATE OR REPLACE FUNCTION dist_calc(nodes_array bigint[])
RETURNS double precision AS
$BODY$
DECLARE
geom_1 RECORD;
...
\end{minted}

Is there a solution for the plpgsql lexer, or is there another lexer I could use to format

share|improve this question
1  
Hi, welcome to TeX.sx! :) Your code snippet works flawlessly with me (old TL2011, Pygments 1.5). Could you add a minimal working example (MWE) containing your document class, packages and other definitions? It might help us to track down the error. :) –  Paulo Cereda Aug 6 '12 at 11:14
add comment

closed as too localized by egreg, Joseph Wright Apr 6 '13 at 21:05

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.