Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Feb 2009
    Location
    Alexandria, VA
    Posts
    21
    Thanks
    9
    Thanked 0 Times in 0 Posts

    User-defined HTML or STYLE tags

    This is a fairly general question, but is there any way that I could do the following in HTML w/CSS?

    Let's say there is a website that spits out LaTeX images based on what code you put in the website URL.

    For example: ....com/mimetex.cgi?\sum_{i=1}^nf(x)

    The part in the bold, red is the code that the user defines. The website generates a LaTeX image based on such code.

    I would like to have some tag created where I can write <TAG>\sum_{i=1}^nf(x)</TAG> and have the image pulled. I feel that if this can be done, then it can be done with CSS. Is this possible?

  • #2
    New Coder
    Join Date
    Feb 2009
    Location
    Alexandria, VA
    Posts
    21
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Sixty-one views and not one response as to whether this can even be accomplished?

  • #3
    New Coder
    Join Date
    Feb 2009
    Location
    Alexandria, VA
    Posts
    21
    Thanks
    9
    Thanked 0 Times in 0 Posts
    nothing yet?

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,876
    Thanks
    6
    Thanked 1,035 Times in 1,008 Posts
    I don’t quite understand what you want as I have no experience with LaTeX but it sounds more like you want to use XML (and possibly XSLT?).

    Are you trying to write <TAG>\sum_{i=1}^nf(x)</TAG> through a stylesheet? Or are you literally trying to write <tag></tag> or is that just a placeholdeer for any element? If so you’d just write a span, for example, and style this with CSS.

  • Users who have thanked VIPStephan for this post:

    colby2152 (05-12-2009)

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,864
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    For example: ....com/mimetex.cgi?\sum_{i=1}^nf(x)

    The part in the bold, red is the code that the user defines. The website generates a LaTeX image based on such code.

    I would like to have some tag created where I can write <TAG>\sum_{i=1}^nf(x)</TAG> and have the image pulled. I feel that if this can be done, then it can be done with CSS. Is this possible?
    Do you have the program to make the image, by processing such LaTeX statements?

    A wild guess
    Code:
    <img src="http://yoursite.com/mimetex.cgi?\sum_{i=1}^nf(x)" />
    Last edited by abduraooft; 05-12-2009 at 03:53 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    colby2152 (05-12-2009)

  • #6
    New Coder
    Join Date
    Feb 2009
    Location
    Alexandria, VA
    Posts
    21
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thank you for responding (both of you). I am referring to another website's LaTeX program, but I will be using my own in the future. Changing every single image src can take a lot of time, and I feel that this can be done in style sheets.

    I was using <TAG></TAG> merely as an example. Basically, I would want to call such images using some type of reference. Second thought, this must be possible if it can be done in discussion forums.

  • #7
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,876
    Thanks
    6
    Thanked 1,035 Times in 1,008 Posts
    Quote Originally Posted by colby2152 View Post
    Changing every single image src can take a lot of time, and I feel that this can be done in style sheets.
    Changing anything in the code (e. g. the image path or HTML elements) is usually done with some server side script such as PHP or ASP. CSS is only able to style the HTML that is already there.

    So for example basically you would, as abduraooft suggested, use an img element and have a “placeholder” PHP function in the source attribute’s value. PHP function would then be parsed on the server and output regular HTML that is displayed on a website:
    Code:
    <img src="<?php echo imagepath(); ?>" alt="" />
    <!-- where imagepath() is a function that may be storing all image paths in an array or whatever and output them one by one in each image. -->
    I’m not at all good in PHP, this is just a thought.

  • Users who have thanked VIPStephan for this post:

    colby2152 (05-13-2009)

  • #8
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by colby2152 View Post
    This is a fairly general question, but is there any way that I could do the following in HTML w/CSS?

    Let's say there is a website that spits out LaTeX images based on what code you put in the website URL.

    For example: ....com/mimetex.cgi?\sum_{i=1}^nf(x)

    The part in the bold, red is the code that the user defines. The website generates a LaTeX image based on such code.

    I would like to have some tag created where I can write <TAG>\sum_{i=1}^nf(x)</TAG> and have the image pulled. I feel that if this can be done, then it can be done with CSS. Is this possible?
    http://www.cse.ohio-state.edu/~gurari/TeX4ht/

    I didn't search but propably you find the proper answer or something relevant on CTAN or TUG.

    best regards

  • Users who have thanked oesxyl for this post:

    colby2152 (05-13-2009)

  • #9
    New Coder
    Join Date
    Feb 2009
    Location
    Alexandria, VA
    Posts
    21
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    Changing anything in the code (e. g. the image path or HTML elements) is usually done with some server side script such as PHP or ASP. CSS is only able to style the HTML that is already there.

    So for example basically you would, as abduraooft suggested, use an img element and have a “placeholder” PHP function in the source attribute’s value. PHP function would then be parsed on the server and output regular HTML that is displayed on a website:
    Code:
    <img src="<?php echo imagepath(); ?>" alt="" />
    <!-- where imagepath() is a function that may be storing all image paths in an array or whatever and output them one by one in each image. -->
    I’m not at all good in PHP, this is just a thought.
    Would this example work?

    Code:
    <img src="<?php echo imagepath(TEX); f(x)>" alt="" />
    <!-- where imagepath() is a function that may be storing all image paths in an array or whatever and output them one by one in each image. -->
    I assume that imagepath would have to externally referenced in some php file?

  • #10
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,876
    Thanks
    6
    Thanked 1,035 Times in 1,008 Posts
    Quote Originally Posted by colby2152 View Post
    I assume that imagepath would have to externally referenced in some php file?
    Either this or at the top of the HTML (actually PHP) file.

    I really don’t know what your latex code does – is this a function that outputs a certain value already: “{i=1}^nf(x)”?
    Here is a simple example of a PHP array:

    PHP Code:
    <?php
        $variable 
    = array('index1' => 'value''index2' => 'value');
    ?>

    <img src="<?php echo $variable['index1']; ?>" alt="" />
    This is a simple array that is written statically and the value of the first index will be output in the image source. This all would happen in a PHP file (same as a plain HTM file but with .php extension). With a little more advanced PHP you could fill that array dynamically with the image paths and output it automatically as well. But really, that would belong into the PHP forum.

  • Users who have thanked VIPStephan for this post:

    colby2152 (05-14-2009)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •