On 08/05/2026 12:15 am, Pedro Andres Aranda Gutierrez wrote:
Longer answer at home.

Taking into account how long ago the thread was started, I think, a notification that you received my message was not necessary.

IMHO, even when we are using the low-level #+ATTR_LATEX: :caption, I would 
expect at least the
\caption{…} to be generated.

Currently it is possible to use alternative packages and other commands instead of \caption, see the manual. Besides flexibility, forcing \caption{} would cause an issue with backward compatibility. Another approach for LaTeX code templates for tables, images, source code blocks might be implemented, but designing it requires enough effort.

More details to my earlier message is below. It seems, my guess is correct and the bug can be marked as confirmed.

El 7 may 2026, a las 4:34, Max Nikulin escribió:

Isn't it expected? Instead of the "#+caption:" keyword you are using low
level LaTeX-specific attribute. I believe, it is to override default
caption-related LaTeX code, so it is your responsibility to use complete
and safe commands. See

(info "(org) Tables-in-LaTeX-export")
<https://orgmode.org/manual/Tables-in-LaTeX-export.html>

My guess it that Timothy faced an issue with something like

   #+caption: Image caption with =verbatim $\= and ~code $\~
   [[file:test.png]]

However, it seems, protectedtexttt instead of \verb has been used since 
beginning.
I see a recent Ihor's fix for \verb headings in git history

53edda963 2025-02-24 18:27:01 +0100 Ihor Radchenko:
  Refactor org-latex-headline

To break, I need to run

   # (setf (cdr (assq 'verbatim org-latex-text-markup-alist)) 'verb)

Timothy was trying to make more flexible and granular usage of
LaTeX packages added by ox-latex.
The following thread is long, I have not read the whole. I could not recall if there was another thread and subthread on minimizing of used packages or a more specific link than
<https://git.tecosaur.net/tec/org-mode.git>

Ihor Radchenko. Feedback on the new "feature" system in org-export (was: [Pre-PATCH] Overhaul of the LaTeX preview system) Mon, 22 Apr 2024 11:08:07 +0000.
<https://list.orgmode.org/87a5llzmco.fsf@localhost>

The issue might be related to rather extensive custom configuration

<https://tecosaur.github.io/emacs-config/config.html#latex-export-make>
*5.3.7.17. Make verbatim different to code*

Since have just gone to so much effort above let's make the most of it
by making verbatim use verb instead of protectedtexttt (default).

This gives the same advantages as mentioned in the HTML export section.

(setq org-latex-text-markup-alist
      '((bold . "\\textbf{%s}")
        (code . protectedtexttt)
        (italic . "\\emph{%s}")
        (strike-through . "\\sout{%s}")
        (underline . "\\uline{%s}")
        (verbatim . verb)))

and
<https://tecosaur.github.io/emacs-config/config.html#make-verbatim-different>

*5.3.6.7. Make verbatim different to code*

Since we have verbatim and code, let's make use of the difference.

We can use code exclusively for code snippets and commands like:
"calling (message "Hello") in batch-mode Emacs prints to stdout like
echo". Then we can use verbatim for miscellaneous 'other monospace' like
keyboard shortcuts: "either C-c C-c or C-g is likely the most useful
keybinding in Emacs", or file names: "I keep my configuration in
~/.config/doom/", among other things.

Then, styling these two cases differently can help improve clarity in a 
document.

(setq org-html-text-markup-alist
      '((bold . "<b>%s</b>")
        (code . "<code>%s</code>")
        (italic . "<i>%s</i>")
        (strike-through . "<del>%s</del>")
        (underline . "<span class=\"underline\">%s</span>")
        (verbatim . "<kbd>%s</kbd>")))

In my opinion, LaTeX code is more clean and readable when \verb|...| is used. It may be important when it is necessary to submit a LaTeX file for publishing. I do not follow LaTeX development currently, so I am not aware if \verb or other similar commands may be tagged for accessibility in PDF documents, making formatted files more suitable e.g. to screen readers (or perhaps to AI tools as well).

I have not tried to find if some LaTeX package provides a more robust command similar to \verb.

Perhaps the ox backend may be made aware whether regular or fragile context should be used. `org-latex-text-markup-alist' may be extended for optional variants of commands in the case of normal paragraph and for captions/headings, etc.

It seems, Timothy was asking for ideas what techniques may be used to make export of verbatim object more reliable.

Reply via email to