{"id":10393,"date":"2018-06-26T18:57:22","date_gmt":"2018-06-26T16:57:22","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=10393"},"modified":"2024-02-29T19:11:40","modified_gmt":"2024-02-29T18:11:40","slug":"syntaxhighlighter-sagt-der-daltonist-wie-kann-quellcode-java-c-c-in-ppt-oder-word-in-farbe-eingefuegt-werden","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=10393","title":{"rendered":"Syntaxhighlighter sagt der Daltonist ;-) Wie kann Quellcode (Java, C++, C &#8230;) in PPT oder Word in Farbe eingef\u00fcgt werden?"},"content":{"rendered":"<p>Manchmal braucht man f\u00fcr eine Pr\u00e4sentation oder ein Dokument farbige Beispiele von Quellcode oder auch f\u00fcr Dokus. Wie k\u00f6nnen die nun erstellt werden? Daf\u00fcr gibt es ein cooles Programm highlight von Andre Simon. Highlight konvertiert Sourcecode in XHTML, HTML, RTF, TeX, LaTeX, SVG, BBCode und Terminal Escape-Sequenzen mit farbiger Syntaxhervorhebung. Sprachdefinitionen und Farbstile sind konfigurierbar. Es werden eine ganze Menge Sprachen unterst\u00fctzt. Im Moment 215!<\/p>\n<p>Auf dem Raspberry Pi ist das Programm schnell installiert mit:<\/p>\n<pre class=\"lang:default decode:true \" >\r\n\r\nsudo apt-get install highlight\r\n\r\n# Version ausgeben mit\r\nhighlight --version\r\n# Ergebnis: highlight version 3.18\r\n\r\n# Anleitung\r\nman highlight\r\n<\/pre>\n<p>So, nun ein Beispiel, wir nehmen mal eine CPP Klasse aus meinen C++ Lehrgang, <strong>Temperatur.cpp<\/strong>, und geben die farbig auf der Konsole aus mit:<\/p>\n<pre class=\"lang:default decode:true \" >highlight -O ansi Temperatur.cpp<\/pre>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.43.15.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.43.15.png\" alt=\"\" width=\"831\" height=\"705\" class=\"aligncenter size-full wp-image-10394\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.43.15.png 831w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.43.15-300x255.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.43.15-768x652.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Nun k\u00f6nnen wir auch die Ausgabe in eine Datei im RTF Format umleiten mit:<!--more--><\/p>\n<pre class=\"lang:default decode:true \" >highlight Temperatur.cpp --style zellner -O rtf &gt; wenzlaff-info.rtf<\/pre>\n<p>So, die Datei kann nun mit Word ge\u00f6ffnet werden, dazu beim \u00f6ffnen RTF w\u00e4hlen:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.30.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.30.png\" alt=\"\" width=\"306\" height=\"222\" class=\"aligncenter size-full wp-image-10395\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.30.png 306w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.30-300x218.png 300w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/a><\/p>\n<p>und hier das Ergebnis:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.42.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.42.png\" alt=\"\" width=\"1284\" height=\"925\" class=\"aligncenter size-full wp-image-10396\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.42.png 1284w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.42-300x216.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.42-768x553.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Bildschirmfoto-2018-06-26-um-18.45.42-1024x738.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Die Datei kann man nat\u00fcrlich dann auch im Doc-Format usw. speichern und normal als Text weiterbearbeiten.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Manchmal braucht man f\u00fcr eine Pr\u00e4sentation oder ein Dokument farbige Beispiele von Quellcode oder auch f\u00fcr Dokus. Wie k\u00f6nnen die nun erstellt werden? Daf\u00fcr gibt es ein cooles Programm highlight von Andre Simon. Highlight konvertiert Sourcecode in XHTML, HTML, RTF, TeX, LaTeX, SVG, BBCode und Terminal Escape-Sequenzen mit farbiger Syntaxhervorhebung. Sprachdefinitionen und Farbstile sind konfigurierbar. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=10393\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eSyntaxhighlighter sagt der Daltonist \ud83d\ude09 Wie kann Quellcode (Java, C++, C &#8230;) in PPT oder Word in Farbe eingef\u00fcgt werden?\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,2874,5,79,1023,2752,3188],"tags":[364,2157,3322,3321],"class_list":["post-10393","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-c","category-java","category-programmierung","category-raspberry-pi","category-raspberry-pi-zero-w","category-word","tag-code","tag-farbe","tag-rtf","tag-syntaxhighlighter"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/10393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10393"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/10393\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10393"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}