TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to include a program (as in say Matlab, Maple, etc.) within a LaTeX file in such a way that clicking a button on the resulting PDF file will transport the program to the related software, and run it.

share|improve this question
I'm wondering if you can't use a hyperlink to a shell command: tex.stackexchange.com/questions/37719/…. In that case you could execute a shell command that can open Matlab and download the file from a webserver or something. – Willem Van Onsem Mar 31 '13 at 4:45
up vote 5 down vote accepted

PDF is a container format, so you could embed programs (as you can easily embed files) if these programs allowed distribution via PDF. And you probably could program some JavaScript function that tries to execute these embedded files. You will find no viewer that will do this, though: It would be a security hole.

share|improve this answer
Can you provide an example? For example how do I transport a segment as a file to some directory (the work space directory of the software which will run the program.) I am after a TeX-based course management system – Maesumi Apr 1 '13 at 23:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.