emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: when executing a src block with latex construct, display problem bec


From: Uwe Brauer
Subject: Re: when executing a src block with latex construct, display problem because of +
Date: Sat, 15 May 2021 20:10:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> "BC" == Berry, Charles <ccberry@health.ucsd.edu> writes:

> Uwe,
>> On May 15, 2021, at 6:31 AM, Uwe Brauer <oub@mat.ucm.es> wrote:
>> 
>> 
>> Hi 
>> 
>> I have the following src block
>> 
>> #+begin_src matlab :results output raw :exports code  :eval never-export
>> addpath /home/oub/ALLES/HGs/Matlab-init/Statistic
>> sens=0.7;
>> spec=0.95;
>> aspec=1-spec;
>> prob=0.1;
>> sal=1-prob;
>> [bp,bpinv,bn,bninv]=mibayes(sens,spec,prob);
>> disp('\begin{align*}')
>> disp('P(\text{Covid19}|\text{+})&=\frac{P(\text{+}|\text{Covid19})P(\text{Covid19})}{P(\text{+}|\text{Covid19})P(\text{Covid19})+P(\text{+}|\text{No-Covid19})P(\text{No-Covid19})}\\')
>> fprintf('P(\\text{No-Covid19}) &= 1- P(\\text{Covid19}) = 1-%g=%g\\\\ 
>> \n',prob,sal)
>> fprintf('P(\\text{+}|\\text{No-Covid19}) &= 1-    
>> P(\\text{-}|\\text{No-Covid19}) = 1-%g=%g \\\\ \n',spec,aspec)
>> fprintf('&=\\frac{%g \\cdot %g}{%g\\cdot%g + (1-%g)\\cdot %g}\\\\ 
>> \n',spec,prob,spec,prob,spec,sal)
>> fprintf('P(\\text{Covid19}|-)&=%g \\\\ \n', bp);
>> fprintf('P(\\text{No-Covid19}|+)&=1-P(\\text{Covid19}|+)=%g \\\\ \n', bpinv);
>> disp('\end{align*}')
>> #+end_src
>> 
>> That is exported to 
>> #+RESULTS:
>> \begin{align*}
>> P(\text{Covid19}|\text{+})&=\frac{P(\text{+}|\text{Covid19})P(\text{Covid19})}{P(\text{+}|\text{Covid19})P(\text{Covid19})+P(\text{+}|\text{No-Covid19})P(\text{No-Covid19})}\\
>> P(\text{No-Covid19}) &= 1- P(\text{Covid19}) = 1-0.1=0.9\\ 
>> P(\text{+}|\text{No-Covid19}) &= 1-    P(\text{-}|\text{No-Covid19}) = 
>> 1-0.95=0.05 \\ 
>> &=\frac{0.95 \cdot 0.1}{0.95\cdot0.1 + (1-0.95)\cdot 0.9}\\ 
>> P(\text{Covid19}|-)&=0.000139982 \\ 
>> P(\text{No-Covid19}|+)&=1-P(\text{Covid19}|+)=0.99986 \\ 
>> \end{align*}
>> 
>> Now in my org mode file, the lines between the +
>> 
>> \text{+})&=\frac{P(\text{+}|\text{Covid19})P(\text{Covid19})}{P(\text{+}|\text{Covid19})P(\text{Covid19})+P(\text{+}|\text{No-Covid19})P(\text{No-Covid19})}\\
>> 
>> Get a overstrike.
>> 
>> How can I avoid that?


> Customize `org-src-lang-modes' adding ` ("matlab" . octave)'.

Thanks, it did not help. To make this clear the problem occurs in the
result block, not in the source block. 



 That is exported to 
 #+RESULTS:
 \begin{align*}
 
P(\text{Covid19}|\text{+})&=\frac{P(\text{+}|\text{Covid19})P(\text{Covid19})}{P(\text{+}|\text{Covid19})P(\text{Covid19})+P(\text{+}|\text{No-Covid19})P(\text{No-Covid19})}\\
 P(\text{No-Covid19}) &= 1- P(\text{Covid19}) = 1-0.1=0.9\\ 
 P(\text{+}|\text{No-Covid19}) &= 1-    P(\text{-}|\text{No-Covid19}) = 
1-0.95=0.05 \\ 
 &=\frac{0.95 \cdot 0.1}{0.95\cdot0.1 + (1-0.95)\cdot 0.9}\\ 
 P(\text{Covid19}|-)&=0.000139982 \\ 
 P(\text{No-Covid19}|+)&=1-P(\text{Covid19}|+)=0.99986 \\ 
 \end{align*}


I attach a screenshot just in case

Uwe 

Attachment: org-src.png
Description: PNG image

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]