alhassy / alhassy/org-special-block-extras

defblock fails to export output when using latex derived backend

Ouverte
#12 5 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
documentation good first issue
Langage dominant
HTML
Étoiles
236
Forks
17
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Consider some latex derived backend:
```emacs-lisp
(org-export-define-derived-backend
'mybackend
'latex
;; implementation detail ...
)
```
And a custom special block `myblock` to go with it
```emacs-lisp
(defblock myblock
(when (or (equals 'latex) (equals 'mybackend))
(concat
"\\my-latex-command\n"
raw-contents
"\n\\my-latex-command")))
```
Use `mybloc` in some _test.org_ file:
```org
#+begin_myblock

#+end_myblock
```
Now the **issue** is `myblock` is never rendered when exporting _test.org_ to latex
```emacs-lisp
(org-export-to-buffer 'mybackend "*Export Result Buffer*)
```
Is there a proper way to make `defblock` work with latex dervied backends?

Currently overriding `org-latex-special-block` from `my-backend` translation table
and fixing `org-export-current-backend` to point to `latex` during export seems to
work.
```emacs-lisp
(defun ox-mybackend-special-block ( special-block contents info )
(let ((org-export-current-backend 'latex))
(org-latex-special-block special-block contents info)))
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.