Ciao Pedro,

Pedro A. Aranda wrote:
Are you talink about something like

```org
#+CONSTANTS: k=8.99E9 e=1.60E-19 cm=1e-2 uC=1e-6
#+attr_latex: :align ccccS
|---+--------------+-------------+---------------+-----------|
| ! |            r |           F |             q |         n |
| # |         3.00 |        68.0 |          2.00 |  3.81e+12 |
|---+--------------+-------------+---------------+-----------|
#+TBLFM: $5=(($r*$cm)*sqrt($F/$k)-$q*$uC)/$e;%.2e

And I want @@latex: \num{3.81e+12}@@


# Local variables:
# org-latex-packages-alist: (("" "siunitx"))
# org-latex-table-scientific-notation: "\\num{%se%s}"
# End:

ok, I tried the test below removing siunitx variable because I include it with "#+latex_header: \usepackage[binary-units]{siunitx}". To get it to work I need to type C-c C-c when the cursor is on "#+CONSTANTS: k=8.99E9 e=1.60E-19 cm=1e-2 uC=1e-6" line but there are warnings in minibuffer (two times):


The local variables list in test_scientific.org
or .dir-locals.el contains values that may not be safe (*).

Do you want to apply it?  You can type
y  -- to apply the local variables list.
n  -- to ignore the local variables list.
!  -- to apply the local variables list, and permanently mark these
      values (*) as safe (in the future, they will be set automatically.)
i  -- to ignore the local variables list, and permanently mark these
      values (*) as ignored

  * org-latex-table-scientific-notation : "\\num{%se%s}"



I wonder if we can avoid "org-latex-table-scientific-notation: "\\num{%se%s}"" local variable adding some "#+latex_header: ..." or "#+attr_latex: :align ccccS ..." at the beginning of the table definition.

Now the test I tried:

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

# Local variables:
# org-latex-table-scientific-notation: "\\num{%se%s}"
# End:

#+title: Test Scientific Notation
#+author: *Angelo Graziosi*
#+email: [email protected]
#+date: {{{time(%d %B %Y (%a %H:%M))}}}
#+language: it
#+options: toc:nil H:3 num:t email:t

# LaTeX settings -----------------------------------------------
#+latex_class_options: [a4paper,11pt]
#+latex_header: \usepackage[english,italian]{babel}
#+latex_header: \usepackage{amsfonts}
#+latex_header: \usepackage{latexsym,mathtools}
#+latex_header: \usepackage{anysize}
#+latex_header: \usepackage[binary-units]{siunitx}
#+latex_header: \usepackage{braket}
#+latex_header: \usepackage{chngpage}
#+latex_header: \usepackage{calc}
#+latex_header: \usepackage{subfig}
#+latex_header: \usepackage[hyphens]{xurl}
#+latex_header: \usepackage{rotfloat}

#+latex_header: \usepackage[style=arsclassica]{classicthesis}

#+latex_header: \usepackage{pgfplots}
#+latex_header: \pgfplotsset{compat=1.18} %% As suggested in .log and manual

# Definitions for 'anysize' package: {left}{right}{top}{bottom}
#+latex_header: \marginsize{1.5cm}{1.5cm}{1.5cm}{1.5cm}

#+latex_header: \newcommand{\charge}[3]{\shade[ball color=#2] (#1) circle (.25); \draw (#1) node{$#3$};}
# --------------------------------------------------------------

* Test
#+CONSTANTS: k=8.99E9 e=1.60E-19 cm=1e-2 uC=1e-6
#+attr_latex: :align ccccS
|---+-----------------+----------------+------------------------------+----------|
| | $r(\unit{\cm})$ | $F(\unit{\N})$ | $q_{\textup{A}}(\unit{\uC})$ | $n$ |
|---+-----------------+----------------+------------------------------+----------|
| ! | r | F | q | n | | # | 3.00 | 68.0 | 2.00 | 3.81e+12 |
|---+-----------------+----------------+------------------------------+----------|
#+TBLFM: $5=(($r*$cm)*sqrt($F/$k)-$q*$uC)/$e;%.2e

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



Reply via email to