title |
---|
Example file |
This is an example file to show how preprocessing works. If you want to show source code in a document, you can directly typing it in. However, that means that we cannot compile the code to check if it is working. To test the code, we must include it in a separate file, and then include the file in the main text.
pandoc
does not provide any means of including an external file, so we
can use another standard tool, like
gpp
to include external files.
To avoid clash, I use gpp
with -H
option. In this mode, we need to
use the pre-processor macros inside <...>. So, to include an example at
src/hello.c` we write
<#include "src/hello.c">