Re: Reading & Displaying Latex Rendered images [message #178563 is a reply to message #178562] |
Mon, 02 July 2012 10:46 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 7/2/2012 5:54 AM, Fastian wrote:
> On Monday, July 2, 2012 1:44:28 PM UTC+5, Álvaro G. Vicario wrote:
>> El 02/07/2012 9:28, Fastian escribió/wrote:
>>> ___________________________________________________________________________ _____I
>>> am writing this post to explain my project so that you may give me
>>> more relevant suggestions:
>>>
>>> I have to develop an application that will help us develop a database
>>> of questions. These questions will be used for developing tests/
>>> exams. Latex is required to enter scientific and mathematical text.
>> [...]
>>> Guide me which PHP functions will help me in reading and displaying
>>> the images as well as merging the images etc. Any suggestion that can
>>> help me in this project will highly be appreciated. Thanks!
>>
>> Alright, I think I finally got what your problem is. Your picture's URL
>> is by no means unknown. The URL is always this:
>>
>> http://www.forkosh.com/mathtex.cgi?formdata=blah
>>
>> ... where formadata is a GET parameter that contains the raw LaTeX code.
>> You can compose the actual URL with rawurlencode(). E.g.:
>>
>> $latex = '\Large f(x)=\int_{-\infty}^x e^{-t^2}dt';
>> $url = 'http://www.forkosh.com/mathtex.cgi?formdata=' .
>> rawurlencode($latex);
>>
>> Once you have the URL, you could download it with many PHP functions,
>> including the ones you've been evaluating, but you don't really need to.
>> You just have to use the <img> tag in an HTML document and the browser
>> will download it for you:
>>
>> <img src="<?php echo htmlspecialchars($url); ?>">
>>
>>
>> --
>> -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
>> -- Mi sitio sobre programación web: http://borrame.com
>> -- Mi web de humor satinado: http://www.demogracia.com
>> --
>
> Done! Thanks for help.
> Now I come to the second step of my project that I explained in my second last post in detail that I need to take the question and different options from the user. Then I need to combine/ merge them together in a format of a Multiple Choice Question(MCQ) and display this MCQ on the webpage. As well as I need to store the complete image(MCQ) in the database.
> What do you suggest, should I utilize all the input in one go(question + options) and try to bring them in one variable (using some formatting commands/ operators of Latex) and send them for rendering. In this way I hope to get one image for the complete question. (will it be possible and whether Latex help me to format the input to get the desired formatted output)
> OR should i take all the inputs as images separately; question separately and all other options separately. Then I merge them to get the desired format of question.
> Also mention the appropriate functions or examples if possible.
>
I would not put everything in one image. Rather, have the question,
followed by a list of radio buttons, one answer per radio button. If
the question or result needs to be an image, then make it an image.
Otherwise, use plain text (images are much bigger than characters for
the same text).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|