Eeb development -- use the internet to call the shell to compile a latex file?

Posted on 2006-03-25
Last Modified: 2010-04-22

I have a webpage that displays a latex .tex file. I would like to be able to compile this latex .tex file online.

In order to compile a latex file via the shell one needs to type the following:

> latex onlinefile.tex

this will compile the file and produce two files: and onlinefile.dvi. I would like to be able to compile the onlinefile.tex file by clicking a submit button on my webpage.

How can I achive this?


Question by:XPUSR
    1 Comment
    LVL 24

    Accepted Solution

    Write a CGI script that does the job for you. Here's an example just using the some shell script. (Warning do not use it unmodified)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
        <title>Calling Latex</title>

        <h1>Calling Latex</h1>

        <form action="cgi/run_latex.cgi" method="post">
          <p> I will call run_latex a dummy </p>
          <input type="submit" value="Do it" />


    the run_latex.cgi script:

    echo "Content-type: text/html\n\n"
    echo "<html>"
    echo "  <body>"

    echo "<p>I will pretend to call latex<p>"

    echo "<p>latex some_file.tex</p>"
    echo "</body> </html>"

    Now instead of echo "<p> latex...." you call
    latex some_file.tex
    And then this file gets compiled.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now