emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug in export orgtbl / LaTeX
@ 2013-06-12 15:55 AW
  2013-06-13 17:22 ` AW
  0 siblings, 1 reply; 9+ messages in thread
From: AW @ 2013-06-12 15:55 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

If I try to use orgtbl-mode in this file and export the orgtbl block inside the 
comment environment to the RECEIVE ORGTBL area, the LaTeX-file will not 
compile, because the numbering in the org-table is exported as

\begin{enumerate}
\item installment
\end{enumerate}

I'd say that inside tabulars numbers like "1." should not be considered as a 
part of a numbered list.

Regards,

Alexander



===================
\documentclass[ngerman]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel, comment}


\begin{document}



\begin{center}
  \begin{tabular}{lrrr}
    Rate    & Fälligkeit & {Betrag (netto) EUR} & Umsatzst. \\
    % BEGIN RECEIVE ORGTBL Zahlungsraten

    % END RECEIVE ORGTBL Zahlungsraten

  \end{tabular}
\end{center}

\begin{comment}
  #+ORGTBL: SEND Zahlungsraten orgtbl-to-latex :splice t :skip 1
  |----------------+-----------------+----------+--------------|
  | 1. installment | Vertragsschluss | 00000,00 | zuzügl. USt. |
  | 2. installment | Begin 1         | 0000,00  | zuzügl. USt. |
  | 3. installment | Begin 2         | 0000,00  | zuzügl. USt. |
  | 4. installment | Abschluss 1     | 0000,00  | zuzügl. USt. |
  | 5. installment | Abschluss 2     | 000,00   | zuzügl. USt. |
  | 6. installment | Inbetriebnahme  | 000,00   | zuzügl. USt. |
  |----------------+-----------------+----------+--------------|
  | Summe:         |                 | 0.00     | zuzügl. USt. |

  #+TBLFM: @7$3=vsum(@I..@II);%.2f
  #$
\end{comment}
\end{document}

==================

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

* Re: Bug in export orgtbl / LaTeX
  2013-06-12 15:55 Bug in export orgtbl / LaTeX AW
@ 2013-06-13 17:22 ` AW
  2013-06-13 17:29   ` Nick Dokos
  0 siblings, 1 reply; 9+ messages in thread
From: AW @ 2013-06-13 17:22 UTC (permalink / raw)
  To: emacs-orgmode

Puuuuuuuuush?!
> Hi!
> 
> If I try to use orgtbl-mode in this file and export the orgtbl block inside
> the comment environment to the RECEIVE ORGTBL area, the LaTeX-file will not
> compile, because the numbering in the org-table is exported as
> 
> \begin{enumerate}
> \item installment
> \end{enumerate}
> 
> I'd say that inside tabulars numbers like "1." should not be considered as a
> part of a numbered list.
> 
> Regards,
> 
> Alexander
> 
> 
> 
> ===================
> \documentclass[ngerman]{article}
> \usepackage[utf8]{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage{babel, comment}
> 
> 
> \begin{document}
> 
> 
> 
> \begin{center}
>   \begin{tabular}{lrrr}
>     Rate    & Fälligkeit & {Betrag (netto) EUR} & Umsatzst. \\
>     % BEGIN RECEIVE ORGTBL Zahlungsraten
> 
>     % END RECEIVE ORGTBL Zahlungsraten
> 
>   \end{tabular}
> \end{center}
> 
> \begin{comment}
>   #+ORGTBL: SEND Zahlungsraten orgtbl-to-latex :splice t :skip 1
> 
>   |----------------+-----------------+----------+--------------|
>   |
>   | 1. installment | Vertragsschluss | 00000,00 | zuzügl. USt. |
>   | 2. installment | Begin 1         | 0000,00  | zuzügl. USt. |
>   | 3. installment | Begin 2         | 0000,00  | zuzügl. USt. |
>   | 4. installment | Abschluss 1     | 0000,00  | zuzügl. USt. |
>   | 5. installment | Abschluss 2     | 000,00   | zuzügl. USt. |
>   | 6. installment | Inbetriebnahme  | 000,00   | zuzügl. USt. |
>   |
>   |----------------+-----------------+----------+--------------|
>   |
>   | Summe:         |                 | 0.00     | zuzügl. USt. |
> 
>   #+TBLFM: @7$3=vsum(@I..@II);%.2f
>   #$
> \end{comment}
> \end{document}
> 
> ==================

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

* Re: Bug in export orgtbl / LaTeX
  2013-06-13 17:22 ` AW
@ 2013-06-13 17:29   ` Nick Dokos
  2013-06-13 19:04     ` AW
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Dokos @ 2013-06-13 17:29 UTC (permalink / raw)
  To: emacs-orgmode

AW <alexander.willand@t-online.de> writes:

> Puuuuuuuuush?!

With infinite force? But you are probably pushing against an immovable
wall :-)

>> Hi!
>> 
>> If I try to use orgtbl-mode in this file and export the orgtbl block inside
>> the comment environment to the RECEIVE ORGTBL area, the LaTeX-file will not
>> compile, because the numbering in the org-table is exported as
>> 
>> \begin{enumerate}
>> \item installment
>> \end{enumerate}
>> 
>> I'd say that inside tabulars numbers like "1." should not be considered as a
>> part of a numbered list.
>> 

Things like this would make the syntax complicated and unpredictable
(there is an old romantic comedy about tourists going on a bus tour of
Europe, entitled "If this is Tuesday, this must be Belgium" - that's
what popped into my head when I read your suggestion :-)

Nicolas has the last word of course, but if I were a betting man, I'd
bet that you won't get your wish.

>> Regards,
>> 
>> Alexander
>> 
>> 
>> 
>> ===================
>> \documentclass[ngerman]{article}
>> \usepackage[utf8]{inputenc}
>> \usepackage[T1]{fontenc}
>> \usepackage{babel, comment}
>> 
>> 
>> \begin{document}
>> 
>> 
>> 
>> \begin{center}
>>   \begin{tabular}{lrrr}
>>     Rate    & Fälligkeit & {Betrag (netto) EUR} & Umsatzst. \\
>>     % BEGIN RECEIVE ORGTBL Zahlungsraten
>> 
>>     % END RECEIVE ORGTBL Zahlungsraten
>> 
>>   \end{tabular}
>> \end{center}
>> 
>> \begin{comment}
>>   #+ORGTBL: SEND Zahlungsraten orgtbl-to-latex :splice t :skip 1
>> 
>>   |----------------+-----------------+----------+--------------|
>>   |
>>   | 1. installment | Vertragsschluss | 00000,00 | zuzügl. USt. |
>>   | 2. installment | Begin 1         | 0000,00  | zuzügl. USt. |
>>   | 3. installment | Begin 2         | 0000,00  | zuzügl. USt. |
>>   | 4. installment | Abschluss 1     | 0000,00  | zuzügl. USt. |
>>   | 5. installment | Abschluss 2     | 000,00   | zuzügl. USt. |
>>   | 6. installment | Inbetriebnahme  | 000,00   | zuzügl. USt. |
>>   |
>>   |----------------+-----------------+----------+--------------|
>>   |
>>   | Summe:         |                 | 0.00     | zuzügl. USt. |
>> 
>>   #+TBLFM: @7$3=vsum(@I..@II);%.2f
>>   #$
>> \end{comment}
>> \end{document}
>> 
>> ==================
>
>
>

-- 
Nick

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

* Re: Bug in export orgtbl / LaTeX
  2013-06-13 17:29   ` Nick Dokos
@ 2013-06-13 19:04     ` AW
  2013-06-14 16:58       ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: AW @ 2013-06-13 19:04 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Nick Dokos

Am Donnerstag, 13. Juni 2013, 13:29:01 schrieb Nick Nick Dokos:
> AW <alexander.willand@t-online.de> writes:
> > Puuuuuuuuush?!
> 
> With infinite force? But you are probably pushing against an immovable
> wall :-)
> 
> >> Hi!
> >> 
> >> If I try to use orgtbl-mode in this file and export the orgtbl block
> >> inside
> >> the comment environment to the RECEIVE ORGTBL area, the LaTeX-file will
> >> not
> >> compile, because the numbering in the org-table is exported as
> >> 
> >> \begin{enumerate}
> >> \item installment
> >> \end{enumerate}
> >> 
> >> I'd say that inside tabulars numbers like "1." should not be considered
> >> as a part of a numbered list.
> 
> Things like this would make the syntax complicated and unpredictable
> (there is an old romantic comedy about tourists going on a bus tour of
> Europe, entitled "If this is Tuesday, this must be Belgium" - that's
> what popped into my head when I read your suggestion :-)
> 
> Nicolas has the last word of course, but if I were a betting man, I'd
> bet that you won't get your wish.

However, thank you for answering!

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

* Re: Bug in export orgtbl / LaTeX
  2013-06-13 19:04     ` AW
@ 2013-06-14 16:58       ` Nicolas Goaziou
  2013-06-17 12:34         ` AW
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2013-06-14 16:58 UTC (permalink / raw)
  To: AW; +Cc: Nick Dokos, emacs-orgmode

Hello,

AW <alexander.willand@t-online.de> writes:

> Am Donnerstag, 13. Juni 2013, 13:29:01 schrieb Nick Nick Dokos:
>> AW <alexander.willand@t-online.de> writes:
>> > Puuuuuuuuush?!
>> 
>> With infinite force? But you are probably pushing against an immovable
>> wall :-)
>> 
>> >> Hi!
>> >> 
>> >> If I try to use orgtbl-mode in this file and export the orgtbl block
>> >> inside
>> >> the comment environment to the RECEIVE ORGTBL area, the LaTeX-file will
>> >> not
>> >> compile, because the numbering in the org-table is exported as
>> >> 
>> >> \begin{enumerate}
>> >> \item installment
>> >> \end{enumerate}
>> >> 
>> >> I'd say that inside tabulars numbers like "1." should not be considered
>> >> as a part of a numbered list.
>> 
>> Things like this would make the syntax complicated and unpredictable
>> (there is an old romantic comedy about tourists going on a bus tour of
>> Europe, entitled "If this is Tuesday, this must be Belgium" - that's
>> what popped into my head when I read your suggestion :-)
>> 
>> Nicolas has the last word of course, but if I were a betting man, I'd
>> bet that you won't get your wish.

Tssk, tssk. Don't be so pessimistic :)

`orgtbl-to-latex' doesn't use export framework at all, unlike to
`orgtbl-to-html'. One solution would be to change that:

  (defun orgtbl-to-latex (table params)
    "Convert the orgtbl-mode TABLE to LaTeX.
  TABLE is a list, each entry either the symbol `hline' for
  a horizontal separator line, or a list of fields for that line.
  PARAMS is ignored."
    (require 'ox-latex)
    (org-export-string-as
     (orgtbl-to-orgtbl table nil) 'latex t '(:with-tables t)))

However, we lose all PARAMS configuration (:splice t in particular).

Note that, according to Org syntax, "1." doesn't start a list, since
tables cannot contain lists.


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug in export orgtbl / LaTeX
  2013-06-14 16:58       ` Nicolas Goaziou
@ 2013-06-17 12:34         ` AW
  2013-06-17 18:20           ` Suvayu Ali
  2013-06-18 20:12           ` Nicolas Goaziou
  0 siblings, 2 replies; 9+ messages in thread
From: AW @ 2013-06-17 12:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Nick Dokos, emacs-orgmode

Am Freitag, 14. Juni 2013, 18:58:06 schrieb Nicolas Nicolas Goaziou:
> Hello,
> 
...
> >> >> Hi!
> >> >> 
> >> >> If I try to use orgtbl-mode in this file and export the orgtbl block
> >> >> inside
> >> >> the comment environment to the RECEIVE ORGTBL area, the LaTeX-file
> >> >> will
> >> >> not
> >> >> compile, because the numbering in the org-table is exported as
> >> >> 
> >> >> \begin{enumerate}
> >> >> \item installment
> >> >> \end{enumerate}
> >> >> 
> >> >> I'd say that inside tabulars numbers like "1." should not be
> >> >> considered
> >> >> as a part of a numbered list.
> >> 
...
> `orgtbl-to-latex' doesn't use export framework at all, unlike to
> `orgtbl-to-html'. One solution would be to change that:
> 
>   (defun orgtbl-to-latex (table params)
>     "Convert the orgtbl-mode TABLE to LaTeX.
>   TABLE is a list, each entry either the symbol `hline' for
>   a horizontal separator line, or a list of fields for that line.
>   PARAMS is ignored."
>     (require 'ox-latex)
>     (org-export-string-as
>      (orgtbl-to-orgtbl table nil) 'latex t '(:with-tables t)))
> 
> However, we lose all PARAMS configuration (:splice t in particular).
> 
> Note that, according to Org syntax, "1." doesn't start a list, since
> tables cannot contain lists.
> 
> 
> Regards,

Dear Nicolas,

isn't that quite a contradiction: according to org-syntax tables can not 
contain lists, but orgtbl-to-latex treats "1." inside a table as if it were a 
beginning of a list?

Besides that, thank you for your code, but as my MEW showed, I use things like 
:splice t . In fact, I do splice nearly every orgtbl into a frame on the 
LaTeX-side.

I have no idea, what to do, only thing I can say is that I use org-tables to 
draft contracts including paing by instalments, e.g. in dependence to progress 
of contstruction works. So things like "1. Instalment" happen. 

Kind regards,

Alexander

 

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

* Re: Bug in export orgtbl / LaTeX
  2013-06-17 12:34         ` AW
@ 2013-06-17 18:20           ` Suvayu Ali
  2013-06-18 20:12           ` Nicolas Goaziou
  1 sibling, 0 replies; 9+ messages in thread
From: Suvayu Ali @ 2013-06-17 18:20 UTC (permalink / raw)
  To: emacs-orgmode

Hello Alexander,

On Mon, Jun 17, 2013 at 02:34:34PM +0200, AW wrote:
> 
> I have no idea, what to do, only thing I can say is that I use org-tables to 
> draft contracts including paing by instalments, e.g. in dependence to progress 
> of contstruction works. So things like "1. Instalment" happen. 

I might have a workaround.  How about rows like this:

  | 1 | Installment | 2000 |
  | 2 | Something   | 3000 |

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Bug in export orgtbl / LaTeX
  2013-06-17 12:34         ` AW
  2013-06-17 18:20           ` Suvayu Ali
@ 2013-06-18 20:12           ` Nicolas Goaziou
  2013-06-19 11:41             ` AW
  1 sibling, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2013-06-18 20:12 UTC (permalink / raw)
  To: AW; +Cc: Nick Dokos, emacs-orgmode

Hello,

AW <alexander.willand@t-online.de> writes:

> isn't that quite a contradiction: according to org-syntax tables can not 
> contain lists, but orgtbl-to-latex treats "1." inside a table as if it were a 
> beginning of a list?

Of course it is a contradiction. As, I wrote it, "orgtbl-to-latex"
interprets Org syntax differently, since it doesn't rely on Elements.

> Besides that, thank you for your code, but as my MEW showed, I use things like 
> :splice t . In fact, I do splice nearly every orgtbl into a frame on the 
> LaTeX-side.

Take 2. We can implement back :splice property. The others are much less
useful.

  (defun orgtbl-to-latex (table params)
    "Convert the orgtbl-mode TABLE to LaTeX.
  TABLE is a list, each entry either the symbol `hline' for
  a horizontal separator line, or a list of fields for that line.
  PARAMS is a property list of parameters that can influence the
  conversion.  Currently this function recognizes the following
  parameters:

  :splice    When set to t, return only table body lines, don't wrap
             them into a \"tabular\" environment.  Default is nil."
    (require 'ox-latex)
    (let ((table-string (orgtbl-to-orgtbl table nil)))
      (if (not (plist-get params :splice))
          (org-export-string-as table-string 'latex t '(:with-tables t))
        ;; If :splice is non-nil, we create a temporary back-end,
        ;; `latex-tmp', derived from `latex', but with a transparent
        ;; table translator.
        (let ((org-export-registered-backends org-export-registered-backends))
          (org-export-define-derived-backend 'latex-tmp 'latex
            :translate-alist (list (cons 'table (lambda (e c i) c))))
          (org-export-string-as table-string 'latex-tmp t '(:with-tables t))))))

WDYT?


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug in export orgtbl / LaTeX
  2013-06-18 20:12           ` Nicolas Goaziou
@ 2013-06-19 11:41             ` AW
  0 siblings, 0 replies; 9+ messages in thread
From: AW @ 2013-06-19 11:41 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Nick Dokos, emacs-orgmode

Am Dienstag, 18. Juni 2013, 22:12:03 schrieb Nicolas Goaziou:
> Take 2. We can implement back :splice property. The others are much less
> useful.
> 
>   (defun orgtbl-to-latex (table params)
>     "Convert the orgtbl-mode TABLE to LaTeX.
>   TABLE is a list, each entry either the symbol `hline' for
>   a horizontal separator line, or a list of fields for that line.
>   PARAMS is a property list of parameters that can influence the
>   conversion.  Currently this function recognizes the following
>   parameters:
> 
>   :splice    When set to t, return only table body lines, don't wrap
>              them into a \"tabular\" environment.  Default is nil."
>     (require 'ox-latex)
>     (let ((table-string (orgtbl-to-orgtbl table nil)))
>       (if (not (plist-get params :splice))
>           (org-export-string-as table-string 'latex t '(:with-tables t))
>         ;; If :splice is non-nil, we create a temporary back-end,
>         ;; `latex-tmp', derived from `latex', but with a transparent
>         ;; table translator.
>         (let ((org-export-registered-backends
> org-export-registered-backends)) (org-export-define-derived-backend
> 'latex-tmp 'latex
>             :translate-alist (list (cons 'table (lambda (e c i) c))))
>           (org-export-string-as table-string 'latex-tmp t '(:with-tables
> t))))))
> 
> WDYT?

WDIT? Let's be carefull,  maybe I got it the wrong way: 

I put your "take 2" from "(defun ..." until "t))))))" into my .emacs 
(somewhere) and restarted Emacs.

Result: If I C-c C-c on the orgtbl from my example, the output still is full 
of 

\begin{enumerate}
\item installment
\end{enumerate}

So there is something wrong. 

But if I put your code into scratch and press C-M-x, change to the buffer with 
the *.tex-file and repeat C-c C-c on the orgtbl, it works properly.

I can live with that way. So WDIT: thank you very much!

Regards,

Alexander

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

end of thread, other threads:[~2013-06-19 11:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-12 15:55 Bug in export orgtbl / LaTeX AW
2013-06-13 17:22 ` AW
2013-06-13 17:29   ` Nick Dokos
2013-06-13 19:04     ` AW
2013-06-14 16:58       ` Nicolas Goaziou
2013-06-17 12:34         ` AW
2013-06-17 18:20           ` Suvayu Ali
2013-06-18 20:12           ` Nicolas Goaziou
2013-06-19 11:41             ` AW

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).