Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listings in figures? #779

Closed
kohlhase opened this issue Jul 4, 2016 · 2 comments

Comments

@kohlhase
Copy link
Contributor

@kohlhase 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 <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?

@dginev dginev added this to the LaTeXML-0.8.3 milestone Jul 4, 2016
@brucemiller

This comment has been minimized.

Copy link
Owner

@brucemiller 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

This comment has been minimized.

Copy link
Owner

@brucemiller brucemiller commented Dec 5, 2016

Still works, but I noticed that the CSS from \centering leaked into the listing, so I fixed that.

@brucemiller brucemiller closed this Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.