Page LayoutAssign HTML User Input to LaTeX Variable

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
bagofmilk
Posts: 1
Joined: Wed Jul 18, 2012 6:05 pm

Assign HTML User Input to LaTeX Variable

Post by bagofmilk »

I just started using LaTeX since yesterday, so bear with me.

I have an HTML file with two text boxes. I need the user input values of those text boxes sent to latex code to be displayed. I went the approach of using \newcommand, but I don't know how to reference the HTML.

Can anyone help?

Here's a quick HTML script

Code: Select all

<html>
  <head>
    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"</script>
  </head>
  <body>
    <input type="textbox" id="txtCp">
    <input type="textbox" id="txtCv">

    <br /><br />

    <div> 
      \[k\,=\,\frac{C_p}{C_v}\]
      <br />
      \[\newcommand{\cvval}{**What do I put here to call textbox txtCv??**}\]
      \[\newcommand{\cpval}{**What do I put here to call textbox txtCp??**}\]
      \[k\,=\,\frac{\cpval}{\cvval}\]
    </div>
  </body>
</html>

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply