public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
@ 2019-02-21  8:24 mdoubleur-Re5JQEeQqe8AvxtiuMwx3w
       [not found] ` <29060740-9129-4c16-87aa-52e155e626db-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: mdoubleur-Re5JQEeQqe8AvxtiuMwx3w @ 2019-02-21  8:24 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1324 bytes --]

Hi everyone,

Currently im trying to convert an Lyx-Document to MS Word for my 
Supervisor, cause he would like to comment directly in the document. 
Installed pandoc, reconfigurated, so far so good.

But when I try to export OPenDocument or MSWord via Pandoc, the following 
error massage occurs:

09:11:26.979: Exportiere ... 

09:11:27.537: pandoc -s -f latex -o "Document.odt" -t odt "Documenttex"

09:11:27.747: 

09:11:27.747: Error at "source" (line 949, column 12):

09:11:27.747: expecting \end{document}

09:11:27.747: \end{table}

09:11:27.757: ^

D:\LyXGit\LyX22\src\support\Systemcall.cpp (291): Systemcall: 'pandoc -s -f 
latex -o "Document.odt" -t odt "Document.tex"' finished with exit code 65


Thanks in advance and best regrads, max

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/29060740-9129-4c16-87aa-52e155e626db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2995 bytes --]

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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found] ` <29060740-9129-4c16-87aa-52e155e626db-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-02-21  8:46   ` Christophe Demko
  2019-02-22 21:24   ` John MacFarlane
  1 sibling, 0 replies; 14+ messages in thread
From: Christophe Demko @ 2019-02-21  8:46 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1561 bytes --]

It seems there is an error in your LaTeX file.

Le jeudi 21 février 2019 09:24:10 UTC+1, mdou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a écrit :
>
> Hi everyone,
>
> Currently im trying to convert an Lyx-Document to MS Word for my 
> Supervisor, cause he would like to comment directly in the document. 
> Installed pandoc, reconfigurated, so far so good.
>
> But when I try to export OPenDocument or MSWord via Pandoc, the following 
> error massage occurs:
>
> 09:11:26.979: Exportiere ... 
>
> 09:11:27.537: pandoc -s -f latex -o "Document.odt" -t odt "Documenttex"
>
> 09:11:27.747: 
>
> 09:11:27.747: Error at "source" (line 949, column 12):
>
> 09:11:27.747: expecting \end{document}
>
> 09:11:27.747: \end{table}
>
> 09:11:27.757: ^
>
> D:\LyXGit\LyX22\src\support\Systemcall.cpp (291): Systemcall: 'pandoc -s 
> -f latex -o "Document.odt" -t odt "Document.tex"' finished with exit code 65
>
>
> Thanks in advance and best regrads, max
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/92c5dd48-97c8-4aa8-a651-7178461ed2a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3071 bytes --]

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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found] ` <29060740-9129-4c16-87aa-52e155e626db-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2019-02-21  8:46   ` Christophe Demko
@ 2019-02-22 21:24   ` John MacFarlane
       [not found]     ` <m2k1hrjz3t.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  1 sibling, 1 reply; 14+ messages in thread
From: John MacFarlane @ 2019-02-22 21:24 UTC (permalink / raw)
  To: mdoubleur-Re5JQEeQqe8AvxtiuMwx3w, pandoc-discuss


Pandoc sometimes chokes on valid LaTeX, especially
when packages it doesn't know are used.  It would be
helpful if you could whittle down your example to the
minimum necessary to reproduce the problem, then post it.


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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]     ` <m2k1hrjz3t.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-07-16 18:09       ` Osvaldo Espin-Garcia
       [not found]         ` <44265dc6-6b8f-4c37-9316-d0706f2caacf-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Osvaldo Espin-Garcia @ 2019-07-16 18:09 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1540 bytes --]

Hello everyone,

Not sure if this has been revised more recently. However, I am running into 
a similar issue myself. Previous versions of pandoc seemed to work just 
fine, however, I found this issue with version 2.7.3

Error at "source" (line 68, column 67):
unexpected end of input
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
                                                                  ^
pandoc -o min_reproducible_example.docx min_reproducible_example.tex --default-image-extension=png' execution failed with error code 65


I'm attaching file "min_reproducible_example.tex"

Any insight into this would be appreciated.

On Friday, 22 February 2019 16:24:38 UTC-5, John MacFarlane wrote:
>
>
> Pandoc sometimes chokes on valid LaTeX, especially 
> when packages it doesn't know are used.  It would be 
> helpful if you could whittle down your example to the 
> minimum necessary to reproduce the problem, then post it. 
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/44265dc6-6b8f-4c37-9316-d0706f2caacf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3119 bytes --]

[-- Attachment #2: min_reproducible_example.tex --]
[-- Type: text/x-tex, Size: 2350 bytes --]

\documentclass{article}\usepackage[]{graphicx}\usepackage[]{color}
% maxwidth is the original width if it is less than linewidth
% otherwise use linewidth (to make sure the graphics do not exceed the margin)
\makeatletter
\def\maxwidth{ %
  \ifdim\Gin@nat@width>\linewidth
    \linewidth
  \else
    \Gin@nat@width
  \fi
}
\makeatother

\definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%
\newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%
\newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%
\newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%
\newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%
\newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%
\newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%
\newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%
\let\hlipl\hlkwb

\usepackage{framed}
\makeatletter
\newenvironment{kframe}{%
 \def\at@end@of@kframe{}%
 \ifinner\ifhmode%
  \def\at@end@of@kframe{\end{minipage}}%
  \begin{minipage}{\columnwidth}%
 \fi\fi%
 \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
 \colorbox{shadecolor}{##1}\hskip-\fboxsep
     % There is no \\@totalrightmargin, so:
     \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
 \MakeFramed {\advance\hsize-\width
   \@totalleftmargin\z@ \linewidth\hsize
   \@setminipage}}%
 {\par\unskip\endMakeFramed%
 \at@end@of@kframe}
\makeatother

\definecolor{shadecolor}{rgb}{.97, .97, .97}
\definecolor{messagecolor}{rgb}{0, 0, 0}
\definecolor{warningcolor}{rgb}{1, 0, 1}
\definecolor{errorcolor}{rgb}{1, 0, 0}
\newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX

\usepackage{alltt}
\usepackage{multirow}
\setlength\parindent{0pt}
\usepackage{geometry}
\usepackage{longtable}
\usepackage{float}
\usepackage{verbatim}
\usepackage{hyperref}
\geometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm}

\title{Docx from tex file example}
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\begin{document}

\maketitle

\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlkwd{library}\hlstd{(survival)}
\end{alltt}
\end{kframe}
\end{knitrout}

\end{document}

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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]         ` <44265dc6-6b8f-4c37-9316-d0706f2caacf-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-07-16 19:08           ` John MacFarlane
       [not found]             ` <yh480kpnm9ajb7.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: John MacFarlane @ 2019-07-16 19:08 UTC (permalink / raw)
  To: Osvaldo Espin-Garcia, pandoc-discuss


Looks like pandoc is getting mixed up by the definition of the
kframe environment, which is not surprising because it uses
tex primitives.  If you redefine this to something simpler,
pandoc will succeed.

Here's a more minimal example:

\makeatletter
\newenvironment{kframe}{%
 \def\at@end@of@kframe{}%
 \ifinner\ifhmode%
  \def\at@end@of@kframe{\end{minipage}}%
  \begin{minipage}{\columnwidth}%
 \fi\fi%
 \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
 \colorbox{shadecolor}{##1}\hskip-\fboxsep
     % There is no \\@totalrightmargin, so:
     \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
 \MakeFramed {\advance\hsize-\width
   \@totalleftmargin\z@ \linewidth\hsize
   \@setminipage}}%
 {\par\unskip\endMakeFramed%
 \at@end@of@kframe}
\makeatother

\begin{kframe}
hi
\end{kframe}

Paradoxically, as pandoc gets better at reading LaTeX, it starts
to fail on things it just skipped blindly before.

Osvaldo Espin-Garcia <osv.espin.ga2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello everyone,
>
> Not sure if this has been revised more recently. However, I am running into 
> a similar issue myself. Previous versions of pandoc seemed to work just 
> fine, however, I found this issue with version 2.7.3
>
> Error at "source" (line 68, column 67):
> unexpected end of input
> \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
>                                                                   ^
> pandoc -o min_reproducible_example.docx min_reproducible_example.tex --default-image-extension=png' execution failed with error code 65
>
>
> I'm attaching file "min_reproducible_example.tex"
>
> Any insight into this would be appreciated.
>
> On Friday, 22 February 2019 16:24:38 UTC-5, John MacFarlane wrote:
>>
>>
>> Pandoc sometimes chokes on valid LaTeX, especially 
>> when packages it doesn't know are used.  It would be 
>> helpful if you could whittle down your example to the 
>> minimum necessary to reproduce the problem, then post it. 
>>
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/44265dc6-6b8f-4c37-9316-d0706f2caacf%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> \documentclass{article}\usepackage[]{graphicx}\usepackage[]{color}
> % maxwidth is the original width if it is less than linewidth
> % otherwise use linewidth (to make sure the graphics do not exceed the margin)
> \makeatletter
> \def\maxwidth{ %
>   \ifdim\Gin@nat@width>\linewidth
>     \linewidth
>   \else
>     \Gin@nat@width
>   \fi
> }
> \makeatother
>
> \definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}
> \newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%
> \newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%
> \newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%
> \newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%
> \newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%
> \newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%
> \newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%
> \newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%
> \newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%
> \let\hlipl\hlkwb
>
> \usepackage{framed}
> \makeatletter
> \newenvironment{kframe}{%
>  \def\at@end@of@kframe{}%
>  \ifinner\ifhmode%
>   \def\at@end@of@kframe{\end{minipage}}%
>   \begin{minipage}{\columnwidth}%
>  \fi\fi%
>  \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
>  \colorbox{shadecolor}{##1}\hskip-\fboxsep
>      % There is no \\@totalrightmargin, so:
>      \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
>  \MakeFramed {\advance\hsize-\width
>    \@totalleftmargin\z@ \linewidth\hsize
>    \@setminipage}}%
>  {\par\unskip\endMakeFramed%
>  \at@end@of@kframe}
> \makeatother
>
> \definecolor{shadecolor}{rgb}{.97, .97, .97}
> \definecolor{messagecolor}{rgb}{0, 0, 0}
> \definecolor{warningcolor}{rgb}{1, 0, 1}
> \definecolor{errorcolor}{rgb}{1, 0, 0}
> \newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX
>
> \usepackage{alltt}
> \usepackage{multirow}
> \setlength\parindent{0pt}
> \usepackage{geometry}
> \usepackage{longtable}
> \usepackage{float}
> \usepackage{verbatim}
> \usepackage{hyperref}
> \geometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm}
>
> \title{Docx from tex file example}
> \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
> \begin{document}
>
> \maketitle
>
> \begin{knitrout}
> \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
> \begin{alltt}
> \hlkwd{library}\hlstd{(survival)}
> \end{alltt}
> \end{kframe}
> \end{knitrout}
>
> \end{document}


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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]             ` <yh480kpnm9ajb7.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-07-16 19:23               ` Osvaldo Espin-Garcia
       [not found]                 ` <909b8424-da31-44e8-a12d-933d1a755f88-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Osvaldo Espin-Garcia @ 2019-07-16 19:23 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1985 bytes --]

Thanks John for the quick reply.

Unfortunately, I did not define the kframe environment myself. In fact, 
this comes directly from knitr, an R package used to generate reports. 

From your end you think this is not a bug from pandoc but rather the kframe 
environment needs to be redefined somehow?

I appreciate your help.


On Tuesday, 16 July 2019 15:08:58 UTC-4, John MacFarlane wrote:
>
>
> Looks like pandoc is getting mixed up by the definition of the 
> kframe environment, which is not surprising because it uses 
> tex primitives.  If you redefine this to something simpler, 
> pandoc will succeed. 
>
> Here's a more minimal example: 
>
> \makeatletter 
> \newenvironment{kframe}{% 
>  \def\at@end@of@kframe{}% 
>  \ifinner\ifhmode% 
>   \def\at@end@of@kframe{\end{minipage}}% 
>   \begin{minipage}{\columnwidth}% 
>  \fi\fi% 
>  \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep 
>  \colorbox{shadecolor}{##1}\hskip-\fboxsep 
>      % There is no \\@totalrightmargin, so: 
>      \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}% 
>  \MakeFramed {\advance\hsize-\width 
>    \@totalleftmargin\z@ \linewidth\hsize 
>    \@setminipage}}% 
>  {\par\unskip\endMakeFramed% 
>  \at@end@of@kframe} 
> \makeatother 
>
> \begin{kframe} 
> hi 
> \end{kframe} 
>
> Paradoxically, as pandoc gets better at reading LaTeX, it starts 
> to fail on things it just skipped blindly before. 
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/909b8424-da31-44e8-a12d-933d1a755f88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2743 bytes --]

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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]                 ` <909b8424-da31-44e8-a12d-933d1a755f88-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-07-16 23:04                   ` John MacFarlane
       [not found]                     ` <yh480kzhld8ttw.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: John MacFarlane @ 2019-07-16 23:04 UTC (permalink / raw)
  To: Osvaldo Espin-Garcia, pandoc-discuss


Let's say it's a limitation of pandoc.  Pandoc does pretty well
at parsing tex, but not as well as latex itself.  You can
redefine kframe to something simple just prior to conversion,
that's a possible workaround.


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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]                     ` <yh480kzhld8ttw.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-07-16 23:54                       ` Osvaldo Espin-Garcia
       [not found]                         ` <CAOduqXOLTU+swzHKnj84QOr8BiyazOpwCYHEKx+Jh9PR4+CL3w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Osvaldo Espin-Garcia @ 2019-07-16 23:54 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

Thanks so much John!

I guess that without knowing pandoc's source code I have a hard time
getting my head around that previous versions worked with this just fine.

I'd appreciate any insight you may have on how to redefine the kframe
environment. Otherwise, I'll contact the folks at knitr to see if they have
any comments from their end.

Best,

On Tue., Jul. 16, 2019, 19:04 John MacFarlane, <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

>
> Let's say it's a limitation of pandoc.  Pandoc does pretty well
> at parsing tex, but not as well as latex itself.  You can
> redefine kframe to something simple just prior to conversion,
> that's a possible workaround.
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAOduqXOLTU%2BswzHKnj84QOr8BiyazOpwCYHEKx%2BJh9PR4%2BCL3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 2141 bytes --]

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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]                         ` <CAOduqXOLTU+swzHKnj84QOr8BiyazOpwCYHEKx+Jh9PR4+CL3w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-07-17 17:32                           ` John MacFarlane
       [not found]                             ` <m28ssw4ldy.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: John MacFarlane @ 2019-07-17 17:32 UTC (permalink / raw)
  To: Osvaldo Espin-Garcia; +Cc: pandoc-discuss


I'm not suggesting that knitr change the definition.

The idea was that you could change it in your document,
just prior to converting, to work around this limitation.

\renewenvironment{krame}{}{}

would be a simple definition that would just pass through
the contents.

Osvaldo Espin-Garcia <osv.espin.ga2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Thanks so much John!
>
> I guess that without knowing pandoc's source code I have a hard time
> getting my head around that previous versions worked with this just fine.
>
> I'd appreciate any insight you may have on how to redefine the kframe
> environment. Otherwise, I'll contact the folks at knitr to see if they have
> any comments from their end.
>
> Best,
>
> On Tue., Jul. 16, 2019, 19:04 John MacFarlane, <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
>
>>
>> Let's say it's a limitation of pandoc.  Pandoc does pretty well
>> at parsing tex, but not as well as latex itself.  You can
>> redefine kframe to something simple just prior to conversion,
>> that's a possible workaround.
>>


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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]                             ` <m28ssw4ldy.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-07-17 19:34                               ` Osvaldo Espin-Garcia
       [not found]                                 ` <110f68bf-c82c-490c-ad3b-3b44ef536764-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Osvaldo Espin-Garcia @ 2019-07-17 19:34 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2483 bytes --]


Maybe I did not explain this issue enough. The tex file I'm working with 
comes as an output from an .Rnw file that I generate by using knitr and 
Rstudio. This .tex file of course produces a pdf without any issue. After 
that, I call pandoc on the very same .tex file to produce a .docx file, 
which is what I ultimately want. I do this for several reports that all 
start in R (via an .Rnw file) and culminate with a .docx file. 

Ideally, I would still like this workflow to work on the new versions of 
pandoc. I can try implementing the workaround you suggest by maybe 
replacing the kframe environment 'on the fly' in the .tex file to avoid the 
error. 

On Wednesday, 17 July 2019 13:32:58 UTC-4, John MacFarlane wrote:
>
>
> I'm not suggesting that knitr change the definition. 
>
> The idea was that you could change it in your document, 
> just prior to converting, to work around this limitation. 
>
> \renewenvironment{krame}{}{} 
>
> would be a simple definition that would just pass through 
> the contents. 
>
> Osvaldo Espin-Garcia <osv.e...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>
> > Thanks so much John! 
> > 
> > I guess that without knowing pandoc's source code I have a hard time 
> > getting my head around that previous versions worked with this just 
> fine. 
> > 
> > I'd appreciate any insight you may have on how to redefine the kframe 
> > environment. Otherwise, I'll contact the folks at knitr to see if they 
> have 
> > any comments from their end. 
> > 
> > Best, 
> > 
> > On Tue., Jul. 16, 2019, 19:04 John MacFarlane, <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org 
> <javascript:>> wrote: 
> > 
> >> 
> >> Let's say it's a limitation of pandoc.  Pandoc does pretty well 
> >> at parsing tex, but not as well as latex itself.  You can 
> >> redefine kframe to something simple just prior to conversion, 
> >> that's a possible workaround. 
> >> 
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/110f68bf-c82c-490c-ad3b-3b44ef536764%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3656 bytes --]

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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]                                 ` <110f68bf-c82c-490c-ad3b-3b44ef536764-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-07-17 20:00                                   ` John MacFarlane
       [not found]                                     ` <yh480k7e8go2ia.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: John MacFarlane @ 2019-07-17 20:00 UTC (permalink / raw)
  To: Osvaldo Espin-Garcia, pandoc-discuss


Yes, I understood that.  I'm telling you a workaround that will
work with this procedure.  Actually, if you add the
renewenvironment I suggested using --include-in-header,
it may work without any further manual intervention.

Osvaldo Espin-Garcia <osv.espin.ga2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Maybe I did not explain this issue enough. The tex file I'm working with 
> comes as an output from an .Rnw file that I generate by using knitr and 
> Rstudio. This .tex file of course produces a pdf without any issue. After 
> that, I call pandoc on the very same .tex file to produce a .docx file, 
> which is what I ultimately want. I do this for several reports that all 
> start in R (via an .Rnw file) and culminate with a .docx file. 
>
> Ideally, I would still like this workflow to work on the new versions of 
> pandoc. I can try implementing the workaround you suggest by maybe 
> replacing the kframe environment 'on the fly' in the .tex file to avoid the 
> error. 
>
> On Wednesday, 17 July 2019 13:32:58 UTC-4, John MacFarlane wrote:
>>
>>
>> I'm not suggesting that knitr change the definition. 
>>
>> The idea was that you could change it in your document, 
>> just prior to converting, to work around this limitation. 
>>
>> \renewenvironment{krame}{}{} 
>>
>> would be a simple definition that would just pass through 
>> the contents. 
>>
>> Osvaldo Espin-Garcia <osv.e...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>>
>> > Thanks so much John! 
>> > 
>> > I guess that without knowing pandoc's source code I have a hard time 
>> > getting my head around that previous versions worked with this just 
>> fine. 
>> > 
>> > I'd appreciate any insight you may have on how to redefine the kframe 
>> > environment. Otherwise, I'll contact the folks at knitr to see if they 
>> have 
>> > any comments from their end. 
>> > 
>> > Best, 
>> > 
>> > On Tue., Jul. 16, 2019, 19:04 John MacFarlane, <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org 
>> <javascript:>> wrote: 
>> > 
>> >> 
>> >> Let's say it's a limitation of pandoc.  Pandoc does pretty well 
>> >> at parsing tex, but not as well as latex itself.  You can 
>> >> redefine kframe to something simple just prior to conversion, 
>> >> that's a possible workaround. 
>> >> 
>>
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/110f68bf-c82c-490c-ad3b-3b44ef536764%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]                                     ` <yh480k7e8go2ia.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-07-17 22:20                                       ` Osvaldo Espin-Garcia
       [not found]                                         ` <0a232179-18ea-4083-a5e9-90117aa438d5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Osvaldo Espin-Garcia @ 2019-07-17 22:20 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1246 bytes --]


After some trying the workaround works perfectly if added directly to the 
.tex file. However, I was no table to get it working with the 
--include-in-header option. I even tried --include-before-body, which also 
seemed to work if added directly to the file. 

Is there a way I can see what this option is doing to the original file to 
catch a potential error?

On Wednesday, 17 July 2019 16:00:30 UTC-4, John MacFarlane wrote:
>
>
> Yes, I understood that.  I'm telling you a workaround that will 
> work with this procedure.  Actually, if you add the 
> renewenvironment I suggested using --include-in-header, 
> it may work without any further manual intervention. 
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0a232179-18ea-4083-a5e9-90117aa438d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 1857 bytes --]

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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]                                         ` <0a232179-18ea-4083-a5e9-90117aa438d5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-07-17 22:27                                           ` John MacFarlane
       [not found]                                             ` <yh480kwoggmh3w.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: John MacFarlane @ 2019-07-17 22:27 UTC (permalink / raw)
  To: Osvaldo Espin-Garcia, pandoc-discuss


My bad, --include-in-header only affects writing, and you
need to affect parsing, so this won't work.

Osvaldo Espin-Garcia <osv.espin.ga2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> After some trying the workaround works perfectly if added directly to the 
> .tex file. However, I was no table to get it working with the 
> --include-in-header option. I even tried --include-before-body, which also 
> seemed to work if added directly to the file. 
>
> Is there a way I can see what this option is doing to the original file to 
> catch a potential error?
>
> On Wednesday, 17 July 2019 16:00:30 UTC-4, John MacFarlane wrote:
>>
>>
>> Yes, I understood that.  I'm telling you a workaround that will 
>> work with this procedure.  Actually, if you add the 
>> renewenvironment I suggested using --include-in-header, 
>> it may work without any further manual intervention. 
>>
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0a232179-18ea-4083-a5e9-90117aa438d5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


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

* Re: Tryin to convert tex file to MS Word .docx using Pandoc - Error 65
       [not found]                                             ` <yh480kwoggmh3w.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-07-17 22:55                                               ` Osvaldo Espin-Garcia
  0 siblings, 0 replies; 14+ messages in thread
From: Osvaldo Espin-Garcia @ 2019-07-17 22:55 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1061 bytes --]

Got it. Well, I think I have a fix now.

Before calling pandoc in R (via a function I have), I am replacing 
"\\begin{document}" with 
""\\renewenvironment{kframe}{}{}\\begin{document}"" using function gsub. It 
is not the most elegant solution, but it does the trick.

Thanks so much for all your help!

On Wednesday, 17 July 2019 18:28:05 UTC-4, John MacFarlane wrote:
>
>
> My bad, --include-in-header only affects writing, and you 
> need to affect parsing, so this won't work. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/96ec677e-0950-42e4-a1af-679e875836bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 1709 bytes --]

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

end of thread, other threads:[~2019-07-17 22:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21  8:24 Tryin to convert tex file to MS Word .docx using Pandoc - Error 65 mdoubleur-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <29060740-9129-4c16-87aa-52e155e626db-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-02-21  8:46   ` Christophe Demko
2019-02-22 21:24   ` John MacFarlane
     [not found]     ` <m2k1hrjz3t.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-07-16 18:09       ` Osvaldo Espin-Garcia
     [not found]         ` <44265dc6-6b8f-4c37-9316-d0706f2caacf-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-07-16 19:08           ` John MacFarlane
     [not found]             ` <yh480kpnm9ajb7.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-07-16 19:23               ` Osvaldo Espin-Garcia
     [not found]                 ` <909b8424-da31-44e8-a12d-933d1a755f88-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-07-16 23:04                   ` John MacFarlane
     [not found]                     ` <yh480kzhld8ttw.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-07-16 23:54                       ` Osvaldo Espin-Garcia
     [not found]                         ` <CAOduqXOLTU+swzHKnj84QOr8BiyazOpwCYHEKx+Jh9PR4+CL3w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-07-17 17:32                           ` John MacFarlane
     [not found]                             ` <m28ssw4ldy.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-07-17 19:34                               ` Osvaldo Espin-Garcia
     [not found]                                 ` <110f68bf-c82c-490c-ad3b-3b44ef536764-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-07-17 20:00                                   ` John MacFarlane
     [not found]                                     ` <yh480k7e8go2ia.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-07-17 22:20                                       ` Osvaldo Espin-Garcia
     [not found]                                         ` <0a232179-18ea-4083-a5e9-90117aa438d5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-07-17 22:27                                           ` John MacFarlane
     [not found]                                             ` <yh480kwoggmh3w.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-07-17 22:55                                               ` Osvaldo Espin-Garcia

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).