Is it possible to have an interactive PDF Document using LaTeX?
For example, I want to make a PDF document (math exercise sheets) such that:
- The user could fold/unfold parts of the document (i.e., the user could press a plus to see the answers)
- The user could tick some field to submit an answer and see his/her score
- Print the resulting PDF document or save it
Best Answer
It is possible to have an interactive
PDF
document, but will only probably work in Acrobat Reader. Some examples can be found at Hello World in pdfLaTeX and How do you say Happy New Year with LaTeX?.There are a number of ways to create them but the simpler so far is to use the insdljs package from the AcroTeX Education Bundle.
To create the interactive part one needs to use PFD Forms and to insert the appropriate JavaScript code, which like in web pages is used to script the interactive part.
The
insdljs
package provides an environment, similar to file contents for writing a JavaScript file. In the minimal it defines a function to calculate the area and diameter of a circle given its radius.The Textfields and push button are also defined accordingly. The MWE illustrates the application. Please view it with a compatible reader.
The AcroTeX Education Bundle provides numerous other functions, which can be useful in an Academic environment for quizzes and tutorials.
Personally I am not very convinced, as such facilities can better be provided in web pages with better interactivity and opening other opportunities.