EDRSPIHCRSSRSS

PygmenTeX

last modified: 2016-06-24 09:27:43 Contributors

패키지 설명

  • Python Pygments를 이용하여 소스 코드 syntax highlighting하는 패키지
    • minted, verbments 등의 패키지가 있었으며 새로이 pygmentex이 추가됨
  • 요구사항
    • Python, Pygments (pygmentize)
    • --shell-escape
  • 사용법
    \usepackage{pygmentex}
    
  • 명령과 환경
    \begin{pygmented} ... \end{pygmented}
    \begin{includepygmented} ... \end{includepygmented}
    \pyginline
    \inputpygmented
    
  • 문서 : texdoc pygmentex
  • 예제
    \begin{pygmented}[lang=c]
    #include <stdio.h>
    int main(void)
    {
        int a, b, c;
        printf("Enter two numbers to add: ");
        scanf("%d%d", &a, &b);
        c = a + b;
        printf("Sum of entered numbers = %d\n", c);
        return 0;
    }
    \end{pygmented}