{"id":27,"date":"2011-07-07T07:09:16","date_gmt":"2011-07-07T07:09:16","guid":{"rendered":"http:\/\/florian-roemer.de\/blog\/?p=27"},"modified":"2011-07-07T08:19:20","modified_gmt":"2011-07-07T08:19:20","slug":"syntax-highlighting","status":"publish","type":"post","link":"https:\/\/florian-roemer.de\/blog\/syntax-highlighting\/","title":{"rendered":"Syntax highlighting"},"content":{"rendered":"<p>Along with advocating the pure beauty of math, parts of my blog may be about praising the pure awesomeness of MATLAB. I will say a lot more about why I have learned to love it so much later. What I will need to make these points is a decent way of performing syntax highlighting. Therefore, I gave the <a title=\"WP-syntax\" href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-syntax\/\">WP-syntax<\/a> plugin a try which supports syntax highlighting for <a title=\"Supported languages\" href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-syntax\/other_notes\/\">many languages<\/a>, including MATLAB.<\/p>\n<p>This is what it turns out to look like:<\/p>\n<pre lang=\"MATLAB\">% test\r\nF = fft(eye(4));<\/pre>\n<p>Line numbers can be added too:<\/p>\n<pre lang=\"MATLAB\" line=\"1\">% eyecandy demo: OpenGL rendering of PEAKS function using phong shading\r\n[X,Y,Z] = peaks(99);\r\nfigure(1);\r\nclf;\r\nsurf(X,Y,Z);\r\naxis vis3d;\r\ncolormap copper;\r\nshading interp;\r\nlighting phong;\r\nlight;\r\ncamlight;<\/pre>\n<p>however they do not render very nicely&#8230;<\/p>\n<p>The result of the last script would look like that:<\/p>\n<p><a href=\"http:\/\/florian-roemer.de\/blog\/wp-content\/uploads\/peaks.png\"><img loading=\"lazy\" src=\"http:\/\/florian-roemer.de\/blog\/wp-content\/uploads\/peaks-150x150.png\" alt=\"MATLAB OpenGL rendering example using PEAKS\" title=\"peaks\" width=\"150\" height=\"150\" class=\"alignnone size-thumbnail wp-image-37\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Along with advocating the pure beauty of math, parts of my blog may be about praising the pure awesomeness of MATLAB. I will say a lot more about why I have learned to love it so much later. What I will need to make these points is a decent way of performing syntax highlighting. Therefore, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/posts\/27"}],"collection":[{"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":10,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":39,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions\/39"}],"wp:attachment":[{"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}