# listings in figures? #779

Closed
opened this issue Jul 4, 2016 · 2 comments
Labels
Milestone

### kohlhase commented Jul 4, 2016

 I have \begin{figure}\centering \lstinputlisting{omcdgroup2.rnc} \caption{Relax NG Specification of CDGroups}\label{fig_cdgroup.dtd} \end{figure}  and I get the error Error:malformed:ltx:listing isn't allowed here /Users/kohlhase/vc/git/github.com/OpenMath/OM20STD-LaTeX/cds.tex#textrange(from=306;1,to=306;25) Currently in XMLDocument[140198755772224]............... In Core::Document[@0x7f828c0bced0] /Users/kohlhase/vc/git/github.com/OpenMath/OM20STD-LaTeX/cds.tex#textrange(from=306;1,to=306;25) <= Core::Definition::Constructor[\@@list... <= Whatsit[\@@listings,Core::List[Box[l]... <= Core::Document[@0x7f828c0bced0] <= ...  But I am not sure what happens there. I looked and LaTeXML-para.rnc contains figure_model = (figure | table | float | Block.model | Caption.class)*  and Block.model. does contain listing. That being said, why do you use Block.model here, and not Block.class, could this be the problem?
added this to the LaTeXML-0.8.3 milestone Jul 4, 2016

### brucemiller commented Jul 4, 2016

 Odd; I don't see that error. I did stumble onto a naming conflict with two "datatype" attributes (one for RDFa, the other for raw data from listings and such; I changed the latter to "datamimetype"). That shouldn't cause the issue though. Can you verify in the current git?

### brucemiller commented Dec 5, 2016

 Still works, but I noticed that the CSS from \centering leaked into the listing, so I fixed that.
closed this Dec 5, 2016