all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#50555: [BUG] Org Latex export doesn't handle src blocks correctly
@ 2021-09-12 20:25 Younes Ben El
  2021-09-18 10:57 ` Daniel Fleischer
  0 siblings, 1 reply; 7+ messages in thread
From: Younes Ben El @ 2021-09-12 20:25 UTC (permalink / raw)
  To: 50555

[-- 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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-27  8:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-12 20:25 bug#50555: [BUG] Org Latex export doesn't handle src blocks correctly Younes Ben El
2021-09-18 10:57 ` 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

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.