On 15/12/2022 22:07, Ihor Radchenko wrote:
Tim Cross writes:
I don't see any reason not to allow captions for examples either.
In LaTeX, example blocks are exported as verbatim. I am not sure if we
can even put captions into verbatim.
The default backend for source blocks is verbatim as well:
---- >8 ---- org ----
#+caption: Minimal C program
#+begin_src c
void main() {
return 0;
}
#+end_src
---- 8< ---- org ----
---- >8 ---- latex ----
\begin{verbatim}
void main() {
return 0;
}
\end{verbatim}
\captionof{figure}{Minimal C program}
---- 8< ---- latex ----
So I do not see a problem to support captions for example blocks.
Perhaps page break may happen before the caption, but it is another issue.
You might remember my vote for the symmetry "#+begin_example lang" as
"#+begin_src lang :eval never :noweb no" and Tom's one against it in the
following thread:
https://list.orgmode.org/874k0vud2l.fsf@localhost/
Re: [DISCUSSION] Refactoring fontification system. Wed, 08 Jun 2022
10:02:58 +0800
Max Nikulin writes:
Source blocks without language may be treated as #+begin_example blocks.
I believe, a warning should be issued in such case.
M-x org-lint already does it.
From time to time I write about warnings during export, tangle, etc. I
would not mind if you just ignore it. From my point of view, the
following should be convenient, however I am unsure if it may be
implemented in non-disturbing way. Exporter may issue warnings, they are
collected and presented to user in a temporary window with buffer names
and line numbers as in compilation-minor-mode. The user may see that
something goes wrong, but if their does not switch to the warnings
window then it disappears. It would be great if exporters and lint share
code generating warnings. Another issue that mature development tools
usually allows to suppress particular warning for a specific line. It
may be a problem taking into account specific of Org syntax.
As to `org-lint', I believe, it is hard to discover for new users and
there should be a reason to run it. It easy to forget about it even when
some problem is faced. It is mentioned in the manual, but
- https://orgmode.org/manual/Feedback.html does not request to run
org-lint before reporting a bug
- `org-submit-bug-report' neither suggest `org-lint' nor runs it as a
check. Likely it should be suppressed (with appropriate report) for
large buffers.
P.S. I have accidentally noticed a suspicious line. I have not tried if
it is real bug, but in `org-latex-make-preamble' I expect a property
obtained from the INFO argument, not global variable:
lisp/ox-latex.el:2014: (when (and (eq org-latex-src-block-backend
'engraved)