<br />
<b>Warning</b>:  Undefined array key "HTTP_REFERER" in <b>/home/sixthfor/public_html/steve/wordpress/wp-content/plugins/search-hilite.php</b> on line <b>88</b><br />
<br />
<b>Warning</b>:  Undefined array key "HTTP_REFERER" in <b>/home/sixthfor/public_html/steve/wordpress/wp-content/plugins/search-hilite.php</b> on line <b>88</b><br />
<br />
<b>Warning</b>:  Undefined array key "HTTP_REFERER" in <b>/home/sixthfor/public_html/steve/wordpress/wp-content/plugins/search-hilite.php</b> on line <b>88</b><br />
{"id":8,"date":"2004-08-05T18:59:22","date_gmt":"2004-08-05T17:59:22","guid":{"rendered":"http:\/\/sixthform.info\/steve\/wordpress\/?p=8"},"modified":"2004-09-25T21:14:09","modified_gmt":"2004-09-25T20:14:09","slug":"using-latex-in-wordpress","status":"publish","type":"post","link":"https:\/\/sixthform.info\/steve\/wordpress\/?p=8","title":{"rendered":"Using LaTeX in WordPress"},"content":{"rendered":"<p>This is how you can use <a href=\"http:\/\/www.mayer.dial.pipex.com\/tex.htm#latexrender\"  target=\"_blank\">LatexRender<\/a> in WordPress. Assuming you have <a target=\"_blank\" href=\"javascript:void(0)\"><img src='\/steve\/wordpress\/latexrender\/pictures\/ebb782749790e72b71fcc022d944016a.gif' title='\\LaTeX ' alt='\\LaTeX ' border=0 align=absmiddle onclick=\"newWindow=window.open('\/steve\/wordpress\/latexrender\/latexcode.php?code=%5CLaTeX+','latexCode','toolbar=no,location=no,scrollbars=yes,resizable=yes,status=yes,width=375,height=100,left=200,top=100');\"><\/a> and Imagemagick setup on your server and have downloaded <a href=\"http:\/\/www.mayer.dial.pipex.com\/latexrender.zip\" >latexrender.zip<\/a> then:<br \/>\n1.  In the download folder, otherPHP\/latexrender you just need the 2 files<br \/>\nlatex.php and class.latexrender.php<br \/>\na) in <strong>latex.php<\/strong> ensure that<br \/>\n <code> $latexrender_path = \"\/home\/domain_name\/public_html\/path_to\/latexrender\";<\/code><br \/>\ncontains the correct path to where your latexrender files are to go<br \/>\n Change<br \/>\n <code>$latexrender_path_http = \"\/latexrender\";<\/code><br \/>\n so it says<br \/>\n<code>$latexrender_path_http = \"\/path_to\/latexrender\"; <\/code><\/p>\n<p><!--more--><br \/>\nb) in <strong>class.latexrender.php<\/strong> ensure that<br \/>\n<code>    var $_latex_path = \"\/usr\/bin\/latex\";<br \/>\n    var $_dvips_path = \"\/usr\/bin\/dvips\";<br \/>\n    var $_convert_path = \"\/usr\/bin\/convert\";<br \/>\n    var $_identify_path=\"\/usr\/bin\/identify\";<\/code><br \/>\npoint to the right places.<\/p>\n<p>2. Create a new latexrender folder in your WordPress folder, with sub folders tmp and pictures. These 2 folders <strong>must<\/strong> be chmod to 777 <\/p>\n<p>3. Now you need to make changes to WordPress files:<br \/>\n(a) Stop the blog eating backslashes which <a href=\"javascript:void(0)\"><img src='\/steve\/wordpress\/latexrender\/pictures\/c51d7e23458ca0e7373a8ed6ab56b2b9.gif' title='\\LaTeX' alt='\\LaTeX' border=0 align=absmiddle onclick=\"newWindow=window.open('\/steve\/wordpress\/latexrender\/latexcode.php?code=%5CLaTeX','latexCode','toolbar=no,location=no,scrollbars=yes,resizable=yes,status=yes,width=375,height=100,left=200,top=100');\"><\/a> needs for its commands<br \/>\n(i) <strong>wp-includes\/functions-formatting.php<\/strong><br \/>\nLine 233<br \/>\nAfter<br \/>\n<code>function format_to_edit($content) {<br \/>\n\t$content = stripslashes($content);<br \/>\n\t$content = apply_filters('format_to_edit', $content);<br \/>\n\t$content = htmlspecialchars($content);<br \/>\n\treturn $content;<br \/>\n}<\/code><br \/>\nAdd<br \/>\n<code>function format_to_edit2($content) {<br \/>\n\t$content = apply_filters('format_to_edit', $content);<br \/>\n\t$content = htmlspecialchars($content);<br \/>\n\treturn $content;<br \/>\n}<\/code><\/p>\n<p>(ii) <strong>wp-admin\/post.php<\/strong><br \/>\nLine 222<br \/>\nAfter<br \/>\n<code>\t\t$content = $postdata->post_content;<\/code><br \/>\nChange<code>\t\t$content = format_to_edit($content);<\/code><br \/>\nto<br \/>\n<code>\t\t$content = format_to_edit2($content);<\/code><\/p>\n<p>(b) Show <a href=\"javascript:void(0)\"><img src='\/steve\/wordpress\/latexrender\/pictures\/c51d7e23458ca0e7373a8ed6ab56b2b9.gif' title='\\LaTeX' alt='\\LaTeX' border=0 align=absmiddle onclick=\"newWindow=window.open('\/steve\/wordpress\/latexrender\/latexcode.php?code=%5CLaTeX','latexCode','toolbar=no,location=no,scrollbars=yes,resizable=yes,status=yes,width=375,height=100,left=200,top=100');\"><\/a> images in preview<br \/>\n<strong>wp-admin\/post.php<\/strong><br \/>\nLine 248<br \/>\nAfter<br \/>\n<code><\/p>\n<div class=\"storycontent\">\n< ?php\n$content = apply_filters('the_content', $post->post_content);<\/><\/div>\n<p><\/code><br \/>\nAdd<br \/>\n<code>include_once('..\/latexrender\/latex.php');<\/code><\/p>\n<p>(c ) Add a tex button to the edit box<br \/>\n<strong> wp-admin\/quicktags.js<\/strong><br \/>\nLine 131<br \/>\nBefore<br \/>\n<code>function edLink() {<\/code><\/p>\n<p>Add<br \/>\n<code>edButtons[edButtons.length] =<br \/>\nnew edButton('ed_tex'<br \/>\n,'tex'<br \/>\n,'[tex ]'<br \/>\n,'[\/tex ]'<br \/>\n,'x'<br \/>\n);<\/code><\/p>\n<p><em>remove the spaces between tex and ] above which are required here to stop WordPress thinking it&#8217;s maths<\/em> \ud83d\ude42<\/p>\n<p>(d) More stop WordPress eating backslashes<br \/>\n<strong>wp-includes\/functions.php<\/strong><br \/>\nLine 1081<br \/>\nChange<br \/>\n<code>\t\t$content = stripslashes($post->post_content);<\/code><br \/>\nto<br \/>\n<code>\t\t$content = $post->post_content;<\/code><br \/>\nLine 1089<br \/>\nChange<br \/>\n<code>\t\t$pages[0] = stripslashes($post->post_content);<\/code><br \/>\nto<br \/>\n<code>\t\t$pages[0] = $post->post_content;<\/code><\/p>\n<p>(e) Show <a href=\"javascript:void(0)\"><img src='\/steve\/wordpress\/latexrender\/pictures\/c51d7e23458ca0e7373a8ed6ab56b2b9.gif' title='\\LaTeX' alt='\\LaTeX' border=0 align=absmiddle onclick=\"newWindow=window.open('\/steve\/wordpress\/latexrender\/latexcode.php?code=%5CLaTeX','latexCode','toolbar=no,location=no,scrollbars=yes,resizable=yes,status=yes,width=375,height=100,left=200,top=100');\"><\/a> in the blog<br \/>\n<strong>wp-includes\/template-functions-post.php<\/strong><br \/>\nLine 62<br \/>\nAfter<br \/>\n<code>function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {<br \/>\n    $content = get_the_content($more_link_text, $stripteaser, $more_file);<br \/>\n    $content = apply_filters('the_content', $content);<br \/>\n    $content = str_replace(']]>', ']]&gt;', $content);<\/code><br \/>\nAdd<br \/>\n<code>    include_once('latexrender\/latex.php');<br \/>\n    $content=latex_content($content);<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is how you can use LatexRender in WordPress. Assuming you have and Imagemagick setup on your server and have downloaded latexrender.zip then: 1. In the download folder, otherPHP\/latexrender you just need the 2 files latex.php and class.latexrender.php a) in latex.php ensure that $latexrender_path = &#8220;\/home\/domain_name\/public_html\/path_to\/latexrender&#8221;; contains the correct path to where your latexrender files [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-latexrender"],"_links":{"self":[{"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8"}],"version-history":[{"count":0,"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/8\/revisions"}],"wp:attachment":[{"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sixthform.info\/steve\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}