* problem with unwanted strikeout in src blocks
@ 2022-05-23 17:24 Uwe Brauer
2022-05-23 21:08 ` Jeremie Juste
2022-05-24 3:45 ` Ihor Radchenko
0 siblings, 2 replies; 5+ messages in thread
From: Uwe Brauer @ 2022-05-23 17:24 UTC (permalink / raw)
To: emacs-orgmode
Hi
The following code block is nicely displayed
#+begin_src matlab :exports results :eval never-export :results output latex
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})}\\')
#+end_src
However when I wrap a solutionorbox around it (which I need when
exporting to latex) all text between the «+»
gets a strikeout.
#+begin_solutionorbox
#+begin_src matlab :exports results :eval never-export :results output latex
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})}\\')
#+end_src
#+end_solutionorbox
And idea what to do?
Thanks
Uwe Brauer
--
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military.
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: problem with unwanted strikeout in src blocks
2022-05-23 17:24 problem with unwanted strikeout in src blocks Uwe Brauer
@ 2022-05-23 21:08 ` Jeremie Juste
2022-05-24 12:46 ` Uwe Brauer
2022-05-24 3:45 ` Ihor Radchenko
1 sibling, 1 reply; 5+ messages in thread
From: Jeremie Juste @ 2022-05-23 21:08 UTC (permalink / raw)
To: emacs-orgmode
Hello Uwe
> On Monday, 23 May 2022 at 19:24, Uwe Brauer wrote:
Sorry I don't have matlab and I have never used the solutionorbox
environment, but I believe you can generate latex directly. For example
with R I can to the following.
#+begin_src R :exports results :eval yes :results output latex
cat("\\begin{align*}")
cat("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})}")
cat("\\end{align*}")
#+end_src
With the :post keyword so that you can wrap pretty much anything.
(info "(org) Results of Evaluation")
Consider
#+NAME: box
#+BEGIN_SRC emacs-lisp :var equation=""
(format "\\\\begin{solutionorbox}
%s
\\\\end{solutionorbox}" equation )
#+end_src
#+begin_src R :exports results :eval yes :results output latex :post box(*this*)
cat("\\frac{3}{4}")
#+end_src
#+RESULTS:
#+begin_export latex
\\begin{solutionorbox}
\frac{3}{4}
\\end{solutionorbox}
#+end_export
HTH,
Jeremie
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: problem with unwanted strikeout in src blocks
2022-05-23 17:24 problem with unwanted strikeout in src blocks Uwe Brauer
2022-05-23 21:08 ` Jeremie Juste
@ 2022-05-24 3:45 ` Ihor Radchenko
2022-05-24 12:44 ` Uwe Brauer
1 sibling, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2022-05-24 3:45 UTC (permalink / raw)
To: Uwe Brauer; +Cc: emacs-orgmode
Uwe Brauer <oub@mat.ucm.es> writes:
> However when I wrap a solutionorbox around it (which I need when
> exporting to latex) all text between the «+»
> gets a strikeout.
>
>
> #+begin_solutionorbox
> #+begin_src matlab :exports results :eval never-export :results output latex
> 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})}\\')
> #+end_src
> #+end_solutionorbox
>
> And idea what to do?
This is a known bug in Org fontification. The fix is not trivial. WIP.
See https://orgmode.org/list/87ee7c9quk.fsf@localhost
Current development version of the fix is in
https://github.com/yantar92/org/tree/feature/org-font-lock-element, but
it is not yet complete and will require a lot more work.
Note that other than the visual appearance, your code block is not
affected. That is, export will work just fine. No strike-through will
be present.
Best,
Ihor
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: problem with unwanted strikeout in src blocks
2022-05-24 3:45 ` Ihor Radchenko
@ 2022-05-24 12:44 ` Uwe Brauer
0 siblings, 0 replies; 5+ messages in thread
From: Uwe Brauer @ 2022-05-24 12:44 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]
>>> "IR" == Ihor Radchenko <yantar92@gmail.com> writes:
> Uwe Brauer <oub@mat.ucm.es> writes:
>> However when I wrap a solutionorbox around it (which I need when
>> exporting to latex) all text between the «+»
>> gets a strikeout.
>>
>>
>> #+begin_solutionorbox
>> #+begin_src matlab :exports results :eval never-export :results output latex
>> 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})}\\')
>> #+end_src
>> #+end_solutionorbox
>>
>> And idea what to do?
> This is a known bug in Org fontification. The fix is not trivial. WIP.
> See https://orgmode.org/list/87ee7c9quk.fsf@localhost
Aha, thanks!
> Current development version of the fix is in
> https://github.com/yantar92/org/tree/feature/org-font-lock-element, but
> it is not yet complete and will require a lot more work.
Ok right now this is not so important for me. I might give it a try some
other time, just for testing proposes.
> Note that other than the visual appearance, your code block is not
> affected. That is, export will work just fine. No strike-through will
> be present.
That I assumed already, still it is a bit annoying, but then not that
important I say.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-24 13:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-23 17:24 problem with unwanted strikeout in src blocks Uwe Brauer
2022-05-23 21:08 ` Jeremie Juste
2022-05-24 12:46 ` Uwe Brauer
2022-05-24 3:45 ` Ihor Radchenko
2022-05-24 12:44 ` Uwe Brauer
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).