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

captionpos=b in listings results in malformed:ltx:toccaption error #815

Closed
ashinkarov opened this issue Nov 24, 2016 · 1 comment

Comments

@ashinkarov
Copy link

@ashinkarov ashinkarov commented Nov 24, 2016

Here is a minimalistic tex file that uses listings:

\documentclass{article}
\usepackage{listings}

\lstset{
    captionpos=b,
}
\begin{document}
\section{XXX}
\begin{lstlisting}[caption=Caption]
int main() { return 0 };
\end{lstlisting}
\end{document}

If I run latexml as follows:

latexml --dest=test.xml test

I get the following output:

latexml (LaTeXML version 0.8.2)
processing started Thu Nov 24 20:40:16 2016

(Digesting TeX test...
(Loading /usr/lib64/perl5/vendor_perl/5.24.0/LaTeXML/Package/TeX.pool.ltxml...
(Loading /usr/lib64/perl5/vendor_perl/5.24.0/LaTeXML/Package/eTeX.pool.ltxml... 0.00 sec)
(Loading /usr/lib64/perl5/vendor_perl/5.24.0/LaTeXML/Package/pdfTeX.pool.ltxml... 0.00 sec) 0.07 sec)
(Processing content /tmp/test-tutorial/test.tex...
(Loading /usr/lib64/perl5/vendor_perl/5.24.0/LaTeXML/Package/LaTeX.pool.ltxml... 0.09 sec)
(Loading /usr/lib64/perl5/vendor_perl/5.24.0/LaTeXML/Package/article.cls.ltxml... 0.01 sec)
(Loading /usr/lib64/perl5/vendor_perl/5.24.0/LaTeXML/Package/listings.sty.ltxml...
(Processing definitions /usr/share/texmf-dist/tex/latex/listings/listings.cfg... 0.01 sec) 0.20 sec) 0.33 sec) 0.40 sec)
(Building...
(Loading compiled schema /usr/lib64/perl5/vendor_perl/5.24.0/LaTeXML/resources/RelaxNG/LaTeXML.model... 0.01 sec).
Warning:malformed:ltx:toccaption No open node can contain element 'ltx:toccaption'
	at /tmp/test-tutorial/test.tex; line 8 col 13
	XMLDocument[75201552]<ltx:document _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." xmlns="http://dlmf.nist.gov/LaTeXML">...<ltx:section _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." refnum="1" xml:id="S1" _ID_counter_tab_="1">...
	In Core::Document[@0x55cb018] at /tmp/test-tutorial/test.tex; line 8 col 13

Error:malformed:ltx:toccaption <ltx:toccaption> isn't allowed here
	at /tmp/test-tutorial/test.tex; line 8 col 13
	Currently in XMLDocument[75201552]<ltx:document _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." xmlns="http://dlmf.nist.gov/LaTeXML">...<ltx:section _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." refnum="1" xml:id="S1" _ID_counter_tab_="1">...
	In Core::Document[@0x55cb018] at /tmp/test-tutorial/test.tex; line 8 col 13
	 <= Core::Definition::Constructor[\@@tocc... <= Whatsit[\@@toccaption,Core::List[Box[... <= Core::Document[@0x55cb018] <= ...

Warning:malformed:ltx:caption No open node can contain element 'ltx:caption'
	at /tmp/test-tutorial/test.tex; line 8 col 13
	XMLDocument[75201552]<ltx:document _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." xmlns="http://dlmf.nist.gov/LaTeXML">...<ltx:section _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." refnum="1" xml:id="S1" _ID_counter_tab_="1">...
	In Core::Document[@0x55cb018] at /tmp/test-tutorial/test.tex; line 8 col 13

Error:malformed:ltx:caption <ltx:caption> isn't allowed here
	at /tmp/test-tutorial/test.tex; line 8 col 13
	Currently in XMLDocument[75201552]<ltx:document _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." xmlns="http://dlmf.nist.gov/LaTeXML">...<ltx:section _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." refnum="1" xml:id="S1" _ID_counter_tab_="1">...
	In Core::Document[@0x55cb018] at /tmp/test-tutorial/test.tex; line 8 col 13
	 <= Core::Definition::Constructor[\@@capt... <= Whatsit[\@@caption,Core::List[Box[[{]... <= Core::Document[@0x55cb018] <= ...
 0.04 sec)
(Rewriting... 0.00 sec)
(Finalizing... 0.00 sec)
Conversion complete: 2 warnings; 2 errors.
processing finished Thu Nov 24 20:40:16 2016

If I comment out captionpos=b, the compilations is clean.

@dginev dginev added this to the LaTeXML-0.8.3 milestone Nov 24, 2016
@brucemiller

This comment has been minimized.

Copy link
Owner

@brucemiller brucemiller commented Dec 3, 2016

yeah, it was sticking the bottom caption essentially after the equivalent of \end{lstlisting. Should be good now. Thanks for the report!

@brucemiller brucemiller closed this Dec 3, 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.