# Input Values To Produce changing Tikzpicture

I have a general question with a minimal example. Is it at all possible in Latex or Tikz to produce a field where an input value can be placed and once the enter key is pressed then a new output is produced? A simple Example

\documentclass{article}
\usepackage{tikz}

\begin{document}
\def\n{5}
\begin{tikzpicture}
\draw[thick] (0,0) rectangle (\n,\n);
\end{tikzpicture}
\end{document}


produces a square of length 5. Would it be possible to have a field where I can enter an input value of choice, press enter and then the new output?

• You could put \def\n{5} in a separate file that you load with \input or just the data in a file. But you will still have to compile the file, I'm afraid. – user121799 Feb 27 '19 at 22:50
• @Marmot, in short a calculator type functionality is impossible? – MathScholar Feb 27 '19 at 22:52
• I do not know if it is impossible but I am not aware of any method. There are amazing things one can do with pdf, e.g. you can produce 3d images with asymptote and change the view, see tex.stackexchange.com/a/451803/121799. It is therefore conceivable that some expert finds a way. If you have one parameter that you wish to vary, you could use animate.... – user121799 Feb 27 '19 at 22:56
• @MathScholar Well I think the output of LaTeX is a .pdf file not an .exe file so don't treat it as an .exe file. – user156344 Feb 28 '19 at 5:20