Skip to content

Commit

Permalink
add source_code_minted example
Browse files Browse the repository at this point in the history
It uses minted package
  • Loading branch information
MarcoIeni committed Feb 19, 2020
1 parent d8dc43a commit db44af7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source_code_minted/config.json
@@ -0,0 +1,3 @@
{
"shell_escape": true
}
5 changes: 5 additions & 0 deletions source_code_minted/header.tex
@@ -0,0 +1,5 @@
\documentclass{article}

\usepackage{minted}
\usepackage{xcolor}
\usemintedstyle{paraiso-light} %% sets default style for all source blocks
1 change: 1 addition & 0 deletions source_code_minted/init.el
@@ -0,0 +1 @@
(setq org-latex-listings 'minted)
32 changes: 32 additions & 0 deletions source_code_minted/main.org
@@ -0,0 +1,32 @@
* source code

** Some c code
#+begin_src c
#include <stdio.h>

int main () {
int a = 1;
printf("hello world\n");
}
#+end_src

** python
#+begin_src python
# set a string
my_string = "Hello, World!"

# print string to stdout
print(my_string)
#+end_src

** java
#+begin_src java
public class HelloWorld {

// main function
public static void main(String[] args) {
System.out.println("Hello, World");
}

}
#+end_src

0 comments on commit db44af7

Please sign in to comment.