Skip to content

listings in figures? #779

Description

@kohlhase

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 <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]<ltx:document _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." class="ltx_authors_1line" xmlns="http://dlmf.nist.gov/LaTeXML">...<ltx:chapter _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." frefnum="Chapter 4" refnum="4" xml:id="Ch4" labels="LABEL:cha_cd" _ID_counter_p_="1">...<ltx:section _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." refnum="4.4" xml:id="Ch4.S4" labels="LABEL:addfiles" _ID_counter_p_="1">...<ltx:subsection _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." refnum="4.4.2" xml:id="Ch4.S4.SS2" labels="LABEL:ssec_cdgroups" _ID_counter_p_="2">...<ltx:subsubsection _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." xml:id="Ch4.S4.SS2.SSSx1" labels="LABEL:sec_dtd_cdg" _ID_counter_p_="2">...<ltx:figure _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." frefnum="Figure 4.1" refnum="4.1" xml:id="Ch4.F1"/>
    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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions