{"id":265,"date":"2009-04-13T14:03:15","date_gmt":"2009-04-13T14:03:15","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2009\/04\/13\/bring-along-your-syntax-highlighted-code\/"},"modified":"2018-06-18T14:24:24","modified_gmt":"2018-06-18T18:24:24","slug":"bring-along-your-syntax-highlighted-code","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2009\/04\/13\/bring-along-your-syntax-highlighted-code\/","title":{"rendered":"Bring along your syntax highlighted code"},"content":{"rendered":"<p>People often ask how they can incorporate their syntax highlighted code into other mediums, like Microsoft Word, Microsoft PowerPoint, web pages etc. There are actually a number of ways to bring along your colorful code, one of which will likely meet your needs.<\/p>\n<p><b>Microsoft Word<\/b><br \/>\nYou can paste text right into Word that you&#8217;ve copied in the MATLAB Editor, and it will be auto-magically highlighted. It doesn&#8217;t get much easier than that.<\/p>\n<div align=\"center\"><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/word.png\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/word_small.png\" alt=\"\" border=\"0\" \/><\/a><\/div>\n<p><b>Microsoft PowerPoint<\/b><\/p>\n<p>It&#8217;s not quite as simple to paste syntax-highlighted code into PowerPoint as it is in Word, but it&#8217;s still not too difficult.<\/p>\n<p>Select <b>Edit -&gt; Paste Special&#8230;<\/b>.<\/p>\n<div align=\"center\"><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/edit_menu.png\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/edit_menu_small.png\" alt=\"\" border=\"0\" \/><\/a><\/div>\n<p>In the <b>Paste Special<\/b> dialog, select <b>Formatted Text (RTF)<\/b>, and press <b>OK<\/b>.<\/p>\n<div align=\"center\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/paste_special_dialog_small.png\" alt=\"\" width=\"384\" height=\"304\" border=\"0\" \/><\/div>\n<p>That&#8217;s it.<\/p>\n<div align=\"center\"><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/power_point.png\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/power_point_small.png\" alt=\"\" border=\"0\" \/><\/a><\/div>\n<p><b>HTML<\/b><br \/>\nYou can also <tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/publish.html\">publish<\/a><\/tt> your MATLAB code to HTML, which allows you view it in a web browser or insert it into anything that can render HTML. To publish to HTML, open your file in the MATLAB Editor and press the publish (<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/edit_publish.png\" alt=\"\" border=\"0\" \/>) button (note that the default output format is HTML).<\/p>\n<div align=\"center\"><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/safari.png\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_bring_along_your_syntax_highlighted_code\/safari_small.png\" alt=\"\" border=\"0\" \/><\/a><\/div>\n<p>In general, I find that if I can show code in a syntax-highlighted form, it&#8217;s easier for the viewer to understand &#8212; hopefully you find these tips useful for doing just that.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>People often ask how they can incorporate their syntax highlighted code into other mediums, like Microsoft Word, Microsoft PowerPoint, web pages etc. There are actually a number of ways to bring&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2009\/04\/13\/bring-along-your-syntax-highlighted-code\/\">read more >><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,18],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/265"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=265"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/265\/revisions"}],"predecessor-version":[{"id":5604,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/265\/revisions\/5604"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}