emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: "Rudolf Adamkovič" <salutis@me.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Inline src blocks do not work for LaTeX [9.5.4 (release_9.5.4-3-g6dc785 @ /Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)]
Date: Sun, 03 Jul 2022 19:43:50 +0800	[thread overview]
Message-ID: <87bku6h155.fsf@localhost> (raw)
In-Reply-To: <m2v8se5xi8.fsf@me.com>

Rudolf Adamkovič <salutis@me.com> writes:

> the documentation at
>
> https://orgmode.org/manual/Structure-of-Code-Blocks.html
>
> says
>
> "Org offers two ways to structure source code in Org documents: in a
> source code block, and directly inline. Both specifications are shown
> below."
>
> and
>
> "An inline code block conforms to this structure: src_<language>{<body>}
> … or src_<language>[<header arguments>]{<body>}"
>
> So, I write
>
>> For instance, src_latex{a \qqtext{with} b} renders as "$a
>> \qqtext{with} b$".
>
> I expect syntax-highlighted "a \qqtext{with} b" followed by the rendered
> version.  Both in HTML and LaTeX export, I do not see the former.
>
> Have I stumbled upon a bug, or do I not understand the syntax?
>
> P.S.  When I change "latex" to, for example, "bash", the in-line source
> block appears, albeit incorrectly highlighted.

This is not a bug, but a misunderstanding + undocumented default.
Src blocks, including inline src blocks, can be exported as code,
results of evaluation, and both. (this is likely your misunderstanding)
By default, unlike ordinary src blocks, inline src blocks are only
exported as results - code is not exported, only the result is exported.
(undocumented default).
Further, because Org is not always able to evaluate src blocks (when the
relevant ob-*.el is not loaded), inline src blocks can sometimes be
exported as code. This is likely what happens when you change the blocks
type to bash (I guess).

The inline src block defaults should probably be documented. See
https://orgmode.org/list/87ee927emf.fsf@localhost
Patches are welcome.

The confusing behavior about exporting results for code blocks when the
corresponding ob-*.el is not loaded is trickier. We had a related
discussion on this topic in
https://orgmode.org/list/87mtknsdhm.fsf@localhost
Though I am not sure how we can improve the situation. Ideas are
welcome.

Best,
Ihor


  reply	other threads:[~2022-07-03 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-03  9:57 [BUG] Inline src blocks do not work for LaTeX [9.5.4 (release_9.5.4-3-g6dc785 @ /Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)] Rudolf Adamkovič
2022-07-03 11:43 ` Ihor Radchenko [this message]
2022-07-03 19:11   ` Rudolf Adamkovič
2022-07-03 21:19     ` Christian Heinrich
2022-07-08 20:23       ` Rudolf Adamkovič
2022-07-04 12:08     ` Ihor Radchenko
2022-07-04  2:32   ` Timothy
2022-07-04 12:21     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bku6h155.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=salutis@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).