jim ying jim ying - 1 year ago 146
LaTeX Question

org mode how to convert code block into latex format?

org-mode block code, i want to convert to latex with beautiful format.
The fllow org-mode text, when convert to latex file, it's so ugly. how should i

#+begin_src c
#inlcude <stdio.h>

int main(int argc, char **argv)

Answer Source

For formatting the code, try


  backgroundcolor=\color{black!5}, % set backgroundcolor
  basicstyle=\footnotesize\ttfamily,% basic font setting


int main(int argc, char **argv)


which gives

enter image description here

Hope this helps!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download