LaTeX command to create C file

3

Hello, I would like to know if there is a way to generate a file from the LaTeX PDF.

What I want to do: I write a LaTeX code, compile and generate the PDF of it. At some point, I want to show a code that is too long to be inside the PDF (readability question) and then I click on a name (for example: "DataData.c") and then create a file "DataData.c" in the same folder of the PDF for the person to open, view, compile and test. Clicking on the name is similar to that given by references, which opens an external link (url) or goes to a particular part of the PDF.

This avoids the PDF getting polluted with lots of code (3 pages in a row) and sending .rar or .zip files with PDF and various codes inside.

If you can not create a file, how do you open it by clicking on the name, in case I send a zip with PDF and codes inside?

    
asked by anonymous 05.06.2017 / 18:14

1 answer

2

Use: \usepackage[pdftex]{hyperref}

Then: \href{filename.c}{texto do link} in the text body.

Search for Latex Hyperref for more information.

In this case, you must distribute the file along with the PDF. Latex will not create it, just create the link for the person to click.

    
05.06.2017 / 20:28