all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Younes Ben El <younes.brovi@gmail.com>
To: 50555@debbugs.gnu.org
Subject: bug#50555: [BUG] Org Latex export doesn't handle src blocks correctly
Date: Sun, 12 Sep 2021 21:25:55 +0100	[thread overview]
Message-ID: <CAAM66s7Ej_i8tep4vaOyb8Uv-zNpeA-N7E2d+C1yctSCuwkrMA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]

When exporting from org to latex , src blocks are not handled correctly.
This happens when you specify a prog-language name after #+BEGIN_SRC
Which results to an extra *[]* in exported latex file thus when
compiling it to pdf , it won't display the code block.
- How it produces the code block in latex

\begin{minted}[]{lisp}
>   (defun Fib (n)
>     (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2)))))
> \end{minted}


- how it should produce it in latex

>
> \begin{minted}{lisp}
>   (defun Fib (n)
>     (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2)))))
> \end{minted}


This also happens when not using minted package to highlight code
blocks.
- *To produce this bug*, (optional) set (setq org-latex-listings 'minted)
open org file and add

> #+BEGIN_SRC shell
> echo test
> #+END_SRC

And run org-latex-export-to-pdf or org-latex-export-to-latex.
- *To Resolve this issue* , remove [] in tex file and it will compile to
pdf with code blocks and syntax highlighting (This requires manually
editing each time you export to latex). Second way is to no specify
prog-language after #+BEGIN_SRC however this doesn't show code
highlighting since minted requires defining a prog-language in order to
work.
- Technical Info

> Emacs  : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version
> 3.24.27, cairo version 1.17.4)

 of 2021-03-26
Package: Org mode version 9.5 (9.5-b83ae59 @
/home/ybenel/.emacs.d/.local/straight/build-27.2/org/)

>
>

[-- Attachment #2: Type: text/html, Size: 2627 bytes --]

             reply	other threads:[~2021-09-12 20:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 20:25 Younes Ben El [this message]
2021-09-18 10:57 ` bug#50555: [BUG] Org Latex export doesn't handle src blocks correctly Daniel Fleischer
2021-09-18 14:38   ` Younes Ben El
2021-09-18 19:45     ` Daniel Fleischer
2021-09-18 19:53       ` Younes Ben El
2021-09-18 20:04         ` bug#50555: [PATCH] " Daniel Fleischer
2021-09-27  8:29           ` Bastien

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

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

  git send-email \
    --in-reply-to=CAAM66s7Ej_i8tep4vaOyb8Uv-zNpeA-N7E2d+C1yctSCuwkrMA@mail.gmail.com \
    --to=younes.brovi@gmail.com \
    --cc=50555@debbugs.gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.