Re: Heading won't unfold on TAB if last line has just spaces, with empty line preceding.
Giovanni Moretti writes: > There's something weird with headings that can cause unfolding to fail. > Headings can > be folded with TAB refuse to unfold - they need Shift-TAB to see the > contents. This > is scary as it looks like content has been accidentally deleted whereas it's > really > just hidden. Thanks for the report. This looks to be the same issue as the one being discussed at https://orgmode.org/list/CAJj=8EFJXFu9ZQ11cO24AAu=1jykW2Zr+=R4FLuKG=bljfu...@mail.gmail.com/T/#u
Heading won't unfold on TAB if last line has just spaces, with empty line preceding.
There's something weird with headings that can cause unfolding to fail. Headings can be folded with TAB refuse to unfold - they need Shift-TAB to see the contents. This is scary as it looks like content has been accidentally deleted whereas it's really just hidden. The TAB-cycling worked as expected in Org 9.1.9 for the following example but fails in 9.4. The example below illustrates the difficulties: * Block 1 - you can delete X to leave two empty lines and TAB on "Block 1" (or 1a) cycles as expected - GOOD! But if the last line isn't empty but has spaces: * Block 2 - deleting X (leaving empty line) and then Z to leave the last line with just a space (one or more) and heading will fold on TAB /but won't unfold/. Shift-Tab is needed. * Block 3 - the same symptoms as Block 2 but has a subtree to show "Folded/Children/Subtree" when Tab-cycling on level one heading. Cheers Giovanni === * Block 1 - OK Block 1 text ** Block 1a heading Block 1a content X X * BAD BLOCK 2 - Delete X & Z, then TAB WON'T UNFOLD Block 2 content X Z * BAD BLOCK 3 - TAB WON'T UNFOLD Block 2 content ** BAD BLOCK 3a Block 3a content X Z * Block 4 - OK The end
Re: bugs in the new release of org
a little more information in case it is useful: in emacs25 -Q with recent maint, this code fails to export; it errors if there is an org-id link anywhere in the tree. (org-export-as 'html 'subtree nil 'body-only nil) the same bug arises with ascii export. it seems like a bug that a link should make the export fail. the link is to another file not being exported. note also that this is a subtree export with body only. [btw, the docstring says "When optional argument BODY-ONLY is non-nil, only return body code, without surrounding template." it does not way what template means. perhaps the docstring could say?] with my regular .emacs instead of -Q, it does not error but returns an empty string. this made debugging confusing. it scrolls the buffer slightly for unknown reasons. this could perhaps be called a minor bug. random testcase. you can run using m-: on the top line. === * NAKA cables :export: *** NAKA hdmi :export: text * NOTE buy from a company who makes the connectors --- [[https://www.stereo.net.au/forums/topic/251889-hdmi-shielding/][HDMI shielding? - General AV Discussion - StereoNET]] * test no body :export: * test body :export: text * noexport monoprice if nothing else but i must have rejected it. ferrite core. text * [[http://www.alphawire.com/en/Company/Blog/2014/July/Outgassing%2520and%2520Cables][Outgassing and Cables]] A very handy resource is the NASA Outgassing Database :export: text http://outgassing.nasa.gov/cgi/uncgi/search/search_html.sh. === On 10/2/20, Samuel Wales wrote: > a couple of corrections to my previous post. > > the keystrokes are C-c C-e t A after setting subtree and body only. > > pointer actually works for showing the link. just not cursor. > > On 10/2/20, Samuel Wales wrote: >> a few things are broken for me in the new version of maint. my >> computer use is limited, so i am taking them slowly.. >> >> emacs 25. >> >> any hints are welcome. i am not able to proceed further. >> >> >> 1. >> >> this export does nothing, with no errors or warnings: >> >> (org-export-to-buffer 'ascii "alpha-org-export-output.txt" nil >> 'subtree nil 'body-only) >> >> prior to the recent release, it exported. >> >> i tried emacs -Q with C-c C-e A, this said that it was unable to >> resolve a link. however, the link was outside the subtree. i do not >> know why it would look there. also i do not know why it woul dtry to >> resolve a link. or rather i don't know what that means. >> >> the link seems ok. it is an org id link. so why is it erroring? i >> don't know. does this have anything to do with the errorless >> no-result problem i am trying to debug? i could not be sure. >> >> i also tried edebug, but that quickly exceeds my limits. i did >> unwisely do a few levels, but everything returned nothing. for >> example, the export-as function returned an empty string. >> >> >> any comments or hints, even small ones, would be appreciated. i am >> not able to debug this. >> >> >> 2. >> >> another broken thing, in case it rings a bell for anybody, is that i >> had eldoc set up to emit link target when hovering cursor/pointer. i >> think this uses >> help echo. that stopped working. if this does not trigger a priori >> ideas, i will let it stay broken. >> >> >> thank you. >> >> -- >> The Kafka Pandemic >> >> Please learn what misopathy is. >> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html >> > > > -- > The Kafka Pandemic > > Please learn what misopathy is. > https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
Re: #+include from same file when exporting
Hello, ed...@openmail.cc writes: > My comment for today is that I have something like this: > > this-file.org > .. > * Fancy header 1 > > #+NAME: blk1 > #+begin_src python > >import numpy as np #+end_src > > ** Fancy subheader 2 > > Res 1 > > #+include: "this-file.org::blk1" > > Res 2 > > #+include: "this-file.org::blk1" src python > > Res 3 > > #+include: "./this-file.org::blk1" src python > .. end [...] > I think that all of them should just export the python block, right? I don't think so. #+include: file src python means that file is really a python file, whose contents are going to be enclosed in a Python source code block. So Res 2 and Res 3 are not meaningful in that case; you cannot apply link search syntax to non-Org files. > Also, I think that it would be very useful to have something like this: > > another-file.org > .. > * Fancy header 1 > > #+NAME: blk1 > #+begin_src python :exports none > >print(2) #+end_src > > #+RESULTS: : 2 > > ** Fancy subheader 2 > > Res 1 > > #+include: "this-file.org::blk1" src python :exports both > .. end > > > Which would allow to have the =#+include= override the =:exports= > directive from the original block and get the results from the block. "Include" is an export-only directive, which is not the case of :exports. They live in two different worlds, and I think it is a good thing to keep them orthogonal. You may be looking after Babel calls. Regards, -- Nicolas Goaziou
Re: [matlab src is always exported to latex!!]
>>> "ESF" == Eric S Fraga writes: > On Tuesday, 13 Oct 2020 at 14:56, Uwe Brauer wrote: > "DZ" == Diego Zamboni writes: >>> #+begin_src octave :exports results :results output raw >> >> That's it. That solves it, thanks so my function is not necessary. Good >> to know > The problem with =raw= is that you may find you have to manually delete > the previous results if you change and re-execute the src block. Use > =latex= instead. Ok, thanks smime.p7s Description: S/MIME cryptographic signature
Org Refile RFLOC and Struct Type
I was recently working with `org-refile` and wanted to use a custom target. There is the `rfloc` argument which is documented as: > RFLOC can be a refile location obtained in a different way. There's no documentation as to how `rfloc` should be structured. To figure that out one has to read through the code which is made even more difficult by the fact that the same argument is called `refloc` in `org-refile--get-location`. I plan to submit a patch to address this, however I wanted feedback on whether using a struct type (cl-defstruct) could be an improvement here before trying to implement it. It seems using a defined structure would make both the documentation and code more clear, however I rarely (if ever) have seen structures used in the elisp code I'm familiar with. Is there a downside to using struct types that would make it a poor choice in this case? Kevin
Re: [matlab src is always exported to latex!!]
On Tuesday, 13 Oct 2020 at 14:56, Uwe Brauer wrote: "DZ" == Diego Zamboni writes: >> #+begin_src octave :exports results :results output raw > > That's it. That solves it, thanks so my function is not necessary. Good > to know The problem with =raw= is that you may find you have to manually delete the previous results if you change and re-execute the src block. Use =latex= instead. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-57-g8402c4
Re: [matlab src is always exported to latex!!]
>>> "DZ" == Diego Zamboni writes: Hi Diego > Uwe, > In my testing (using octave since I don't have matlab, but I hope it's > similar), using = :exports none :results output raw= seems to produce the > desired output: > #+begin_src octave :exports results :results output raw That's it. That solves it, thanks so my function is not necessary. Good to know smime.p7s Description: S/MIME cryptographic signature
Re: [matlab src is always exported to latex!!]
Uwe, In my testing (using octave since I don't have matlab, but I hope it's similar), using = :exports none :results output raw= seems to produce the desired output: #+begin_src octave :exports results :results output raw close all N = 3; % number of chebyshev nodes n = 1; % polytropic index iters = 1; % iterations j=[0 1 2 3]; z=cos((pi*j)/3); y=1-(0.5*(z+1)).^2; a=n*(8); a2=eye(3+1)*a; disp('\begin{align*}') disp('A_{1,k-1}&=') disp('\begin{pmatrix}') fprintf('%g &%g &%g &%g\n',a2') disp('\end{pmatrix}=OK\\') disp('\end{align*}') #+end_src #+RESULTS: \begin{align*} A_{1,k-1}&= \begin{pmatrix} 8 &0 &0 &0\\ 0 &8 &0 &0\\ 0 &0 &8 &0\\ 0 &0 &0 &8\\ \end{pmatrix}=OK\\ \end{align*} Which renders the matrix correctly. I first tried with =:exports results=, but that for some reason results in the results being included twice in the LaTeX output. I'm not sure why. Hope this helps, --Diego On Tue, Oct 13, 2020 at 1:36 PM Uwe Brauer wrote: > >>> "AB" == Arne Babenhauserheide writes: > > > Uwe Brauer writes: > > >> That did not work: I tried > >> #+begin_src matlab :results output > >> > >> But when I exported the org file to latex, the matlab code was also > >> exported. Strange > > > Do you use :exports results? > > > :results output switches to show what is printed to stdout > > See my answer to Eric > > It does not do want I want > #+begin_src matlab :exports results > close all > N = 3; % number of chebyshev nodes > n = 1; % polytropic index > iters = 1; % iterations > j=[0 1 2 3]; > z=cos((pi*j)/3); > y=1-(0.5*(z+1)).^2; > a=n*(8); > a2=eye(3+1)*a; > disp('\begin{align*}') > disp('A_{1,k-1}&=') > disp('\begin{pmatrix}') > fprintf('%g &%g &%g &%g\n',a2') > disp('\end{pmatrix}=OK\\') > disp('\end{align*}') > #+end_src > > Leads to > > \begin{verbatim} > \begin{align*} > A_{1,k-1}&= > \begin{pmatrix} > 8 &0 &0 &0\\ > 0 &8 &0 &0\\ > 0 &0 &8 &0\\ > 0 &0 &0 &8\\ > \end{pmatrix}=OK\\ > \end{align*} > \end{verbatim} > > So at the moment the only solution I can think of is to use the code I > posted > > (defun my-latex-filter-src-blocks (text backend info) > "Remove source blocks from latex export." > (when (org-export-derived-backend-p backend 'latex) > "%% [removed source block]\n")) > > (add-to-list 'org-export-filter-src-block-functions > 'my-latex-filter-src-blocks) >
Re: [matlab src is always exported to latex!!]
>>> "AB" == Arne Babenhauserheide writes: > Uwe Brauer writes: >> That did not work: I tried >> #+begin_src matlab :results output >> >> But when I exported the org file to latex, the matlab code was also >> exported. Strange > Do you use :exports results? > :results output switches to show what is printed to stdout See my answer to Eric It does not do want I want #+begin_src matlab :exports results close all N = 3; % number of chebyshev nodes n = 1; % polytropic index iters = 1; % iterations j=[0 1 2 3]; z=cos((pi*j)/3); y=1-(0.5*(z+1)).^2; a=n*(8); a2=eye(3+1)*a; disp('\begin{align*}') disp('A_{1,k-1}&=') disp('\begin{pmatrix}') fprintf('%g &%g &%g &%g\n',a2') disp('\end{pmatrix}=OK\\') disp('\end{align*}') #+end_src Leads to \begin{verbatim} \begin{align*} A_{1,k-1}&= \begin{pmatrix} 8 &0 &0 &0\\ 0 &8 &0 &0\\ 0 &0 &8 &0\\ 0 &0 &0 &8\\ \end{pmatrix}=OK\\ \end{align*} \end{verbatim} So at the moment the only solution I can think of is to use the code I posted (defun my-latex-filter-src-blocks (text backend info) "Remove source blocks from latex export." (when (org-export-derived-backend-p backend 'latex) "%% [removed source block]\n")) (add-to-list 'org-export-filter-src-block-functions 'my-latex-filter-src-blocks) smime.p7s Description: S/MIME cryptographic signature
Re: [matlab src is always exported to latex!!]
>>> "ESF" == Eric S Fraga writes: > On Tuesday, 13 Oct 2020 at 09:26, Uwe Brauer wrote: >> That did not work: I tried >> #+begin_src matlab :results output >> But when I exported the org file to latex, the matlab code was also >> exported. Strange > If you want the output only, you also need to add ":exports results". Hm not really #+begin_src matlab :exports results close all N = 3; % number of chebyshev nodes n = 1; % polytropic index iters = 1; % iterations j=[0 1 2 3]; z=cos((pi*j)/3); y=1-(0.5*(z+1)).^2; a=n*(8); a2=eye(3+1)*a; disp('\begin{align*}') disp('A_{1,k-1}&=') disp('\begin{pmatrix}') fprintf('%g &%g &%g &%g\n',a2') disp('\end{pmatrix}=OK\\') disp('\end{align*}') #+end_src when I export this to latex I obtain \begin{verbatim} \begin{align*} A_{1,k-1}&= \begin{pmatrix} 8 &0 &0 &0\\ 0 &8 &0 &0\\ 0 &0 &8 &0\\ 0 &0 &0 &8\\ \end{pmatrix}=OK\\ \end{align*} \end{verbatim} Which is not what I want. I don't want a verbatim environment smime.p7s Description: S/MIME cryptographic signature
Re: buffer name of Org Src...
On Tuesday, 13 Oct 2020 at 11:01, Dr. Arne Babenhauserheide wrote: > Don’t you get a "do you want to revert file" warning then? You might not be visiting that file and/or you might have auto-revert mode set (which I do as I like living dangerously ;-)). -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-57-g8402c4
Re: buffer name of Org Src...
Eric S Fraga writes: > On Tuesday, 13 Oct 2020 at 09:27, Greg Minshall wrote: >> yes, but. the first time i 'C-c C-v t' in the base file onto a >> changed-but-uncommitted tangled file, even git will provide me no >> succor. > > True. :-( Don’t you get a "do you want to revert file" warning then? Best wishes, Arne -- Unpolitisch sein heißt politisch sein ohne es zu merken signature.asc Description: PGP signature
Re: [matlab src is always exported to latex!!] (was: org mode with babel source: execute all source blocks, don't export them to latex)
Uwe Brauer writes: > That did not work: I tried > #+begin_src matlab :results output > > But when I exported the org file to latex, the matlab code was also > exported. Strange Do you use :exports results? :results output switches to show what is printed to stdout Best wishes, Arne -- Unpolitisch sein heißt politisch sein ohne es zu merken signature.asc Description: PGP signature
Re: [matlab src is always exported to latex!!]
On Tuesday, 13 Oct 2020 at 09:26, Uwe Brauer wrote: > That did not work: I tried > #+begin_src matlab :results output > But when I exported the org file to latex, the matlab code was also > exported. Strange If you want the output only, you also need to add ":exports results". -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-57-g8402c4
[solution of sorts] (was: [matlab src is always exported to latex!!])
> That did not work: I tried > #+begin_src matlab :results output > But when I exported the org file to latex, the matlab code was also > exported. Strange The only solution I am aware is to have something like this (defun my-latex-filter-src-blocks (text backend info) "Remove source blocks from latex export." (when (org-export-derived-backend-p backend 'latex) "%% [removed source block]\n")) (defun my-html-filter-src-blocks (text backend info) "Remove source blocks from latex export." (when (org-export-derived-backend-p backend 'html) "%% [removed source block]\n")) (add-to-list 'org-export-filter-src-block-functions 'my-latex-filter-src-blocks) (add-to-list 'org-export-filter-src-block-functions 'my-html-filter-src-blocks) smime.p7s Description: S/MIME cryptographic signature
Re: buffer name of Org Src...
On Tuesday, 13 Oct 2020 at 09:27, Greg Minshall wrote: > yes, but. the first time i 'C-c C-v t' in the base file onto a > changed-but-uncommitted tangled file, even git will provide me no > succor. True. :-( -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-57-g8402c4
Re: buffer name of Org Src...
On Monday, 12 Oct 2020 at 20:52, Dr. Arne Babenhauserheide wrote: > Do you use org-mode to document stuff after you wrote it? Before, during, and after! > I often use it to start small tools that I need right now — for example I do as well. I have little snippets of code and data throughout my documents. It is indeed very useful to have everything in one place. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-57-g8402c4
[matlab src is always exported to latex!!] (was: org mode with babel source: execute all source blocks, don't export them to latex)
Hi Diego Thanks for the quick answer > Hi Uwe, > 1. Is there any equivalent to org-update-all-dblocks for the source > I think you want org-babel-execute-buffer: Right, thanks!!! > Documentation > Call org-babel-execute-src-block on every source block in > the current buffer. > 2. I want to export the org file to latex, in the current setting > Normally, =:results output= should be enough, but there might be some > peculiarities with matlab blocks that change this behavior. That did not work: I tried #+begin_src matlab :results output But when I exported the org file to latex, the matlab code was also exported. Strange Anybody has an idea? smime.p7s Description: S/MIME cryptographic signature
Re: org-tables with monetary amounts
Hi, On Mon, Oct 12 2020, Eric S Fraga wrote: > On Monday, 12 Oct 2020 at 10:22, Christian Moe wrote: >> I think I was thinking about adding mode flags for unit computations, >> like in the imagined example above (`$3=$2+$1;u'), similar to what has >> been done for duration computations. > > This would be very useful, actually. I use embedded calc all the time > with units; being able to use some of the same expressions in a table > would be highly welcome. The functions that one can use in calc formulas can be extended using the 'defmath' lisp command. I paste here from my notes (not about monetary units, but easily adapted): +++ Defining a new calc function for unit conversion with defmath #+BEGIN_SRC emacs-lisp (defmath uconv (expr target-units pure) (math-convert-units expr target-units pure)) #+END_SRC #+RESULTS: : calcFunc-uconv | km | ft | |+--| | 2.5 km | 8202.0997 ft | #+TBLFM: $2=uconv($1, ft) Using the units from the table header (if the 3rd arg is given to uconv, the output is stripped of the unit): | km |ft | |-+---| | 2.5 | 8202.0997 | #+TBLFM: $2 = uconv($1 * @<$1, @<$2, t) The standard calc function usimplify also works for this use case: | km |ft | |-+---| | 2.5 | 8202.0997 | #+TBLFM: $2 = usimplify($1 * @<$1 / @<$2) A lisp equivalent of the above #+begin_src elisp (calc-eval "usimplify(2.5 km / ft)") #+end_src #+RESULTS: : 8202.09973753 Let's define a function that converts to base units #+begin_src elisp (defmath ustd (expr) (math-simplify-units (math-to-standard-units expr nil))) #+end_src #+RESULTS: : calcFunc-ustd | distance | time | speed | std unit speed | speed in ft/s| |--++-+--+--| | 3 km | 2.5 hr | 1.2 km / hr | 0. m / s | 1.0936133 ft / s | #+TBLFM: @2$3=$1/$2::@2$4=ustd($3)::@2$5=uconv($-1, ft/s) -- Paul Scherrer Institut Dr. Derek Feichtinger Phone: +41 56 310 47 33 Group Head HPC and Emerging Technologies Email: derek.feichtin...@psi.ch Building/Room No. OHSA/D17 Forschungsstrasse 111 CH-5232 Villigen PSI
Re: org mode with babel source: execute all source blocks, don't export them to latex
Hi Uwe, 1. Is there any equivalent to org-update-all-dblocks for the source > blocks? > I think you want org-babel-execute-buffer: Documentation Call org-babel-execute-src-block on every source block in the current buffer. 2. I want to export the org file to latex, in the current setting >the source blocks are also exported. I tried >#+begin_src matlab :results output raw :eval never-export >but it did not help. > Normally, =:results output= should be enough, but there might be some peculiarities with matlab blocks that change this behavior. --Diego
org mode with babel source: execute all source blocks, don't export them to latex
Hi I have a org file with has a lot source blocks of the form #+begin_src matlab :results output raw :exports code :eval never-export close all N = 3; % number of chebyshev nodes n = 1; % polytropic index iters = 1; % iterations j=[0 1 2 3]; z=cos((pi*j)/3); y=1-(0.5*(z+1)).^2; a=n*(8); a2=eye(3+1)*a; disp('\begin{align*}') disp('A_{1,k-1}&=') disp('\begin{pmatrix}') fprintf('%g &%g &%g &%g\n',a2') disp('\end{pmatrix}=OK\\') disp('\end{align*}') #+end_src #+RESULTS: \begin{align*} A_{1,k-1}&= \begin{pmatrix} 8 &0 &0 &0\\ 0 &8 &0 &0\\ 0 &0 &8 &0\\ 0 &0 &0 &8\\ \end{pmatrix}=OK\\ \end{align*} Two questions. 1. Is there any equivalent to org-update-all-dblocks for the source blocks? 2. I want to export the org file to latex, in the current setting the source blocks are also exported. I tried #+begin_src matlab :results output raw :eval never-export but it did not help. Thanks Uwe Brauer
Re: buffer name of Org Src...
Eric, > But that's what git etc. are for! ;-) yes, but. the first time i 'C-c C-v t' in the base file onto a changed-but-uncommitted tangled file, even git will provide me no succor. cheers, Greg