I following installation and configuration instructions at teximg

But I get

[[!teximg  Error: missing tex code]]

for code

[[!teximg  $$\sin (x)$$]]

On server I do have texlive, dvips, convert installed ready. My configuration looks like

    # teximg_dvipng => 1,   # use dvipng                                                                                                                
    teximg_dvipng => 0, # use dvips and convert                                                                                                         
    # LaTeX prefix for teximg plugin                                                                                                                    
    teximg_prefix => '\\documentclass{article}                                                                                                          
    \\usepackage{amsmath}                                                                                                                               
    \\usepackage{amsfonts}                                                                                                                              
    \\usepackage{amssymb}                                                                                                                               
    \\pagestyle{empty}                                                                                                                                  
    \\begin{document}                                                                                                                                   
    ',
    # LaTeX postfix for teximg plugin                                                                                                                   
    teximg_postfix => '\\end{document}',

Any ideas why it's not working?

You haven't followed the examples properly. The code fragment needs to be inside code="", i.e. [[!teximg code="\frac{1}{2}"]]

(taken directly from teximg)

Comment by jmtd [livejournal.com] Mon May 23 14:51:41 2011