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 => SOLVED Date: Sun, 22 Apr 2012 00:38:45 +0200 Message-ID: <2582620.XD2DmPklE2@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]:58887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLixD-0005BY-HQ for emacs-orgmode@gnu.org; Sat, 21 Apr 2012 18:38:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLix9-0004W5-3l for emacs-orgmode@gnu.org; Sat, 21 Apr 2012 18:38:55 -0400 Received: from mailout09.t-online.de ([194.25.134.84]:36314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLix8-0004Vw-QP for emacs-orgmode@gnu.org; Sat, 21 Apr 2012 18:38:51 -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 There is an easy solution on the LaTeX side: we simply have to use the = package=20 =BBnumprint=AB and to wrap every number of the second column with=20 =BB\numprint{number}=AB, then it will be printed in a suitable way. We get this by adding to the #+ORGTBL - line this code:=20 :fmt (2 "\\numprint{%s} EUR") So the whole line looks like this: #+ORGTBL: SEND anteile orgtbl-to-latex :splice t :skip 1 :fmt (2=20 "\\numprint{%s} EUR") Sorry for the noise. Regards, Alexander > Dear all, >=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