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

Unexpected end of input when converting Latex #443

Closed
devn opened this Issue Mar 10, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@devn

devn commented Mar 10, 2012

I am trying to convert https://github.com/fogus/clojure-cheatsheets/blob/master/src/cljs-cheatsheet.tex (latex) to markdown.

I receive the following error:

clojure-cheatsheets/src/master ☣(solo)> pandoc -o cheatsheet.markdown cljs-cheatsheet.tex
pandoc: 
Error:
"source" (line 244, column 1):
unexpected end of input
expecting "\\"

I am running OSX 10.7.3. pandoc --version reports:

pandoc 1.9.1.1
Compiled with citeproc-hs 0.3.4, texmath 0.6.0.3, highlighting-kate 0.5.0.2.
Syntax highlighting is supported for the following languages:
    Actionscript, Ada, Alert, Alert_indent, Apache, Asn1, Asp, Awk, Bash,
    Bibtex, Boo, C, Changelog, Clojure, Cmake, Coffeescript, Coldfusion,
    Commonlisp, Cpp, Cs, Css, D, Diff, Djangotemplate, Doxygen, Dtd, Eiffel,
    Email, Erlang, Fortran, Fsharp, Gnuassembler, Go, Haskell, Haxe, Html, Ini,
    Java, Javadoc, Javascript, Json, Jsp, Latex, Lex, LiterateHaskell, Lua,
    Makefile, Mandoc, Matlab, Maxima, Metafont, Mips, Modula2, Modula3,
    Monobasic, Nasm, Noweb, Objectivec, Objectivecpp, Ocaml, Octave, Pascal,
    Perl, Php, Pike, Postscript, Prolog, Python, R, Relaxngcompact, Rhtml, Ruby,
    Scala, Scheme, Sci, Sed, Sgml, Sql, SqlMysql, SqlPostgresql, Tcl, Texinfo,
    Verilog, Vhdl, Xml, Xorg, Xslt, Xul, Yacc, Yaml
Copyright (C) 2006-2012 John MacFarlane
Web:  http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.  There is no
warranty, not even for merchantability or fitness for a particular purpose.
@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Mar 10, 2012

Owner

This bit seems to cause the problem:

\begin{lstlisting}[label=ns,caption=Example Namespace Declaration](ns my-cool-lib
%28:require [some-lib :as lib]%29
%28:use [another-lib :only %28a-func%29]%29
%28:require-macros [my.macros :as macs]%29
%28:use-macros [mo.macs :only %28my-mac%29]%29)
\end{lstlisting}

+++ Devin Walters [Mar 10 12 11:04 ]:

I am trying to convert https://github.com/fogus/clojure-cheatsheets/blob/master/src/cljs-cheatsheet.tex (latex) to markdown.

I receive the following error:

clojure-cheatsheets/src/master ☣(solo)> pandoc -o cheatsheet.markdown cljs-cheatsheet.tex
pandoc: 
Error:
"source" (line 244, column 1):
unexpected end of input
expecting "\\"

I am running OSX 10.7.3. pandoc --version reports:

pandoc 1.9.1.1
Compiled with citeproc-hs 0.3.4, texmath 0.6.0.3, highlighting-kate 0.5.0.2.
Syntax highlighting is supported for the following languages:
    Actionscript, Ada, Alert, Alert_indent, Apache, Asn1, Asp, Awk, Bash,
    Bibtex, Boo, C, Changelog, Clojure, Cmake, Coffeescript, Coldfusion,
    Commonlisp, Cpp, Cs, Css, D, Diff, Djangotemplate, Doxygen, Dtd, Eiffel,
    Email, Erlang, Fortran, Fsharp, Gnuassembler, Go, Haskell, Haxe, Html, Ini,
    Java, Javadoc, Javascript, Json, Jsp, Latex, Lex, LiterateHaskell, Lua,
    Makefile, Mandoc, Matlab, Maxima, Metafont, Mips, Modula2, Modula3,
    Monobasic, Nasm, Noweb, Objectivec, Objectivecpp, Ocaml, Octave, Pascal,
    Perl, Php, Pike, Postscript, Prolog, Python, R, Relaxngcompact, Rhtml, Ruby,
    Scala, Scheme, Sci, Sed, Sgml, Sql, SqlMysql, SqlPostgresql, Tcl, Texinfo,
    Verilog, Vhdl, Xml, Xorg, Xslt, Xul, Yacc, Yaml
Copyright (C) 2006-2012 John MacFarlane
Web:  http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.  There is no
warranty, not even for merchantability or fitness for a particular purpose.

Reply to this email directly or view it on GitHub:
#443

Owner

jgm commented Mar 10, 2012

This bit seems to cause the problem:

\begin{lstlisting}[label=ns,caption=Example Namespace Declaration](ns my-cool-lib
%28:require [some-lib :as lib]%29
%28:use [another-lib :only %28a-func%29]%29
%28:require-macros [my.macros :as macs]%29
%28:use-macros [mo.macs :only %28my-mac%29]%29)
\end{lstlisting}

+++ Devin Walters [Mar 10 12 11:04 ]:

I am trying to convert https://github.com/fogus/clojure-cheatsheets/blob/master/src/cljs-cheatsheet.tex (latex) to markdown.

