TEX - generated GIF with an ancho

TEX - generated GIF with an ancho

by Jimmy Lambert -
Number of replies: 7

Hi there,

As a complete newbie, my question will sound idiot to others. Great for me, I'll have you all laughing at me to answer my request:

How could I get rid of those automaticly generated anchors with the gif of my equations?

 

Thank you all!

Average of ratings: -
In reply to Jimmy Lambert

Re: TEX - generated GIF with an ancho

by Colin Fraser -
Picture of Documentation writers Picture of Testers

mmm what? Move the TeX to where you want it, then you don't have to worry about it.

From my readings and limited perception of TeX, I don't think you can, even for PDFs if you want to generate that. (However, most documentation of any TeX distro is so convoluted or circumspect or intellectually pretentious it is barely readable.) Do a PDF then a screen grab and use the image - maybe one way out for you. 

In reply to Colin Fraser

Re: TEX - generated GIF with an ancho

by Jimmy Lambert -

Here's a cut/paste screenshot of what I'm talking about (attached file)...

You can see in my firebug console that a link is automatically generated surrounding the gif img... What I want to do is to get rid of this link and let the img stands without it. Because when clicked, the link force the page to reload so the viewer loose his focus on his reading... I just want to make sure that there's a proper way to do it rather than cancelling these links with a jQuery call.

Thanks for your help,

Jim

Attachment Screen shot - img  anchor.gif
In reply to Jimmy Lambert

Re: TEX - generated GIF with an ancho

by Jean-Michel Védrine -

hello,

This is generated by the tex filter so the code to modify is in filter/tex/filter.php file in the filter_text_image function.

 

In reply to Jean-Michel Védrine

Re: TEX - generated GIF with an ancho

by Colin Fraser -
Picture of Documentation writers Picture of Testers

That is what I thought you meant, which is why I wondered if I had read it right. mmm not possible I would have thought. AFAIK, the TeX script you enter is sent to the renderer, but the returned image is not embeded into a HTML page, the code generated by the filter is. Without the anchor, how can the image display? That is not a Moodle thing, that is an SGML/HTML convention.

In reply to Colin Fraser

Re: TEX - generated GIF with an ancho

by Mauno Korpelainen -

Tex filter is using the link tags around tex images for two purposes - for showing tex source when clicked

$$\alpha\beta\gamma$$

and for debugging (if image is not created and if you are the administrator).

Image itself is created separately to img tag so it does not need the link tags.

In reply to Jimmy Lambert

Re: TEX - generated GIF with an ancho

by Mauno Korpelainen -

This has been asked a couple of times before but the solution depends on your version of moodle.

In moodle 1.X you could check http://moodle.org/mod/forum/discuss.php?d=127460#p558425

In moodle 2.X file filter/tex/filter.php has code

...

    // Build the output.
    $anchorcontents = "<img class=\"texrender\" $title alt=\"$alt\" src=\"";
    if ($CFG->slasharguments) {        // Use this method if possible for better caching
        $anchorcontents .= "$CFG->wwwroot/filter/tex/pix.php/$imagefile";
    } else {
        $anchorcontents .= "$CFG->wwwroot/filter/tex/pix.php?file=$imagefile";
    }
    $anchorcontents .= "\" $style/>";

    if (!file_exists("$CFG->dataroot/filter/tex/$imagefile") && has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
        $link = '/filter/tex/texdebug.php';
        $action = null;
    } else {
        $link = new moodle_url('/filter/tex/displaytex.php', array('texexp'=>$tex));
        $action = new popup_action('click', $link, 'popup', array('width'=>320,'height'=>240));
    }
    $output = $OUTPUT->action_link($link, $anchorcontents, $action, array('title'=>'TeX')); //TODO: the popups do not work when text caching is enabled!!
    return $output;

If you set there

return $anchorcontents

it should output only img tag instead of action_link given by return $output - but I have not tested this yet...

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: TEX - generated GIF with an ancho

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Well, that is an answer... First, I did not realise that the image could be displayed without the HTML anchor but second, it then comes down to debugging. I cannot see the necessity of losing the HTML anchor, even if there appears to be no point in it being there. On the other, is there an attractiveness based around speeding page loading times up, but does it slow load time that much? Is there a cost elsewhere to show for it? Or does this optimize the code a little. How does this affect accessibility options? Will page readers still be able to translate into speach and/or Braille the rendered TeX image?    

OK, changed the code suggested in v2 and did the job...

blush I must have misunderstood, I thought he was talking about the image anchors.. duh!!! Been a hectic year.. getting tired... well that is my excuse and I am sticking to it...