(error "Listing directory failed but ‘access-file’ worked")

2024-04-12 Thread Edgar Lux
Hello.

I got this in an Org file:

#+begin_src org
[[file:Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg]]
[[file:Figures/Ti19-g(w, eta={0.1,}, R=1e-3).png]]
#+end_src

The files exist, and can be viewed in image-mode (tested with src_bash{emacs 
-q}).
With =C-c C-o= src_emacs-lisp{(org-open-at-point)}, the result is:

#+begin_example
Debugger entered--Lisp error: (error "Listing directory failed but 
‘access-file’ worked")
  signal(error ("Listing directory failed but ‘access-file’ worked"))
  error("Listing directory failed but `access-file' worked")
  insert-directory("/tmp/Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" "--dired 
-alth --group-directories-first" t nil)
  dired-insert-directory("/tmp/Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" 
"-alth --group-directories-first" nil t t)
  dired-readin-insert()
  #f(compiled-function () #)()
  combine-change-calls-1(1 1 #f(compiled-function () #))
  dired-readin()
  dired-internal-noselect("/tmp/Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" nil)
  dired-noselect("Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" nil)
  dired("Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg")
  (if (string-match "[*?{]" (file-name-nondirectory file-name)) (dired 
file-name) (apply #'org-open-file file-name arg (cond ((not option) nil) 
((string-match-p "\\`[0-9]+\\'" option) (list (string-to-number option))) (t 
(list nil option)
  (let* ((option (and (string-match "::\\(.*\\)\\'" path) (match-string 1 
path))) (file-name (if (not option) path (substring path 0 (match-beginning 
0) (if (string-match "[*?{]" (file-name-nondirectory file-name)) (dired 
file-name) (apply #'org-open-file file-name arg (cond ((not option) nil) 
((string-match-p "\\`[0-9]+\\'" option) (list (string-to-number option))) (t 
(list nil option))
  org-link-open-as-file("Figures/Ti19-g(w, eta={0.1,}, R=1e-3).svg" nil)
  (let* ((option (org-element-property :search-option link)) (path (if option 
(concat path "::" option) path))) (org-link-open-as-file path (let* ((val 
(org-element-property :application link))) (cond (arg (let nil arg)) ((equal 
val '"emacs") (let nil 'emacs)) ((equal val '"sys") (let nil 'system))
  (let nil (let* ((option (org-element-property :search-option link)) (path (if 
option (concat path "::" option) path))) (org-link-open-as-file path (let* 
((val (org-element-property :application link))) (cond (arg (let nil arg)) 
((equal val '"emacs") (let nil 'emacs)) ((equal val '"sys") (let nil 
'system)))
  (cond ((equal type '"file") (let nil (let* ((option (org-element-property 
:search-option link)) (path (if option (concat path "::" option) path))) 
(org-link-open-as-file path (let* ((val ...)) (cond (arg ...) (... ...) (... 
...))) ((member type '("radio" "fuzzy" "custom-id" "coderef")) (let nil (if 
(run-hook-with-args-until-success 'org-open-link-functions path) nil (if (not 
arg) (org-mark-ring-push) (switch-to-buffer-other-window 
(org-link--buffer-for-internals))) (let ((destination (save-excursion ...))) 
(if (and (<= ... destination) (>= ... destination)) nil (widen)) (goto-char 
destination) (t (let nil (let ((f (org-link-get-parameter type :follow))) 
(if (functionp f) (progn (condition-case nil (funcall ... path arg) 
(wrong-number-of-arguments ...
  (let ((type (org-element-property :type link)) (path (org-element-property 
:path link))) (cond ((equal type '"file") (let nil (let* ((option 
(org-element-property :search-option link)) (path (if option ... path))) 
(org-link-open-as-file path (let* (...) (cond ... ... ...)) ((member type 
'("radio" "fuzzy" "custom-id" "coderef")) (let nil (if 
(run-hook-with-args-until-success 'org-open-link-functions path) nil (if (not 
arg) (org-mark-ring-push) (switch-to-buffer-other-window 
(org-link--buffer-for-internals))) (let ((destination ...)) (if (and ... ...) 
nil (widen)) (goto-char destination) (t (let nil (let ((f 
(org-link-get-parameter type :follow))) (if (functionp f) (progn 
(condition-case nil ... ...
  org-link-open((link (:type "file" :path "Figures/Ti19-g(w, eta={0.1,}, 
R=1e-3).svg" :format bracket :raw-link "file:Figures/Ti19-g(w, eta={0.1,}, 
R=1e-3).svg" :application nil :search-option nil :begin 1 :end 51 
:contents-begin nil :contents-end nil :post-blank 0 :parent (paragraph (:begin 
1 :end 103 :contents-begin 1 :contents-end 103 :post-blank 0 :post-affiliated 1 
:mode top-comment :granularity element :cached t :parent (section (:begin 1 
:end 103 :contents-begin 1 :contents-end 103 :robust-begin 1 :robust-end 101 
:post-blank 0 :post-affiliated 1 :mode first-section :granularity element 
:cached t :parent (org-data ...))) nil)
  (cond ((not type) (user-error "No link found")) ((memq type '(comment 
comment-block node-property keyword)) (call-interactively 
#'org-open-at-point-global)) ((memq type '(headline inlinetask)) 
(org-match-line org-complex-heading-regexp) (let ((tags-beg (match-beginning 
5)) (tags-end (match-end 5))) (if (and tags-beg (>= (point) tags-beg) (< 

Re: Feature request: exclude sub-trees by backend

2024-03-27 Thread Edgar Lux
Hi, I had a need for this again (sorry for the necro-bump).

On Feb 26, 2024 at 5:51 PM, Ihor Radchenko  wrote:
> The suggestions to use backend-specific export tag in the links are used
> as ugly workarounds...

Ok. It was just to show that there are other people who may use it :) .

> As for ignore-heading, ...
> ... the author of Org export system
> repeatedly opposed it. This is why:
> https://list.orgmode.org/87mwdfzmox@nicolasgoaziou.fr/

Ok. Sorry. I should have assumed (or looked for) that there was a reason :) .

-- 
Sent with https://mailfence.com  
Secure and private email



Feature request: exclude sub-trees by backend

2024-02-22 Thread Edgar Lux
Hello!

I am trying to exclude different sub-trees (a.k.a. headings or sections), 
depending on the exporter backend. I am familiar with =:noexport:= to exclude 
selected sections (disregarding the backend). I found a solution, but it is 
only intended for a specific backend:

https://emacs.stackexchange.com/a/76454

I would like to recommend that such a thing is implemented for any backend. So 
that :noexport_X: (where X is a backend) is excluded. Something like:

* Not for html   :noexport_html:

* For HTML   :noexport_latex:

Thank you!



-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-10-09 Thread Edgar Lux
On Oct 9, 2023 at 3:59 PM

if I comment out the (add-hook 'org-mode-hook #'org-indent-mode), the error is 
gone

-- 
Sent with https://mailfence.com  
Secure and private email

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-10-09 Thread Edgar Lux
On Oct 9, 2023 
> #--- bug.org
> \(a = 1\)
> #---

further, if you stay "inside" the equation and do C-u C-c C-x C-l (to remove 
the preview) and try to show it again with C-c C-x C-l, the preview is not 
regenerated, but the minibuffer shows =Creating LaTeX previews in section... 
done.=

-- 
Sent with https://mailfence.com  
Secure and private email


init.el.gz
Description: File Attachment: init.el.gz


[BUG] short TeX & in-text code highlighting [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2023-10-02 Thread Edgar Lux
I'm almost sure that this is known, but I don't want to assume.

I get the text between ~ ~ with colouring as if it was in-text code
snippet. I found it interesting

\(a ~b\) and \(\int_{\Omega}fv~\mathrm{d}\)

Emacs  : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, 
cairo version 1.17.8)
Package: Org mode version 9.6.6 (release_9.6.6 @ 
/usr/share/emacs/29.1/lisp/org/)
 

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-10-02 Thread Edgar Lux
Nope, there is still something wrong with my config (see attachment). Haven't 
been able to reproduce consistently.

-- 
Sent with https://mailfence.com  
Secure and private email


log.gz
Description: File Attachment: log.gz


language-specific org-babel-noweb-wrap-start?

2023-10-02 Thread Edgar Lux
Hi!

I wish you a nice day, week, month...
I would like to know if there is a way to set =org-babel-noweb-wrap-start= for 
a specific language. If I set that variable to a value, it will apply to all of 
them. Thank you.

This is fine right now
#+begin_src lang1 :noweb yes
//;name_of_anoter_block;//
#+end_src

# Local Variables:
# org-babel-noweb-wrap-start: "//;"
# org-babel-noweb-wrap-end: ";//"
# End:

What I would like is something like

#+begin_src lang1 :noweb yes
//;name_of_anoter_block;//
#+end_src

# Local Variables:
# org-babel-noweb-wrap-start_lang1: "//;"
# org-babel-noweb-wrap-end_lang1: ";//"
# End:

Thanks!

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-09-28 Thread Edgar Lux
I forgot to say that now:

"9.7-pre"
GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo 
version 1.17.8)

-- 
Sent with https://mailfence.com  
Secure and private email

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-09-28 Thread Edgar Lux
On Aug 28, 2023 at 11:00 AM, Ihor Radchenko  wrote:Edgar 
Lux  writes:

> On Aug 27, 2023 at 7:29 PM, Ihor Radchenko  wrote:
>> I recommend https://github.com/Malabarba/elisp-bug-hunter to narrow down
>> which part of the config is the culprit.
>
> We have a winner:

Another winner? I am not getting the bug anymore

  ;; THIS SUCKS!
  ;; ;; Set soft line wrapping (only on screen, not adding
  ;; ;; newlines to files)
  ;; (remove-hook 'org-mode-hook #'turn-on-auto-fill)
  ;; (add-hook 'org-mode-hook
  ;;   (lambda ()
  ;; (turn-on-visual-line-mode)
  ;; ;; Visual indent
  ;; (org-indent-mode)
  ;; ;; Turn off hard wrapping
  ;; ;; (adding newlines to text)
  ;; (auto-fill-mode -1)
  ;; ;; Align tags from right to
  ;; ;; left to the width of the column
  ;; ;; (setq org-tags-column -60)
  ;; (setq org-tags-column
  ;;   (- 3 fill-column

  ;; No more error
  ;; Set soft line wrapping (only on screen, not adding
  ;; newlines to files)
  (remove-hook 'org-mode-hook #'turn-on-auto-fill)
  (add-hook 'org-mode-hook #'turn-on-visual-line-mode)
  ;; Visual indent
  (add-hook 'org-mode-hook #'org-indent-mode)
  ;; Turn off hard wrapping
  ;; (adding newlines to text)
  (add-hook 'org-mode-hook (lambda () (auto-fill-mode -1)))
  ;; Align tags from right to
  ;; left to the width of the column
  ;; (setq org-tags-column -60)
  (add-hook 'org-mode-hook (lambda () (setq org-tags-column
(- 3 fill-column


-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-08-27 Thread Edgar Lux



On Aug 27, 2023 at 1:28 PM, Ihor Radchenko  wrote:

>>> 9. M-& make repro REPRO_ARGS="-l /tmp/bug.el /tmp/bug.org"

> Please run this command from terminal.
> It should spawn a clean Emacs instance with Org version from the repository.

No warning after   C-c C-x C-l(2x)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-08-27 Thread Edgar Lux
On Aug 26, 2023 at 6:28 PM, Ihor Radchenko  wrote:

> Did you see a new Emacs instance at this point?

Nope. I just launched Emacs again (there is another instance running) and 
copied the command

>> 9. M-& make repro REPRO_ARGS="-l /tmp/bug.el /tmp/bug.org"

Shell buffer shows
#+begin_example
  make -C doc cleanall;  make -C etc cleanall;  make -C lisp cleanall;
  make[1]: Entering directory '/path/to/org/repo/doc'
  rm -f *.pdf *.html *.info *_letter.tex org-version.inc org-version.tex \
*.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs *.toc \
*.tp *.tps *.vr *.vrs *.log *.ps
  rm -f org.texi orgguide.texi
  rm -fr guide manual
  make[1]: Leaving directory '/path/to/org/repo/doc'
  make[1]: Entering directory '/path/to/org/repo/etc'
  make[1]: Nothing to be done for 'cleanall'.
  make[1]: Leaving directory '/path/to/org/repo/etc'
  make[1]: Entering directory '/path/to/org/repo/lisp'
  rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc 
org-install.elc
  rm -f *.elc
  make[1]: Leaving directory '/path/to/org/repo/lisp'
  rm -fr /tmp/tmp-orgtest || { \
find /tmp/tmp-orgtest -type d -exec chmod u+w {} + && \
rm -fr /tmp/tmp-orgtest ; \
  }
  find . \( -name \*~ -o -name \*# -o -name .#\* \) -exec rm -f {} +
  find testing mk \( -name \*~ -o -name \*.elc \) -exec rm -f {} +
  make -C lisp autoloads
  make[1]: Entering directory '/path/to/org/repo/lisp'
  rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc 
org-install.elc
  org-version: 9.7-pre (release_9.6.7-698-g3cbd9f)
  Loading /path/to/org/repo/lisp/org-compat.el (source)...
  Loading /path/to/org/repo/mk/org-fixup.el (source)...
  org-loaddefs: 9.7-pre (release_9.6.7-698-g3cbd9f)
  Loading /path/to/org/repo/lisp/org-compat.el (source)...
  Loading /path/to/org/repo/mk/org-fixup.el (source)...
  make[1]: Leaving directory '/path/to/org/repo/lisp'
#+end_example

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-08-26 Thread Edgar Lux
On Aug 23, 2023 at 9:56 AM, Ihor Radchenko 
> 1. Save the equation to file /tmp/bug.org
> 2. Save your `setq' snippet to /tmp/bug.el
> 3. cd /path/to/org/repo
> 4. make repro REPRO_ARGS="-l /tmp/bug.el /tmp/bug.org"
> 5. Move point to "t = 0" line
> 6. C-c C-x C-l (2x)
> 7. The preview appears and then disappears, as expected.
>
> May you please repeat my steps and let me know if your are seeing the warning?

1. emacs (loading my full configuration)
2. find the file of my previous bug report: t.org
3. dedent and mark the equation (without the =_quote=)
4. M-x copy-to-buffer RET bug.org RET
5. Save to /tmp/bug.org
6. add :tangle /tmp/bug.el to the emacs-lisp source block
7. C-u C-c C-v t to tangle (save) the file
8. find /path/to/org/repo (with dired)
9. M-& make repro REPRO_ARGS="-l /tmp/bug.el /tmp/bug.org"
10. M-x switch-to-buffer RET /tmp/bug.org RET
11. Move point to "t = 0" line
12. C-c C-x C-l (2x)

I see the warning.

After step 10, I removed the files in ltximg, ran =emacs -q=, find file 
/tmp/bug.org, step 11 & 12, and I see no warning. There must be something else 
in my configuration which triggers the error (if you want to follow the rabbit, 
let me know).

In this case, the warning was:

#+begin_example
  Warning (org-element-cache): org-element--cache: Org parser error in 
bug.org::22. Resetting.
   The error was: (error "Invalid search bound (wrong side of point)")
   Backtrace:
  "  backtrace-to-string(nil)
org-element-at-point()
org-element-context()
org-latex-preview(nil)
funcall-interactively(org-latex-preview nil)
call-interactively(org-latex-preview nil nil)
command-execute(org-latex-preview)
  "
   Please report this to Org mode mailing list (M-x org-submit-bug-report). 
Disable showing Disable logging
#+end_example

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-08-22 Thread Edgar Lux
On Aug 18, 2023 at 6:04 PM, Ihor Radchenko  wrote:

> May you try to install the latest stable Org first, following
> https://orgmode.org/manual/Installation.html? You should get M-x
> org-version printing Org 9.6.7.

> Then, let us know if the warning keeps appearing.

* What happens

When I type some equations and get the preview, I get this warning

* Steps to reproduce

1. Type this equation

   #+begin_quote
   \begin{gather}
   t = 0
   \end{gather}
   #+end_quote

2. Ask for preview =C-c C-x C-l= with point on the equation

3. Ask to remove preview (without moving point) =C-c C-x C-l=

4. You get the message (below)

If you repeat 1--3, the message is gone. It comes back if you remove the 
=./ltximg/.svg=

* My "system"

#+begin_src emacs-lisp
  (setq org-latex-pdf-process
'("xelatex -file-line-error -no-pdf -interaction nonstopmode 
-shell-escape -output-directory %o %f"
  ;; Check this too: https://tex.stackexchange.com/a/455164
  "[[ -f %o/%b.idx ]] && texindy %o/%b.idx"
  ;; https://stackoverflow.com/a/57734531
  ;; "latexmk -pdfxe -bibtex %F") ; gives issues with silly errors
  "latexmk -shell-escape -f -pdfxe -bibtex %F")

;; https://emacs.stackexchange.com/a/33172
org-preview-latex-process-alist
(quote ((dvisvgm :programs ("xelatex" "dvisvgm")
:description "dvi > svg"
:message ((concat
  "you need to install the programs: "
  "xelatex and dvisvgm."))
:use-xcolor t
:image-input-type "xdv"
:image-output-type "svg"
:image-size-adjust (1.3 . 1.5)
:latex-compiler ("xelatex -no-pdf -interaction nonstopmode 
-output-directory %o %f")
:image-converter ("dvisvgm %o%b.xdv -n -b min -c %S -o %O"))
))

org-preview-latex-default-process 'dvisvgm)
#+end_src

#+begin_src emacs-lisp
  (format "%s\n%s"
  (org-version)
  (emacs-version))
#+end_src

#+RESULTS:
: 9.7-pre
: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo 
version 1.17.6)
:  of 2023-01-03

Org commit: 3cbd9f423385bf725dc964a5cff573bba17db3ff

* The message

#+begin_example
  Warning (org-element-cache): org-element--cache: Org parser error in 
t.org::189. Resetting.
   The error was: (error "Invalid search bound (wrong side of point)")
   Backtrace:
  "  backtrace-to-string(nil)
org-element-at-point()
org-element-context()
org-latex-preview(nil)
funcall-interactively(org-latex-preview nil)
call-interactively(org-latex-preview nil nil)
command-execute(org-latex-preview)
  "
   Please report this to Org mode mailing list (M-x org-submit-bug-report). 
Disable showing Disable logging
#+end_example


-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Warning when creating preview

2023-08-18 Thread Edgar Lux
On Aug 18, 2023 at 6:04 PM, Ihor Radchenko  wrote:Edgar 
Lux  writes:

> The Org version is very strange. Emacs 28 ships with Org 9.5.5 and the
> latest stable version of Org available on ELPA is Org 9.6.7. The warning
> comes from Org >9.6.

Super weird. I don't know why I ended up in some 9.4 branch (a246a1318), and 
when I did checkout master, I would still be there. Now in 9.7-pre

> Then, let us know if the warning keeps appearing.

I saw you holding your breath :P .

THAAANKS

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 
Sent with https://mailfence.com  
Secure and private email



[BUG] Warning when creating preview

2023-08-18 Thread Edgar Lux
Hi,

I don't really need help with this. Org has been telling me for days that I 
should report this, but I don't really want to share my configuration publicly, 
and I thought that it was only for a file on which I was working. It seems to 
be general for my configuration. I hope that it helps. If you have an encrypted 
personal account to which I can send my config file, let me know.

* What happens

When I type some equations and get the preview, I get this warning

#+begin_quote
\begin{gather}
t = 0
\end{gather}
#+end_quote

* My "system"

Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, 
cairo version 1.17.6)
 of 2023-01-03
Package: Org mode version 9.4.6 (release_9.4.6-13-g4be129)

* The message

Warning (org-element-cache): org-element--cache: Org parser error in t.org::35. 
Resetting.
 The error was: (error "Invalid search bound (wrong side of point)")
 Backtrace:
"  backtrace-to-string(nil)
  (progn (backtrace-to-string (backtrace-get-frames 'backtrace)))
  (if (and (fboundp 'backtrace-get-frames) (fboundp 'backtrace-to-string)) 
(progn (backtrace-to-string (backtrace-get-frames 'backtrace
  (format \"Org parser error in %s::%S. Resetting.\\n The error ...\" 
(buffer-name (current-buffer)) epom err (if (and (fboundp 
'backtrace-get-frames) (fboundp 'backtrace-to-string)) (progn 
(backtrace-to-string (backtrace-get-frames 'backtrace)
  (let* ((format-string (format \"Org parser error in %s::%S. Resetting.\\n The 
error ...\" (buffer-name (current-buffer)) epom err (if (and (fboundp 
'backtrace-get-frames) (fboundp 'backtrace-to-string)) (progn 
(backtrace-to-string (backtrace-get-frames ...)) (format-string (if (or 
(not org-element--cache-diagnostics-ring) (not (eq 'backtrace 
org-element--cache-self-verify))) format-string (prog1 (concat (format 
\"Warning(%s): \" (buffer-name ...)) format-string \"\\nBacktrace:\\n  \" 
(mapconcat #'identity (ring-elements org-element--cache-diagnostics-ring) \"\\n 
 \")) (setq org-element--cache-diagnostics-ring nil) (if (and (boundp 
'org-batch-test) org-batch-test) (error \"%s\" (concat \"org-element--cache: \" 
format-string)) (display-warning 'org-element-cache (concat 
\"org-element--cache: \" format-string
  (condition-case err (org-element--parse-to epom) ((debug error) (let* 
((format-string (format \"Org parser error in %s::%S. Resetting.\\n The error 
...\" (buffer-name (current-buffer)) epom err (if (and ... ...) (progn ... 
(format-string (if (or (not org-element--cache-diagnostics-ring) (not ...)) 
format-string (prog1 (concat ... format-string \"\\nBacktrace:\\n  \" ...) 
(setq org-element--cache-diagnostics-ring nil) (if (and (boundp 
'org-batch-test) org-batch-test) (error \"%s\" (concat \"org-element--cache: \" 
format-string)) (display-warning 'org-element-cache (concat 
\"org-element--cache: \" format-string (org-element-cache-reset) 
(org-element--parse-to epom)))
  (if cached-only (if (and (org-element--cache-active-p) (or (not 
org-element--cache-sync-requests) (< epom (aref (car 
org-element--cache-sync-requests) 1 (progn (org-element--cache-find epom))) 
(condition-case err (org-element--parse-to epom) ((debug error) (let* 
((format-string (format \"Org parser error in %s::%S. Resetting.\\n The error 
...\" (buffer-name ...) epom err (if ... ...))) (format-string (if (or ... ...) 
format-string (prog1 ... ... (if (and (boundp 'org-batch-test) 
org-batch-test) (error \"%s\" (concat \"org-element--cache: \" format-string)) 
(display-warning 'org-element-cache (concat \"org-element--cache: \" 
format-string (org-element-cache-reset) (org-element--parse-to epom
  (setq element (if cached-only (if (and (org-element--cache-active-p) (or (not 
org-element--cache-sync-requests) (< epom (aref (car 
org-element--cache-sync-requests) 1 (progn (org-element--cache-find epom))) 
(condition-case err (org-element--parse-to epom) ((debug error) (let* 
((format-string (format \"Org parser error in %s::%S. Resetting.\\n The error 
...\" ... epom err ...)) (format-string (if ... format-string ...))) (if (and 
(boundp ...) org-batch-test) (error \"%s\" (concat \"org-element--cache: \" 
format-string)) (display-warning 'org-element-cache (concat 
\"org-element--cache: \" format-string (org-element-cache-reset) 
(org-element--parse-to epom)
  (let (element) (if (org-element--cache-active-p) (progn (if (not 
org-element--cache) (org-element-cache-reset) (if cached-only nil 
(org-element--cache-sync (current-buffer) epom) (setq element (if 
cached-only (if (and (org-element--cache-active-p) (or (not 
org-element--cache-sync-requests) (< epom (aref ... 1 (progn 
(org-element--cache-find epom))) (condition-case err (org-element--parse-to 
epom) ((debug error) (let* ((format-string ...) (format-string ...)) (if (and 
... org-batch-test) (error \"%s\" ...) (display-warning ... ...))) 
(org-element-cache-reset) (org-element--parse-to epom) (if (and 

Re: How to preserve indentation of title inside a latex src block when exporting to LaTeX?

2023-08-15 Thread Edgar Lux
This didn't work (I tried)

  ;; Indent title 
  (defun my-latex-filter-indent-title (text backend info)
"Ensure \"\\title\" is indented in LaTeX export."
(when (org-export-derived-backend-p backend 'latex)
  (replace-regexp-in-string
   ;; (rx (group (and (syntax escape) "title")))
   ;; (rx (and "  " (backref 1))) text)))
   "title"
   "  title" text)))

  (make-local-variable 'org-export-filter-plain-text-functions)
  (add-to-list 'org-export-filter-plain-text-functions
   'my-latex-filter-indent-title)
  ;; ---- indent title ends


On Aug 15, 2023 at 12:35 PM, Edgar Lux  wrote:Hello. 
How to preserve indentation of title inside a latex src block when
exporting to LaTeX?

For (annoying) reasons, I need a frontmatter block which is able to indent its
contents. I am almost there, but the title line is not. I can edit this
manually after export, but I would like to know if there is a way to do this...
wait... there are filters. Is a filter the only solution? Thanks. 

#+options: toc:nil title:nil timestamp:nil

#+begin_src emacs-lisp
  (org-babel-do-load-languages 
 'org-babel-load-languages 
 '( (latex   . t) ))
#+end_src

#+begin_frontmatter
  #+begin_src latex -i :exports results :eval yes :results replace
  \title{Determine in-situ matrix properties}
  \nothing{a}
  #+end_src
#+end_frontmatter

#+caption: Notice that title is not indented, but nothing is.
#+results:
: \begin{frontmatter}
: \title{Determine in-situ matrix properties}
:  \nothing{a}
: \end{frontmatter}

#+begin_src emacs-lisp
  (concat (emacs-version) "\n" (org-version))
#+end_src

#+RESULTS:
: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo
version 1.17.6)
:  of 2023-01-03
: 9.5.5

-- 
Sent with https://mailfence.com  
Secure and private email

-- 
Sent with https://mailfence.com  
Secure and private email



How to preserve indentation of title inside a latex src block when exporting to LaTeX?

2023-08-15 Thread Edgar Lux
Hello. How to preserve indentation of title inside a latex src block when 
exporting to LaTeX?

For (annoying) reasons, I need a frontmatter block which is able to indent its 
contents. I am almost there, but the title line is not. I can edit this 
manually after export, but I would like to know if there is a way to do this... 
wait... there are filters. Is a filter the only solution? Thanks. 

#+options: toc:nil title:nil timestamp:nil

#+begin_src emacs-lisp
  (org-babel-do-load-languages 
 'org-babel-load-languages 
 '( (latex   . t) ))
#+end_src

#+begin_frontmatter
  #+begin_src latex -i :exports results :eval yes :results replace
  \title{Determine in-situ matrix properties}
  \nothing{a}
  #+end_src
#+end_frontmatter

#+caption: Notice that title is not indented, but nothing is.
#+results:
: \begin{frontmatter}
: \title{Determine in-situ matrix properties}
:  \nothing{a}
: \end{frontmatter}

#+begin_src emacs-lisp
  (concat (emacs-version) "\n" (org-version))
#+end_src

#+RESULTS:
: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo 
version 1.17.6)
:  of 2023-01-03
: 9.5.5

-- 
Sent with https://mailfence.com  
Secure and private email



#+startup: noalign & C-c }

2023-08-14 Thread Edgar Lux
Hi! Is there a way to prevent resizing of a table with 
=org-table-toggle-coordinate-overlays=?

#+caption: there are some extra spaces after =1=, and before and after =b=.
#+begin_src org
,#+startup: noalign

| 1 | 2 |   b   |
#+end_src

When typing C-c } (command for =org-table-toggle-coordinate-overlays=) and then 
C-c } again to get out of that mode, the cells become

#+caption: the spaces are gone
#+begin_src org
| 1 | 2 | b |
#+end_src

#+begin_src emacs-lisp
  (emacs-version)
#+end_src

#+RESULTS:
: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo 
version 1.17.6)
:  of 2023-01-03

#+begin_src emacs-lisp
  (org-version)
#+end_src

#+RESULTS:
: 9.5.5

Thanks! 

P.S. Is it polite that I reply with a thanks? or is it better to stay silent to 
avoid the extra e-mail (reading on your side)?

-- 
Sent with https://mailfence.com  
Secure and private email



Re: how can I get the output of a =#+begin_src org= in the current buffer?

2023-08-12 Thread Edgar Lux
Thanks!!!

Regarding the typo, it does not show here. But in the info buffer, the =(see 
*note...= becomes (see see ...).

See (:P) attachment

On Aug 12, 2023 at 1:07 PM, Ihor Radchenko  wrote:Edgar 
Lux  writes:

> #+begin_src org
>   #+latex_header: \usepackage{nil}
> #+end_src
>
> What I want is to get =#+latex_header: \usepackage{nil}= in the current
buffer. The documentation (Org-info and the docstring of
=org-babel-execute-src-block=) says that this command would
> #+begin_quote
> Insert the results of execution into the buffer
> #+end_quote
>
> Tips, advice? Thank you!

See https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-org.html
You need

#+begin_src org :results replace
  #+latex_header: \usepackage{nil}
#+end_src

> - There is a typo in the info pages (parses as see see; remove see from
below):
>   (org) Results of Evaluation
>   #+begin_quote
>The ‘file-desc’ header argument defines the description (see *note
>  Link Format::) for the link
>   #+end_quote

May you elaborate?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 
Sent with https://mailfence.com  
Secure and private email


how can I get the output of a =#+begin_src org= in the current buffer?

2023-08-12 Thread Edgar Lux
Hello, how can I get the output of a =#+begin_src org= in the current buffer?

#+begin_src emacs-lisp
  (org-babel-do-load-languages 
 'org-babel-load-languages 
 '((shell   . t)
   (latex   . t)
   (emacs-lisp  . t)
   (org . t)
   ))
#+end_src

#+caption: This shows the contents of the block in the mini-buffer with =C-c 
C-v e= (=org-babel-execute-maybe=)
#+begin_src org
  #+latex_header: \usepackage{nil}
#+end_src

What I want is to get =#+latex_header: \usepackage{nil}= in the current buffer. 
The documentation (Org-info and the docstring of =org-babel-execute-src-block=) 
says that this command would
#+begin_quote
Insert the results of execution into the buffer
#+end_quote

Tips, advice? Thank you!

Org 9.4.6
Emacs 28.2
Linux

P.S.
- I saw this, but it is unrelated (a src block inside another src block).
https://emacs.stackexchange.com/questions/35489/babel-src-block-inside-src-block
- There is a typo in the info pages (parses as see see; remove see from below):
  (org) Results of Evaluation
  #+begin_quote
   The ‘file-desc’ header argument defines the description (see *note
 Link Format::) for the link
  #+end_quote

-- 
Sent with https://mailfence.com  
Secure and private email



Re: keep intermediary tex from latex preview

2023-06-05 Thread Edgar Lux
By the way, using Ihor's suggestion, I was able to debug the issue. There is 
nothing wrong with my configuration. The issue is that the font cannot deal 
with that symbol, and LaTeX just skips it. Still, it would be convenient not to 
have to create a separate .tex to debug the preview. Thanks!

On Jun 5, 2023 at 11:34 AM, Edgar Lux  wrote:When using 
xetex and dvisvgm, an equation like this:

\(µp\)

will render as p (see attached file), most likely because my configuration is
wrong. I don't know how I fixed it for another buffer, but then I restart
and--without knowing what happened--the "no-µ" behaviour is back.  Also (I am
not saying that I have a test case), some times the PDF is produced correctly,
but the preview isn't. Also, in the past, I have noticed that the (failed) .tex
for a (wrong) preview is slightly different. When the equation is definitely
wrong, I get to see the .tex in =/tmp/=, but the Emacs + LaTeX configuration is
so versatile that I get an output even if I type =\({µp\)= (which is a good
feature in most cases). Right now, 

1. setting (setq org-latex-pdf-process '("cp %f /tmp/debug.tex"))
2. reloading Org (org-reload) and
3. creating a new Org buffer 
4. preview or export to PDF 

does not produce =/tmp/debug.tex=. I hope that I was able to describe my
situation. Right now, I will look into =org-latex-packages-alist= again. I want
to say that I appreciate Emacs and Org very much. Thank you.

On Jun 4, 2023 at 5:52 PM, Timothy  wrote:Hi Edgar,

> Looks promising!
> Is the functionality which I mentioned there as well? (get the .tex for the
preview even in absence of error)

Currently, no. Could you elaborate on why you’re interested in this
functionality?

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/tec>.

-- 
Sent with https://mailfence.com  
Secure and private email

-- 
Sent with https://mailfence.com  
Secure and private email



Re: keep intermediary tex from latex preview

2023-06-05 Thread Edgar Lux
When using xetex and dvisvgm, an equation like this:

\(µp\)

will render as p (see attached file), most likely because my configuration is 
wrong. I don't know how I fixed it for another buffer, but then I restart 
and--without knowing what happened--the "no-µ" behaviour is back.  Also (I am 
not saying that I have a test case), some times the PDF is produced correctly, 
but the preview isn't. Also, in the past, I have noticed that the (failed) .tex 
for a (wrong) preview is slightly different. When the equation is definitely 
wrong, I get to see the .tex in =/tmp/=, but the Emacs + LaTeX configuration is 
so versatile that I get an output even if I type =\({µp\)= (which is a good 
feature in most cases). Right now, 

1. setting (setq org-latex-pdf-process '("cp %f /tmp/debug.tex"))
2. reloading Org (org-reload) and
3. creating a new Org buffer 
4. preview or export to PDF 

does not produce =/tmp/debug.tex=. I hope that I was able to describe my 
situation. Right now, I will look into =org-latex-packages-alist= again. I want 
to say that I appreciate Emacs and Org very much. Thank you.

On Jun 4, 2023 at 5:52 PM, Timothy  wrote:Hi Edgar,

> Looks promising!
> Is the functionality which I mentioned there as well? (get the .tex for the
preview even in absence of error)

Currently, no. Could you elaborate on why you’re interested in this
functionality?

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .

-- 
Sent with https://mailfence.com  
Secure and private email


Re: keep intermediary tex from latex preview

2023-06-04 Thread Edgar Lux
On Jun 4, 2023 at 8:34 AM, Ihor Radchenko  wrote:
> In short no.
> And we are also in the process of refactoring the preview system:
> https://list.orgmode.org/orgmode/87lek2up0w@tec.tecosaur.net/

Looks promising!
Is the functionality which I mentioned there as well? (get the .tex for the 
preview even in absence of error)

> You may, however, try to narrow the buffer to the latex fragment of
> interest and then export body to latex via C-c C-e dispatch.

Thanks!

-- 
Sent with https://mailfence.com  
Secure and private email



keep intermediary tex from latex preview

2023-06-03 Thread Edgar Lux
Hello, this has possibly been asked before, but (OMFG) I haven't been able to 
find it (sorry). How can I keep the .tex file used to generate a latex preview 
from an Org buffer (or file)? (the closest that I got was 
=org-latex-logfiles-extensions=). I can usually see such file in =/tmp= if the 
preview fails. Thanks.

Org 9.4.6
Emacs 28.2 x86_64-pc-linux-gnu

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite)

2023-02-05 Thread Edgar Lux
Dear Ihor,

On Feb 4, 2023 at 12:31 PM, Ihor Radchenko  wrote:Edgar 
Lux  writes:

> For example, ... the proposed idea is
> a bit awkward:
>
> ...
> #+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style[...]
> citation-style[...]
>
> I assumed that there is one "major" bibliography-style/citation-style.
> However, it is not really the case in practice. The styles are combined.

First of all, I quickly glanced at the other citation processors, and they seem 
to have been implemented with a different design in Org. This *may* have to do 
with biblatex being more advanced (disclaimer: I'm not saying that it actually 
is, it's a possibility only).

If the idea is that all processors are going to get the same syntax, I think 
that the implementation may not suit one of them. At that point, it may be that 
the filters will have to be adapted to specific processors in contrived ways. 
This of course will be much dependent on the choice of processors chosen to be 
supported by Org. Some other groups may decide to implement, for example, the 
JabRef #+cite_export (this does not imply that JabRef is a citation processor, 
it's just a colourful example).

> For example, adding links to bibliography to citations is applied
> regardless of the particular citation command being used.
>
> So, I am not leaning closer to only allowing options being passed to
> "processor", but not to styles. This will at least come closer to
> certain settings being citation package global config applied to
> everything. If we have options applied to specific citation commands,
> they will rather fit into citation-style/sub-style.
>
> #+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style
> citation-style

If it were me, I would consider just having the options as =#+cite_export: 
processor :options "anything"=. If the bibliography-style is important for the 
user and processor, may be default values can be provided; and let the user 
read some documentation option which are needed to run her particular processor 
(provided by them, not necessarily Org). Again, being completely honest, I 
don't think that you should put a dummy (like me) making these very relevant 
decisions.

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] #+cite_export: ... bibstyle citestyle cannot be universally used as global defaults (was: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite)

2023-02-03 Thread Edgar Lux
On Jan 24, 2023 at 11:54 AM, Ihor Radchenko  wrote:Edgar 
Lux  writes:

> I understand. My takeaway from here is that there is a need to provide
> extended global defaults for both bibliography style and citation style.
> 
> Which is a questionable design choice. I was referring to higher-level
> docstring for `org-cite-export-processors':
> 
>   (NAME BIBLIOGRAPHY-STYLE CITATION-STYLE)
> 
> There, NAME is the name of a registered citation processor providing
> export
> functionality, as a symbol.  BIBLIOGRAPHY-STYLE (respectively
> CITATION-STYLE)
> is the desired default style to use when printing a bibliography
> (respectively
> exporting a citation), as a string or nil.  Both BIBLIOGRAPHY-STYLE and
> CITATION-STYLE are optional.  NAME is mandatory.
> 
> oc-biblatex simply deviates from the global paradigm, making oc-biblatex
> special compared to other citation processors. Not ideal.
> 
> I think that we have a fundamental design flaw with org-cite:
> 
> #+cite_export: processor bibliography-style citation-style
> 
> introduces:
> 
>  - default bibliography style set document-wide
>  - default citation style set individually in every citation via
>   low-level commands, BUT NOT GLOBAL DEFAULT CITATION STYLE.
> 
> Basically, CITATION_STYLE cannot currently affect document preamble by
> design.
> 
> That's why awkward workarounds in oc-biblatex, where default citation
> style can be set globally, and we have to attach citation style to
> BIBLIOGRAPHY_STYLE keyword.
> 
> I suggest the following changes to the org-cite:
> 
> 1. :export-finalizer should accept export processor triplet instead of
>bibliography style as 4th argument. The assumption that only
>bibliography style is required to finalize the export is clearly not
>accurate.
> 
> 2. Allow passing extra arguments in #+cite_export:
> 
> #+cite_export: processor[opt1=val1,opt2=val2,...] bibliography-style[...]
> citation-style[...]
> 
>   The options listed within the square brackets will pass extra default
> options
>   to the processor/styles and used as needed by citation processor
> implementations.
> 
> WDYT?
> -- 
> Ihor Radchenko // yantar92,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 

Dear Ihor and Org mailing list,

I wanted to answer last weekend, because I had the intention to contribute a 
little in terms of code. However, I was very busy, and I will be very busy this 
weekend as well. All in all, the idea sounds great. I appreciate that my 
opinion is taken into account, but I know very little about citation systems. I 
was only a bit concerned about the effort which is needed to implement the 
changes, as little as they may be. 



-- 
Sent with https://mailfence.com  
Secure and private email



Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite

2023-01-23 Thread Edgar Lux
On Jan 23, 2023 at 12:06 PM, Ihor Radchenko  wrote:Edgar 
Lux  writes:
> So, what is the problem with LATEX_HEADER approach?

I thought that it would be preferable to have a native Org syntax.

> I do not like passing the options as-is in #+cite_export because not all
> the possible biblatex \usepackage options are affecting the
> bibliography. Options like sortcites, maxcitenames, autocite, etc are
> only affecting the citation style, not the bibliography. And options
> like bibencoding are totally irrelevant to both citation and
> bibliography styles.

That's fair, but it can just as well be used as a line to configure biblatex 
(since it is already being used anyway). Besides, there are many other options 
which do concern the style or are very needed 
(hyperref=true,backref=true,url=true,backend=biber,natbib=true). I'm not 
advocating for my suggestion, just showing my reasoning. As I said, I'm fine 
with the =#+latex_header:=.

> > 1. case
> >#+begin_src org
> >  #+cite_export: biblatex "how/much"
> >#+end_src
> >
> >the result is
> >#+begin_src latex
> >  \usepackage[bibstyle=how,citestyle=much]{biblatex}
> >#+end_src
>
> This is actually confusing.
> This code is by Nicolas, but does not seem to be consistent with the
> idea of "BIBLIOGRAPHY STYLE".
>
> I am CCing him in cause if there is something I am missing.

The docstring says:

;; "cite_export" keyword.  If you need to use different styles for 
bibliography
;; and citations, you can separate them with "bibstyle/citestyle" syntax.  
E.g.,
;;
;;   #+cite_export: biblatex authortitle/authortitle-ibid

> This is plain abusing.
> We might remove the "/" matching completely and throw an error if there
> are commas inside style name. Users must not rely on such undocumented
> behavior.

Let the user decide (?). If she gets to that point, she surely knows how to 
(ab)use it--in her favour.

> whether some of these are broken is up for discussion. The suggested patch
adds one conditional case, which searches for ="syle="=, takes away the
brackets and turns the above cases into:

[I do not see any patch attached]

WTF... again! (sorry)

diff --git a/lisp/oc-biblatex.el b/lisp/oc-biblatex.el
index a27f9e9bf..3e912f2d9 100644
--- a/lisp/oc-biblatex.el
+++ b/lisp/oc-biblatex.el
@@ -99,6 +99,10 @@ Return a string."
 (style-options
  (cond
   ((null style) nil)
+  ((string-match "style=" style)
+   (list (replace-regexp-in-string
+  "\\(style=[^/]*\\)/" "\\1,citestyle="
+  (org-unbracket-string "[" "]" style
   ((not (string-match "/" style)) (list (concat "style=" style)))
   (t
(list (concat "bibstyle=" (substring style nil (match-beginning 
0)))

> Why not storing email locally? Account limits are non-issue then ;)

The server does not allow me to download e-mails! (free as in... half a beer. I 
can get the full beer if I pay for it, though). Thanks for the suggestion.


-- 
Sent with https://mailfence.com  
Secure and private email



Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite

2023-01-22 Thread Edgar Lux
January 22, 2023 at 12:15:14 PM CET Ihor Radchenko  
wrote:Edgar Lux  writes:
> Note that we have https://orgmode.org/manual/Citation-export-processors.html
> Of course, the "Citations" section of the manual is not yet complete.
> More examples and details will be welcome.

Yes, indeed

> > #+cite_export: biblatex "bibstyle=numeric-comp,sorting=none, 
> > hyperref=true,backref=true,url=true,backend=biber,natbib=true"
>
> The general design is
> #+cite_export: NAME BIBLIOGRAPHY-STYLE CITATION-STYLE
> ... removed content ...
> I am not sure how your idea fits the above.

The general design only allows two options (and their values) to be passed to 
=biblatex= (in the =#+cite_export:= line): =bibstyle= and =citestyle=. However, 
=biblatex= can take many more options. Currently (correct me if I am wrong), 
the two alternatives to pass more options is to use a 
=org-cite-biblatex-options= or a line like this

#+begin_src org
  ,#+LaTeX_HEADER: \usepackage[bibstyle=numeric-comp,sorting=none, 
hyperref=true,backref=true,url=true,backend=biber,natbib=true]{biblatex}
#+end_src

> Also, note that `org-cite-biblatex--package-options' combines INITIAL
> option list from the \usepackage declaration already present with
> options dictated by STYLE.

Precisely.

> However, only certain options are considered.
> After applying your patch, things may be broken in this area.

One of the attachments showed what I considered to be all possible cases: the 
new string (containing =style==; it could be either =bibstyle==, =citestyle==. 
It is similar to the case which allows for ="bibstyle/citestyle"=, as 
documented on line 34 of =oc-biblatex.el=). Currently (these could, hopefully, 
also be used for the documentation), if somebody uses

1. case
   #+begin_src org
 #+cite_export: biblatex "how/much"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[bibstyle=how,citestyle=much]{biblatex}
   #+end_src

2. case
   #+begin_src org
 #+cite_export: biblatex "how" "much"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[style=how]{biblatex}
   #+end_src

3. case
   #+begin_src org
 #+cite_export: biblatex "how,opt=true"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[style=how,opt=true]{biblatex}
   #+end_src

4. case
   #+begin_src org
 #+cite_export: biblatex "how/much,hack=true"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[bibstyle=how,citestyle=much,hack=true]{biblatex}
   #+end_src

5. case
   #+begin_src org
 #+cite_export: biblatex "citestyle=corner/much"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[bibstyle=citestyle=corner,citestyle=much]{biblatex}
   #+end_src

6. case
   #+begin_src org
 #+cite_export: biblatex "citestyle=corner/much,opt=true"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[bibstyle=citestyle=corner,citestyle=much,opt=true]{biblatex}
   #+end_src

7. case
   #+begin_src org
 #+cite_export: biblatex "bibstyle=corner"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[style=bibstyle=corner]{biblatex}
   #+end_src

8. case
   #+begin_src org
 #+cite_export: biblatex "bibstyle=corner/much"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[bibstyle=bibstyle=corner,citestyle=much]{biblatex}
   #+end_src

9. case
   #+begin_src org
 #+cite_export: biblatex "[bibstyle=corner/much]"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[bibstyle=[bibstyle=corner,citestyle=much]]{biblatex}
   #+end_src

10. case (note that this can be combined with all the above)
#+begin_src emacs-lisp
  (setq org-cite-biblatex-options "nulloption=true")
#+end_src

#+begin_src org
  #+cite_export: biblatex "how/much"
#+end_src

the result is
#+begin_src latex
  \usepackage[nulloption=true,bibstyle=how,citestyle=much]{biblatex}
#+end_src

whether some of these are broken is up for discussion. The suggested patch adds 
one conditional case, which searches for ="syle="=, takes away the brackets and 
turns the above cases into:

1. case
   #+begin_src org
 #+cite_export: biblatex "how/much"
   #+end_src

   same result as above

2. case
   #+begin_src org
 #+cite_export: biblatex "how" "much"
   #+end_src

   same result as above

3. case
   #+begin_src org
 #+cite_export: biblatex "how,opt=true"
   #+end_src

   same result as above

4. case
   #+begin_src org
 #+cite_export: biblatex "how/much,hack=true"
   #+end_src

   same result as above

5. case
   #+begin_src org
 #+cite_export: biblatex "citestyle=corner/much"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[citestyle=corner,citestyle=much]{biblatex}
   #+end_src

6. case
   #+begin_src org
 #+cite_export: biblatex "citestyle=corner/much,opt=true"
   #+end_src

   the result is
   #+begin_src latex
 \usepackage[citestyle=corner,citestyle=much,opt=true]{biblatex}
   #+end_src


Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite

2023-01-22 Thread Edgar Lux
January 22, 2023 at 12:36:32 PM CET "András Simonyi"  
wrote:Dear All,

> There is also the customizable variable `org-cite-biblatex-options' to
> pass additional options,

That is very useful, indeed (I didn't know how to use it). Hopefully the e-mail 
which I just sent helps with the documentation.

> which could be used with #bind+ if document-specific options are needed.

Just in case, I think that you meant #+bind: . However, it didn't work for me 
(I'm blaming myself). I added this in line 16 of my 324-lines file

#+bind: org-cite-biblatex-options "opt=true"

but the =opt=true= value is not shown next to =\usepackage{biblatex}= when I 
export. I do have =org-export-allow-bind-keywords= set to =t=

> best wishes,
> András

you too!


-- 
Sent with https://mailfence.com  
Secure and private email



Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite

2023-01-21 Thread Edgar Lux
For the very silly reason that I was not aware of it >.< . Thank you, Ihor. 

For the uninformed: evaluate this as a lisp expression (require 'oc-biblatex) . 
Also, you can use either  #+LaTeX_HEADER: \usepackage... (like shown in this 
thread) or style options with #+cite_export: biblatex (read the documentation 
for oc-biblatex.el). I tested like this (and with the \usepackage line too):

#+cite_export: biblatex
#+bibliography: your_file.bib

This:

#+cite_export: biblatex "bibstyle=numeric-comp,sorting=none, 
hyperref=true,backref=true,url=true,backend=biber,natbib=true"

will create

\usepackage[style=bibstyle=numeric-comp,sorting=none, 
hyperref=true,backref=true,url=true,backend=biber,natbib=true]{biblatex}

(note the style=bibstyle=)

I would suggest that the org-info pages mention (require 'oc-biblatex) and show 
an example of  how one can use extra options (with the #+latex_header as well). 
Further, may be it would be better to allow something like this:

#+cite_export: biblatex "bibstyle=numeric-comp,sorting=none, 
hyperref=true,backref=true,url=true,backend=biber,natbib=true"
#+bibliography: your_file.bib

For which one can use the appended patch, which may break other things, of 
course :P . The gain is control over biblatex options without resorting to 
#+latex_header: \usepackage[...]{biblatex}

Cheers! Thanks.

January 21, 2023 at 9:37:18 AM CET Ihor Radchenko  
wrote:Edgar Lux  writes:

I now looked at the patch and I have one general question. What you
don't just use oc-biblatex in the above?


-- 
Sent with https://mailfence.com  
Secure and private email


oc-biblatex.patch.gz
Description: File Attachment: oc-biblatex.patch.gz


oc-biblatex-postpatch-tests.txt.gz
Description: File Attachment: oc-biblatex-postpatch-tests.txt.gz


Re: Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite

2023-01-20 Thread Edgar Lux
LOL What an idio...! (sorry)

January 20, 2023 at 11:59:22 AM CET Ihor Radchenko  
wrote:Edgar Lux  writes:

> I send the attached patch for your consideration. It allows to use biber for
bibliographies. I tested it with this:

Thanks, but could you please attach the patch?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 
Sent with https://mailfence.com  
Secure and private email


oc-natbib.el.patch.gz
Description: File Attachment: oc-natbib.el.patch.gz


Patch for \usepackage[ ... natbib = true ...]{...biblatex} with org-cite

2023-01-19 Thread Edgar Lux
Dear list,

I send the attached patch for your consideration. It allows to use biber for 
bibliographies. I tested it with this:

(require 'oc-natbib)

#+cite_export: natbib
#+LaTeX_HEADER: \usepackage[style=numeric-comp,sorting=none, 
hyperref=true,backref=true,url=true,backend=biber,natbib=true]{biblatex}
#+LaTeX_HEADER: \addbibresource{../../Sources/sources.bib}

[cite:@mytest]

\printbibliography[heading=none]

These won't work
#+bibliography:
#+print_bibliography:

Thank you very much.

-- 
Sent with https://mailfence.com  
Secure and private email