emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem with org-mode and minted
@ 2015-04-08 12:11 azubi
  2015-04-08 16:31 ` Thomas S. Dye
  2015-04-08 19:37 ` Ista Zahn
  0 siblings, 2 replies; 3+ messages in thread
From: azubi @ 2015-04-08 12:11 UTC (permalink / raw)
  To: emacs-orgmode

Hi all

I've recently discovered babel (of org-mode) and I try to learn it.
I've discovered a little problem that I cannot solve.

Consider the following (almost) minimal example:

====================================================
* First example with language "c"

#+BEGIN_SRC c :EXPORT results
printf ("First example \n");
#+END_SRC

* Second example with language "C"

#+BEGIN_SRC C :EXPORT results
printf ("second example \n");
#+END_SRC

#+RESULTS:
: second example
====================================================

The first example cannot be evaluated by a C-c C-c (?? due to the small 
"c" ??). The second example is evaluated without any problem.

I've configured org-mode to use "minted" to colorize the source code 
when it is exported to latex.

For the file above, the function "org-export-latex-to-pdf" gives the 
expected result for the first example but nothing for the second one (?? 
due to the big "C" ??). Minted understand "c" as a language but not "C". 
The latex code produced by the command is (without the very long 
standard preamble):

========================================================
\begin{document}

\maketitle
\tableofcontents

\section{First example with language "c"}
\label{sec-1}

\begin{minted}[]{c}
printf ("First example \n");
\end{minted}
\section{Second example with language "C"}
\label{sec-2}

\begin{minted}[]{C}
printf ("second example \n");
\end{minted}
% Emacs 24.3.1 (Org mode 8.2.4)
\end{document}
===========================================================

What have I done wrong ?

Thank you in advance for your help.

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

* Re: Problem with org-mode and minted
  2015-04-08 12:11 Problem with org-mode and minted azubi
@ 2015-04-08 16:31 ` Thomas S. Dye
  2015-04-08 19:37 ` Ista Zahn
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas S. Dye @ 2015-04-08 16:31 UTC (permalink / raw)
  To: azubi; +Cc: emacs-orgmode

Aloha azubi,

azubi <azubi@acm.org> writes:

> Hi all
>
> I've recently discovered babel (of org-mode) and I try to learn it.
> I've discovered a little problem that I cannot solve.
>
> Consider the following (almost) minimal example:
>
> ====================================================
> * First example with language "c"
>
> #+BEGIN_SRC c :EXPORT results
> printf ("First example \n");
> #+END_SRC
>
> * Second example with language "C"
>
> #+BEGIN_SRC C :EXPORT results
> printf ("second example \n");
> #+END_SRC
>
> #+RESULTS:
> : second example
> ====================================================
>
> The first example cannot be evaluated by a C-c C-c (?? due to the small 
> "c" ??). The second example is evaluated without any problem.
>
> I've configured org-mode to use "minted" to colorize the source code 
> when it is exported to latex.
>
> For the file above, the function "org-export-latex-to-pdf" gives the 
> expected result for the first example but nothing for the second one (?? 
> due to the big "C" ??). Minted understand "c" as a language but not "C". 
> The latex code produced by the command is (without the very long 
> standard preamble):
>
> ========================================================
> \begin{document}
>
> \maketitle
> \tableofcontents
>
> \section{First example with language "c"}
> \label{sec-1}
>
> \begin{minted}[]{c}
> printf ("First example \n");
> \end{minted}
> \section{Second example with language "C"}
> \label{sec-2}
>
> \begin{minted}[]{C}
> printf ("second example \n");
> \end{minted}
> % Emacs 24.3.1 (Org mode 8.2.4)
> \end{document}
> ===========================================================
>
> What have I done wrong ?
>
> Thank you in advance for your help.

See the variable org-latex-custom-lang-environments.

You can find an example setup for the old exporter here:

http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12-3

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: Problem with org-mode and minted
  2015-04-08 12:11 Problem with org-mode and minted azubi
  2015-04-08 16:31 ` Thomas S. Dye
@ 2015-04-08 19:37 ` Ista Zahn
  1 sibling, 0 replies; 3+ messages in thread
From: Ista Zahn @ 2015-04-08 19:37 UTC (permalink / raw)
  To: azubi; +Cc: emacs-orgmode Mailinglist

I think you just need to customize org-latex-minted-langs so that it
maps C to c, e.g.,

(add-to-list 'org-latex-minted-langs '(C "c"))

Best,
Ista

On Wed, Apr 8, 2015 at 8:11 AM, azubi <azubi@acm.org> wrote:
> Hi all
>
> I've recently discovered babel (of org-mode) and I try to learn it.
> I've discovered a little problem that I cannot solve.
>
> Consider the following (almost) minimal example:
>
> ====================================================
> * First example with language "c"
>
> #+BEGIN_SRC c :EXPORT results
> printf ("First example \n");
> #+END_SRC
>
> * Second example with language "C"
>
> #+BEGIN_SRC C :EXPORT results
> printf ("second example \n");
> #+END_SRC
>
> #+RESULTS:
> : second example
> ====================================================
>
> The first example cannot be evaluated by a C-c C-c (?? due to the small "c"
> ??). The second example is evaluated without any problem.
>
> I've configured org-mode to use "minted" to colorize the source code when it
> is exported to latex.
>
> For the file above, the function "org-export-latex-to-pdf" gives the
> expected result for the first example but nothing for the second one (?? due
> to the big "C" ??). Minted understand "c" as a language but not "C". The
> latex code produced by the command is (without the very long standard
> preamble):
>
> ========================================================
> \begin{document}
>
> \maketitle
> \tableofcontents
>
> \section{First example with language "c"}
> \label{sec-1}
>
> \begin{minted}[]{c}
> printf ("First example \n");
> \end{minted}
> \section{Second example with language "C"}
> \label{sec-2}
>
> \begin{minted}[]{C}
> printf ("second example \n");
> \end{minted}
> % Emacs 24.3.1 (Org mode 8.2.4)
> \end{document}
> ===========================================================
>
> What have I done wrong ?
>
> Thank you in advance for your help.
>
>

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

end of thread, other threads:[~2015-04-08 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-08 12:11 Problem with org-mode and minted azubi
2015-04-08 16:31 ` Thomas S. Dye
2015-04-08 19:37 ` Ista Zahn

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).