I receive the following error:

clojure-cheatsheets/src/master ☣(solo)> pandoc -o cheatsheet.markdown cljs-cheatsheet.tex
pandoc: 
Error:
"source" (line 244, column 1):
unexpected end of input
expecting "\\"

I am running OSX 10.7.3. pandoc --version reports:

pandoc 1.9.1.1
Compiled with citeproc-hs 0.3.4, texmath 0.6.0.3, highlighting-kate 0.5.0.2.
Syntax highlighting is supported for the following languages:
    Actionscript, Ada, Alert, Alert_indent, Apache, Asn1, Asp, Awk, Bash,
    Bibtex, Boo, C, Changelog, Clojure, Cmake, Coffeescript, Coldfusion,
    Commonlisp, Cpp, Cs, Css, D, Diff, Djangotemplate, Doxygen, Dtd, Eiffel,
    Email, Erlang, Fortran, Fsharp, Gnuassembler, Go, Haskell, Haxe, Html, Ini,
    Java, Javadoc, Javascript, Json, Jsp, Latex, Lex, LiterateHaskell, Lua,
    Makefile, Mandoc, Matlab, Maxima, Metafont, Mips, Modula2, Modula3,
    Monobasic, Nasm, Noweb, Objectivec, Objectivecpp, Ocaml, Octave, Pascal,
    Perl, Php, Pike, Postscript, Prolog, Python, R, Relaxngcompact, Rhtml, Ruby,
    Scala, Scheme, Sci, Sed, Sgml, Sql, SqlMysql, SqlPostgresql, Tcl, Texinfo,
    Verilog, Vhdl, Xml, Xorg, Xslt, Xul, Yacc, Yaml
Copyright (C) 2006-2012 John MacFarlane
Web:  http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.  There is no
warranty, not even for merchantability or fitness for a particular purpose.

Reply to this email directly or view it on GitHub:
#443

@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Mar 10, 2012

Owner

I found the bug (a typo in the source that prevented pandoc
from correctly parsing lstlisting environments).

Unfortunately, pandoc won't be much help with this document.
It has only limited support for LaTeX tables and does not yet
support the tabularx environment. ALso, currently it applies LaTeX
macros only in math.

Owner

jgm commented Mar 10, 2012

I found the bug (a typo in the source that prevented pandoc
from correctly parsing lstlisting environments).

Unfortunately, pandoc won't be much help with this document.
It has only limited support for LaTeX tables and does not yet
support the tabularx environment. ALso, currently it applies LaTeX
macros only in math.

@jgm jgm closed this in a768844 Mar 10, 2012

@devn

This comment has been minimized.

Show comment
Hide comment
@devn

devn Mar 10, 2012

Without knowing a ton of Haskell (but knowing a bit about parsec), do you have a guess at whether this is a few hours of work, or a couple of days, a week to support tabularx?

What about handling other latex macros outside of math?

Thanks,

On Saturday, March 10, 2012 at 2:35 PM, John MacFarlane wrote:

I found the bug (a typo in the source that prevented pandoc
from correctly parsing lstlisting environments).

Unfortunately, pandoc won't be much help with this document.
It has only limited support for LaTeX tables and does not yet
support the tabularx environment. ALso, currently it applies LaTeX
macros only in math.


Reply to this email directly or view it on GitHub:
#443 (comment)

devn commented Mar 10, 2012

Without knowing a ton of Haskell (but knowing a bit about parsec), do you have a guess at whether this is a few hours of work, or a couple of days, a week to support tabularx?

What about handling other latex macros outside of math?

Thanks,

On Saturday, March 10, 2012 at 2:35 PM, John MacFarlane wrote:

I found the bug (a typo in the source that prevented pandoc
from correctly parsing lstlisting environments).

Unfortunately, pandoc won't be much help with this document.
It has only limited support for LaTeX tables and does not yet
support the tabularx environment. ALso, currently it applies LaTeX
macros only in math.


Reply to this email directly or view it on GitHub:
#443 (comment)

@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Mar 11, 2012

Owner

+++ Devin Walters [Mar 10 12 14:45 ]:

Without knowing a ton of Haskell (but knowing a bit about parsec), do you have a guess at whether this is a few hours of work, or a couple of days, a week to support tabularx?

To provide minimal support, so that tabularx is recognized as a table,
and treated 'X' just like 'l', would be ten minutes.

To provide better support for the 'X', one would have to deal with
column widths, and that's a much more complicated ball of wax.

What about handling other latex macros outside of math?

Right now I use the latex macro handling code from texmath.
It's possible that the same functions could be used for non-math
contexts, but I haven't looked into it.

Owner

jgm commented Mar 11, 2012

+++ Devin Walters [Mar 10 12 14:45 ]:

Without knowing a ton of Haskell (but knowing a bit about parsec), do you have a guess at whether this is a few hours of work, or a couple of days, a week to support tabularx?

To provide minimal support, so that tabularx is recognized as a table,
and treated 'X' just like 'l', would be ten minutes.

To provide better support for the 'X', one would have to deal with
column widths, and that's a much more complicated ball of wax.

What about handling other latex macros outside of math?

Right now I use the latex macro handling code from texmath.
It's possible that the same functions could be used for non-math
contexts, but I haven't looked into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment