Re: [O] Bug in export orgtbl / LaTeX
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: > > :spliceWhen 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
Re: [O] Bug in export orgtbl / LaTeX
Hello, AW 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: :spliceWhen 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
Re: [O] Bug in export orgtbl / LaTeX
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.
Re: [O] Bug in export orgtbl / LaTeX
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
Re: [O] Bug in export orgtbl / LaTeX
Hello, AW writes: > Am Donnerstag, 13. Juni 2013, 13:29:01 schrieb Nick Nick Dokos: >> AW writes: >> > Push?! >> >> 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
Re: [O] Bug in export orgtbl / LaTeX
Am Donnerstag, 13. Juni 2013, 13:29:01 schrieb Nick Nick Dokos: > AW writes: > > Push?! > > 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!
Re: [O] Bug in export orgtbl / LaTeX
AW writes: > Push?! 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 | 0,00 | zuzügl. USt. | >> | 2. installment | Begin 1 | ,00 | zuzügl. USt. | >> | 3. installment | Begin 2 | ,00 | zuzügl. USt. | >> | 4. installment | Abschluss 1 | ,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
Re: [O] Bug in export orgtbl / LaTeX
Push?! > 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 | 0,00 | zuzügl. USt. | > | 2. installment | Begin 1 | ,00 | zuzügl. USt. | > | 3. installment | Begin 2 | ,00 | zuzügl. USt. | > | 4. installment | Abschluss 1 | ,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} > > ==