[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] radiotables in LaTeX-document: export numbers from orgtbl with c
From: |
AW |
Subject: |
Re: [O] radiotables in LaTeX-document: export numbers from orgtbl with commas as decimal separators instead of periods; with MWE and lisp-code => SOLVED |
Date: |
Sun, 22 Apr 2012 00:38:45 +0200 |
User-agent: |
KMail/4.8.2 (Linux/3.3.2-20-desktop; KDE/4.8.2; x86_64; ; ) |
There is an easy solution on the LaTeX side: we simply have to use the package
»numprint« and to wrap every number of the second column with
»\numprint{number}«, then it will be printed in a suitable way.
We get this by adding to the #+ORGTBL - line this code:
:fmt (2 "\\numprint{%s} EUR")
So the whole line looks like this:
#+ORGTBL: SEND anteile orgtbl-to-latex :splice t :skip 1 :fmt (2
"\\numprint{%s} EUR")
Sorry for the noise.
Regards,
Alexander
> Dear all,
>
> I'd like to use radiotables inside a LaTeX-document. Here is a minimal
> working example:
>
> -----------------------------------------------------------
> \documentclass[pagesize, ngerman, fontsize=12pt]{scrartcl}
> \usepackage[T1]{fontenc}\usepackage[utf8]{inputenc}
> \usepackage{babel, comment, array, booktabs}
>
>
> \title{Sicherheitsbestellung}
> \subtitle{gag}
> \begin{document}
> \maketitle
>
> \begin{tabular}{p{0.25\linewidth}p{0.5\linewidth}}%\toprule
> Bezeichnung & Betrag \\
> % BEGIN RECEIVE ORGTBL Kaufpreis
> Kaufpreis & 100000.00 \\
> Darlehen & -5000.00 \\
> Summe & 95000.00 \\
> % END RECEIVE ORGTBL Kaufpreis
> \bottomrule
> \end{tabular}
> \begin{comment}
> #+ORGTBL: SEND Kaufpreis orgtbl-to-latex :splice t :skip 0
>
> | Kaufpreis | 100000.00 |
> | Darlehen | -5000.00 |
> | Summe | 95000.00 |
>
> #+TBLFM: @address@hidden@2$2;%.2f
>
> \end{comment}
> \end{document}
> -----------------------------------------------------------
>
> I would like to have the LaTeX table with commas as decimal separators
> instead of periods, e.g.:
>
> »Kaufpreis & 100000,00\\« or even better
> »Kaufpreis & 100\,000,00\\«.
>
> To avoid misunderstandigs: The change of all periods to commas should take
> place when the org-table is »transfered« to the LaTeX table, not earlier!
>
> I found a suggestion by Carsten Dominik here:
> http://permalink.gmane.org/gmane.emacs.orgmode/42000
>
> -----------------------------------------------------------
> (add-hook 'org-export-preprocess-hook
> 'org-use-comma-in-exported-tables)
>
> (defun org-use-comma-in-exported-tables ()
> (goto-char (point-min))
> (while (re-search-forward "\\([0-9]\\)\\.\\([0-9]\\)" nil t)
> (org-if-unprotected
> (when (save-match-data (org-at-table-p))
> (replace-match "\\1,\\2" t nil)))))
> -----------------------------------------------------------
>
> I put that into my .emacs, restarted Emacs, but no result.
> I'm using Emacs 23.3 and Org-mode version 7.8.02. Please bear in mind that
> I'm may have made strange mistake, because I do neither have experience
> with radiotables nor understand lisp.
>
> Any help would be appreciated, thanks in advance.
>
> Kind regards,
>
> Alexander