From mboxrd@z Thu Jan 1 00:00:00 1970 From: AW Subject: Re: radiotables in LaTeX-document: export numbers from orgtbl with commas as decimal separators instead of periods; with MWE and lisp-code Date: Sat, 21 Apr 2012 11:22:17 +0200 Message-ID: <1662380.9gUVOv7VcX@linux-nyil.site> References: <4297465.2ty5xHOKpk@linux-nyil.site> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLWWU-0003bu-QI for emacs-orgmode@gnu.org; Sat, 21 Apr 2012 05:22:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLWWQ-0000xB-2k for emacs-orgmode@gnu.org; Sat, 21 Apr 2012 05:22:30 -0400 Received: from mailout06.t-online.de ([194.25.134.19]:55861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLWWP-0000ws-P6 for emacs-orgmode@gnu.org; Sat, 21 Apr 2012 05:22:25 -0400 In-Reply-To: <4297465.2ty5xHOKpk@linux-nyil.site> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On wednesday, 18. April 2012, 13:00:25 wrote AW: > Dear all, Sorry for this attempt to insist on something else than buriel in the d= igital=20 mass grave of gnu.org for my question.=20 Maybe someone could have a look at it, it would be very usefull to me a= nd=20 probably to others: A comma is the decimal separator for amounts in mon= ey in=20 continental europe. Without replacement of periods with commas _while=20= exporting to LaTeX_ you can not use radiotables for any kind of account= ing. If my question lacks sense or has other shortcomings, please tell me. T= hank=20 you very much. Regards, Alexander >=20 > I'd like to use radiotables inside a LaTeX-document. Here is a minima= l > working example: >=20 > ----------------------------------------------------------- > \documentclass[pagesize, ngerman, fontsize=3D12pt]{scrartcl} > \usepackage[T1]{fontenc}\usepackage[utf8]{inputenc} > \usepackage{babel, comment, array, booktabs} >=20 >=20 > \title{Sicherheitsbestellung} > \subtitle{gag} > \begin{document} > \maketitle >=20 > \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 >=20 > | Kaufpreis | 100000.00 | > | Darlehen | -5000.00 | > | Summe | 95000.00 | >=20 > #+TBLFM: @3$2=3D@1$2+@2$2;%.2f >=20 > \end{comment} > \end{document} > ----------------------------------------------------------- >=20 > I would like to have the LaTeX table with commas as decimal separator= s > instead of periods, e.g.: >=20 > =BBKaufpreis & 100000,00\\=AB or even better > =BBKaufpreis & 100\,000,00\\=AB. >=20 > To avoid misunderstandigs: The change of all periods to commas should= take > place when the org-table is =BBtransfered=AB to the LaTeX table, not = earlier! >=20 > I found a suggestion by Carsten Dominik here: > http://permalink.gmane.org/gmane.emacs.orgmode/42000 >=20 > ----------------------------------------------------------- > (add-hook 'org-export-preprocess-hook > =09 'org-use-comma-in-exported-tables) >=20 > (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))))) > ----------------------------------------------------------- >=20 > 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 experien= ce > with radiotables nor understand lisp. >=20 > Any help would be appreciated, thanks in advance. >=20 > Kind regards, >=20 > Alexander