public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* problem when converting from latex to markdown
@ 2012-04-02 19:25 Cesar Romani
  2012-04-02 21:54 ` Ryan Gray
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Cesar Romani @ 2012-04-02 19:25 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

What's wrong with the following latex code?

--------------------
\documentclass[10pt]{book}
\usepackage[utf8]{inputenc}

\renewcommand\maketitle{\begin{titlepage}%
   \enlargethispage{1in}
   \let\footnotesize\small
     \let\footnoterule\relax
     \parindent\z@
     \vspace*{-1in}
   \begin{center}%
     \vspace{\stretch{3}}
   {\Huge\noindent\textbf{\@title}\par}%
   \vspace{\stretch{1.5}}
   %{\Large\textbf{\@author}
   {\LARGE\textbf{\@author}\par}%
       \vspace{\stretch{2}}
       {\Large\@advisor\par}%
     \vspace{\stretch{4}}
     {\Large 2011}
     \vspace{\stretch{0.5}}
     \end{center}
     \end{titlepage}%
       \setcounter{footnote}{0}%
}

\begin{document}
Hola
\end{document}
--------------------

After running:
pandoc -o test.txt test.tex
I get:

--------------------
pandoc:
Error:
"source" (line 1, column 1):
unexpected '\\'
expecting "%", new-line, "begin", "}", "\\}", "\\{", "\\\\", "{", 
letter, "-", "``", "`", "'", "~", "$$", "$", "^", "_", "^^", "]", "#", 
"&" or end of input
--------------------

I don't have any clue what that means.

Many thanks in advance,

-- 
Cesar


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
  2012-04-02 19:25 problem when converting from latex to markdown Cesar Romani
@ 2012-04-02 21:54 ` Ryan Gray
       [not found]   ` <FA277859-6F03-4CE2-B5BD-D5E1B5D567D5-BUHhN+a2lJ4@public.gmane.org>
  2012-04-02 22:41 ` Joost Kremers
  2012-04-03 15:25 ` Tillmann Rendel
  2 siblings, 1 reply; 10+ messages in thread
From: Ryan Gray @ 2012-04-02 21:54 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On Apr 2, 2012, at 1:25 PM, Cesar Romani <cesar.romani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> What's wrong with the following latex code?
> 
> --------------------
> \documentclass[10pt]{book}
> \usepackage[utf8]{inputenc}
> 
> \renewcommand\maketitle{\begin{titlepage}%
>  \enlargethispage{1in}
>  \let\footnotesize\small
>    \let\footnoterule\relax
>    \parindent\z@
>    \vspace*{-1in}
>  \begin{center}%
>    \vspace{\stretch{3}}
>  {\Huge\noindent\textbf{\@title}\par}%
>  \vspace{\stretch{1.5}}
>  %{\Large\textbf{\@author}
>  {\LARGE\textbf{\@author}\par}%
>      \vspace{\stretch{2}}
>      {\Large\@advisor\par}%
>    \vspace{\stretch{4}}
>    {\Large 2011}
>    \vspace{\stretch{0.5}}
>    \end{center}
>    \end{titlepage}%
>      \setcounter{footnote}{0}%
> }
> 
> \begin{document}
> Hola
> \end{document}
> --------------------
> 
> After running:
> pandoc -o test.txt test.tex
> I get:
> 
> --------------------
> pandoc:
> Error:
> "source" (line 1, column 1):
> unexpected '\\'
> expecting "%", new-line, "begin", "}", "\\}", "\\{", "\\\\", "{", letter, "-", "``", "`", "'", "~", "$$", "$", "^", "_", "^^", "]", "#", "&" or end of input
> --------------------
> 
> I don't have any clue what that means.

I had a similar problem with \vspace a while back. It failed if it was at the end of a line without a blank line following. Pandoc 1.9.1.1 fixed that particular problem for me. 

Ryan


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
       [not found]   ` <FA277859-6F03-4CE2-B5BD-D5E1B5D567D5-BUHhN+a2lJ4@public.gmane.org>
@ 2012-04-02 22:32     ` Cesar Romani
  0 siblings, 0 replies; 10+ messages in thread
From: Cesar Romani @ 2012-04-02 22:32 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 02/04/2012 04:54 p.m., Ryan Gray wrote:
 > On Apr 2, 2012, at 1:25 PM, Cesar 
Romani<cesar.romani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>  wrote:
 >
 >> What's wrong with the following latex code?
 >>
 >> --------------------
 >> \documentclass[10pt]{book}
 >> \usepackage[utf8]{inputenc}
 >>
 >> \renewcommand\maketitle{\begin{titlepage}%
 >>   \enlargethispage{1in}
 >>   \let\footnotesize\small
 >>     \let\footnoterule\relax
 >>     \parindent\z@
 >>     \vspace*{-1in}
 >>   \begin{center}%
 >>     \vspace{\stretch{3}}
 >>   {\Huge\noindent\textbf{\@title}\par}%
 >>   \vspace{\stretch{1.5}}
 >>   %{\Large\textbf{\@author}
 >>   {\LARGE\textbf{\@author}\par}%
 >>       \vspace{\stretch{2}}
 >>       {\Large\@advisor\par}%
 >>     \vspace{\stretch{4}}
 >>     {\Large 2011}
 >>     \vspace{\stretch{0.5}}
 >>     \end{center}
 >>     \end{titlepage}%
 >>       \setcounter{footnote}{0}%
 >> }
 >>
 >> \begin{document}
 >> Hola
 >> \end{document}
 >> --------------------
 >>
 >> After running:
 >> pandoc -o test.txt test.tex
 >> I get:
 >>
 >> --------------------
 >> pandoc:
 >> Error:
 >> "source" (line 1, column 1):
 >> unexpected '\\'
 >> expecting "%", new-line, "begin", "}", "\\}", "\\{", "\\\\", "{", 
letter, "-", "``", "`", "'", "~", "$$", "$", "^", "_", "^^", "]", "#", 
"&" or end of input
 >> --------------------
 >>
 >> I don't have any clue what that means.
 >
 > I had a similar problem with \vspace a while back. It failed if it was
 > at the end of a line without a blank line following. Pandoc 1.9.1.1
 > fixed that particular problem for me.

I'm using pandoc 1.9.2 on Windows 7.

Regards,

-- 
Cesar


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
  2012-04-02 19:25 problem when converting from latex to markdown Cesar Romani
  2012-04-02 21:54 ` Ryan Gray
@ 2012-04-02 22:41 ` Joost Kremers
  2012-04-03 15:25 ` Tillmann Rendel
  2 siblings, 0 replies; 10+ messages in thread
From: Joost Kremers @ 2012-04-02 22:41 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On Mon, Apr 02, 2012 at 02:25:59PM -0500, Cesar Romani wrote:
> What's wrong with the following latex code?

Well, LaTeX doesn't choke on it, so it's probably fine.

[...]
> After running:
> pandoc -o test.txt test.tex
> I get:
> 
> --------------------
> pandoc:
> Error:
> "source" (line 1, column 1):

Pandoc is telling you here that the error is on the first line and the
first character.

> unexpected '\\'

It sees a backslash (I'm assuming it's being escaped here)...

> expecting "%", new-line, "begin", "}", "\\}", "\\{", "\\\\", "{",
> letter, "-", "``", "`", "'", "~", "$$", "$", "^", "_", "^^", "]",
> "#", "&" or end of input
> --------------------

...though it's expecting one of the above.

My first idea was that Pandoc wasn't expecting LaTeX input (I don't know if
Pandoc deduces the input format from the ending), but doing 

pandoc -r latex -o text.txt test.tex

produces the same error. So this looks like a bug to me. It's weird,
though, that the presence of the \newcommand on line three should trigger a
bug on line 1...

Anyways, I'm using Pandoc on Linux and I get the same problem.

-- 
Joost Kremers
Life has its moments


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
  2012-04-02 19:25 problem when converting from latex to markdown Cesar Romani
  2012-04-02 21:54 ` Ryan Gray
  2012-04-02 22:41 ` Joost Kremers
@ 2012-04-03 15:25 ` Tillmann Rendel
       [not found]   ` <4F7B164C.4030007-jNDFPZUTrfTbB13WlS47k8u21/r88PR+s0AfqQuZ5sE@public.gmane.org>
  2 siblings, 1 reply; 10+ messages in thread
From: Tillmann Rendel @ 2012-04-03 15:25 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Hi,

Cesar Romani wrote:
> What's wrong with the following latex code?
>
> --------------------
> \documentclass[10pt]{book}
> \usepackage[utf8]{inputenc}
>
> \renewcommand\maketitle{\begin{titlepage}%

pandoc seems to be confused because you don't use braces around 
\maketitle. The following works for me:

     \renewcommand{\maketitle}{\begin{titlepage}%

Tillmann


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
       [not found]   ` <4F7B164C.4030007-jNDFPZUTrfTbB13WlS47k8u21/r88PR+s0AfqQuZ5sE@public.gmane.org>
@ 2012-04-03 23:35     ` Cesar Romani
  2012-04-04  1:32       ` Chris Lott
  2012-04-04  2:24     ` John MacFarlane
  1 sibling, 1 reply; 10+ messages in thread
From: Cesar Romani @ 2012-04-03 23:35 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 03/04/2012 10:25 a.m., Tillmann Rendel wrote:
 > Hi,
 >
 > Cesar Romani wrote:
 >> What's wrong with the following latex code?
 >>
 >> --------------------
 >> \documentclass[10pt]{book}
 >> \usepackage[utf8]{inputenc}
 >>
 >> \renewcommand\maketitle{\begin{titlepage}%
 >
 > pandoc seems to be confused because you don't use braces around
 > \maketitle. The following works for me:
 >
 > \renewcommand{\maketitle}{\begin{titlepage}%

You don't need to put braces around \maketitle. If I delete the line
beginning with %, it works and you don't have braces around \maketitle.

Regards,

-- 
Cesar


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
  2012-04-03 23:35     ` Cesar Romani
@ 2012-04-04  1:32       ` Chris Lott
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Lott @ 2012-04-04  1:32 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On Tue, Apr 3, 2012 at 3:35 PM, Cesar Romani <cesar.romani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> You don't need to put braces around \maketitle. If I delete the line
> beginning with %, it works and you don't have braces around \maketitle.

What line beginning with a %? And if the code shared with you works,
are you now just asking a theoretical question?

c
--
Chris Lott <chris-qMDBG1KJBpwBXFe83j6qeQ@public.gmane.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
       [not found]   ` <4F7B164C.4030007-jNDFPZUTrfTbB13WlS47k8u21/r88PR+s0AfqQuZ5sE@public.gmane.org>
  2012-04-03 23:35     ` Cesar Romani
@ 2012-04-04  2:24     ` John MacFarlane
       [not found]       ` <20120404022447.GA17166-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
  1 sibling, 1 reply; 10+ messages in thread
From: John MacFarlane @ 2012-04-04  2:24 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Tillmann Rendel [Apr 03 12 17:25 ]:
> Hi,
> 
> Cesar Romani wrote:
> >What's wrong with the following latex code?
> >
> >--------------------
> >\documentclass[10pt]{book}
> >\usepackage[utf8]{inputenc}
> >
> >\renewcommand\maketitle{\begin{titlepage}%
> 
> pandoc seems to be confused because you don't use braces around
> \maketitle. The following works for me:
> 
>     \renewcommand{\maketitle}{\begin{titlepage}%

I've uploaded a new version of texmath that can parse the
original \renewcommand.  If you recompile pandoc against the
latest texmath from HackageDB, you shouldn't need the braces.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
       [not found]       ` <20120404022447.GA17166-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
@ 2012-04-04  3:57         ` Cesar Romani
  2012-04-04 16:42           ` John MacFarlane
  0 siblings, 1 reply; 10+ messages in thread
From: Cesar Romani @ 2012-04-04  3:57 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 03/04/2012 09:24 p.m., John MacFarlane wrote:
 > +++ Tillmann Rendel [Apr 03 12 17:25 ]:
 >> Hi,
 >>
 >> Cesar Romani wrote:
 >>> What's wrong with the following latex code?
 >>>
 >>> --------------------
 >>> \documentclass[10pt]{book}
 >>> \usepackage[utf8]{inputenc}
 >>>
 >>> \renewcommand\maketitle{\begin{titlepage}%
 >>
 >> pandoc seems to be confused because you don't use braces around
 >> \maketitle. The following works for me:
 >>
 >>      \renewcommand{\maketitle}{\begin{titlepage}%
 >
 > I've uploaded a new version of texmath that can parse the
 > original \renewcommand.  If you recompile pandoc against the
 > latest texmath from HackageDB, you shouldn't need the braces.

I've downloaded the last version of texmath. How do I recompile pandoc
against it?

Regards,

-- 
Cesar


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: problem when converting from latex to markdown
  2012-04-04  3:57         ` Cesar Romani
@ 2012-04-04 16:42           ` John MacFarlane
  0 siblings, 0 replies; 10+ messages in thread
From: John MacFarlane @ 2012-04-04 16:42 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Cesar Romani [Apr 03 12 22:57 ]:
> On 03/04/2012 09:24 p.m., John MacFarlane wrote:
> > +++ Tillmann Rendel [Apr 03 12 17:25 ]:
> >> Hi,
> >>
> >> Cesar Romani wrote:
> >>> What's wrong with the following latex code?
> >>>
> >>> --------------------
> >>> \documentclass[10pt]{book}
> >>> \usepackage[utf8]{inputenc}
> >>>
> >>> \renewcommand\maketitle{\begin{titlepage}%
> >>
> >> pandoc seems to be confused because you don't use braces around
> >> \maketitle. The following works for me:
> >>
> >>      \renewcommand{\maketitle}{\begin{titlepage}%
> >
> > I've uploaded a new version of texmath that can parse the
> > original \renewcommand.  If you recompile pandoc against the
> > latest texmath from HackageDB, you shouldn't need the braces.
> 
> I've downloaded the last version of texmath. How do I recompile pandoc
> against it?

cabal update && cabal install --reinstall texmath && cabal install --reinstall pandoc


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-04-04 16:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 19:25 problem when converting from latex to markdown Cesar Romani
2012-04-02 21:54 ` Ryan Gray
     [not found]   ` <FA277859-6F03-4CE2-B5BD-D5E1B5D567D5-BUHhN+a2lJ4@public.gmane.org>
2012-04-02 22:32     ` Cesar Romani
2012-04-02 22:41 ` Joost Kremers
2012-04-03 15:25 ` Tillmann Rendel
     [not found]   ` <4F7B164C.4030007-jNDFPZUTrfTbB13WlS47k8u21/r88PR+s0AfqQuZ5sE@public.gmane.org>
2012-04-03 23:35     ` Cesar Romani
2012-04-04  1:32       ` Chris Lott
2012-04-04  2:24     ` John MacFarlane
     [not found]       ` <20120404022447.GA17166-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
2012-04-04  3:57         ` Cesar Romani
2012-04-04 16:42           ` John MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).