From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhiqiu Kong Subject: Re: Incomplete syntax highlight for C++ code Date: Sat, 18 Feb 2012 17:47:16 -0800 Message-ID: References: <8762f4tarv.fsf@gmx.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0015175cf796ba2e5104b9475c92 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyvsL-0001D2-L9 for emacs-orgmode@gnu.org; Sat, 18 Feb 2012 20:47:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyvsI-0005pg-Hv for emacs-orgmode@gnu.org; Sat, 18 Feb 2012 20:47:41 -0500 Received: from mail-bk0-f41.google.com ([209.85.214.41]:38223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyvsI-0005oq-8f for emacs-orgmode@gnu.org; Sat, 18 Feb 2012 20:47:38 -0500 Received: by bkty12 with SMTP id y12so4645598bkt.0 for ; Sat, 18 Feb 2012 17:47:36 -0800 (PST) In-Reply-To: <8762f4tarv.fsf@gmx.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org --0015175cf796ba2e5104b9475c92 Content-Type: text/plain; charset=UTF-8 Hi Eric, Thank you so much for your reply and helpful suggestions. I looked into the source of org-mode but as I am not familiar with elisp, I failed to get it. Then I tried to not load my customized settings and tried org-mode export again. And finally I found out it was due to another .el I loaded, which is called highlight-80+ (http://nschum.de/src/emacs/highlight-80+/). Although I do not know why they conflict, org-mode export function works perfectly after I disabled highlight-80+. :D But it will be great if someone is able to and would like to look into this and get a fix to it. As someone else may encounter the same problem as me. Thanks, -Zhiqiu On Sat, Feb 18, 2012 at 7:21 AM, Eric Schulte wrote: > Hi Zhiqiu, > > First, I would look at the actual text of the exported html code > example. It likely contains css code specifying how to fontify many > elements of the code block (e.g., on my system your example exports to > the following html [1]). You can then add css to your org-mode file > specifying what colors to use for each code class. > > Also, see the `org-export-htmlize-output-type' variable. > > Best, > > Zhiqiu Kong writes: > > > Hi, > > > > I am a new org-mode user and am trying to take notes with it. As I put > > source code into my codes a lot, I love the integration with htmlize > pretty > > much. However, I found the syntax highlight on exported html file is not > > as what I see in Emacs. To be more specific, only comments and string > > literals are colored, which is shown in http://img.ly/dXTK. And here is > > what is looks like in Emacs: http://img.ly/dXU6. > > > > Actually, what I expected is the keywords such as int, return should at > > least be colored, which is as introduced by emacs-fu ( > > > http://emacs-fu.blogspot.com/2009/05/writing-and-blogging-with-org-mode.html > > ). > > > > I checked out the latest org-mode (Org-mode version 7.8.03 > > (release_7.8.03.336.gdf0a9) ) and htmlize (for git repository), but the > > problem remains. Moreover, here is my project setting: > > > > (setq org-publish-project-alist > > '(("note-org" > > :base-directory "~/Docs/notes/org/" > > :publishing-directory "~/Docs/notes/html/" > > :htmlized-source t > > :base-extension "org" > > :sub-superscript nil > > :recursive t > > :publishing-function org-publish-org-to-html > > ;; :org-export-htmlize-output-type "css" > > :html-extension "html" > > :auto-index t > > :index-filename "index.org" > > :index-title "My Notes" > > :link-home "index.html" > > ;; :section-numbers nil > > :style " > href=\"css/worg.css\" > > type=\"text/css\"/>") > > ("note-static" > > :base-directory "~/Docs/notes/org/" > > :publishing-directory "~/Docs/notes/html/" > > :recursive t > > :base-extension > > "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|el" > > :publishing-function org-publish-attachment) > > ("My Notes" > > :components ("note-org" "note-static") > > :auto-sitemap t > > :auto-index t > > ))) > > > > Any suggestion on how to debug and fix this problem? Or this is normal? > > Thanks a lot!! > > > > > > Thanks, > > -Zhiqiu > > > Footnotes: > [1]
int
> main(){
>  std::cout <<  style="color: #a5c261;">"hello" << std::endl;
> }
> 
> > > -- > Eric Schulte > http://cs.unm.edu/~eschulte/ > --0015175cf796ba2e5104b9475c92 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Eric,

Thank you so much for your reply and helpful su= ggestions. I looked into the source of org-mode but as I am not familiar wi= th elisp, I failed to get it. Then I tried to not load my customized settin= gs and tried org-mode export again. And finally I found out it was due to a= nother .el I loaded, which is called highlight-80+ (http://nschum.de/src/emacs/highlight-80+/).=C2=A0

Although I do not know why they conflict, org-mode expo= rt function works perfectly after I disabled highlight-80+. :D But it will = be great if someone is able to and would like to look into this and get a f= ix to it. As someone else may encounter the same problem as me.


Thanks,
-Zhiqiu

= On Sat, Feb 18, 2012 at 7:21 AM, Eric Schulte <eric.schulte@gmx.com> wrote:=
Hi Zhiqiu,

First, I would look at the actual text of the exported html code
example. =C2=A0It likely contains css code specifying how to fontify many elements of the code block (e.g., on my system your example exports to
the following html [1]). =C2=A0You can then add css to your org-mode file specifying what colors to use for each code class.

Also, see the `org-export-htmlize-output-type' variable.

Best,

Zhiqiu Kong <breaddawson@gmail.= com> writes:

> Hi,
>
> I am a new org-mode user and am trying to take notes with it. As I put=
> source code into my codes a lot, I love the integration with htmlize p= retty
> much. =C2=A0However, I found the syntax highlight on exported html fil= e is not
> as what I see in Emacs. To be more specific, only comments and string<= br> > literals are colored, which is shown in http://img.ly/dXTK. And here is
> what is looks like in Emacs: http://img.ly/dXU6.
>
> Actually, what I expected is the keywords such as int, return should a= t
> least be colored, which is as introduced by emacs-fu (
> http://emacs-fu.blogspot.com/2009/05/w= riting-and-blogging-with-org-mode.html
> ).
>
> I checked out the latest org-mode (Org-mode version 7.8.03
> (release_7.8.03.336.gdf0a9) ) and htmlize (for git repository), but th= e
> problem remains. Moreover, here is my project setting:
>
> (setq org-publish-project-alist
> =C2=A0 =C2=A0 =C2=A0 '(("note-org"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:base-directory "~/Docs/notes/o= rg/"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:publishing-directory "~/Docs/n= otes/html/"
> =C2=A0:htmlized-source t
> =C2=A0:base-extension "org"
> =C2=A0:sub-superscript nil
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:recursive t
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:publishing-function org-publish-org= -to-html
> =C2=A0;; :org-export-htmlize-output-type "css"
> =C2=A0:html-extension "html"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:auto-index t
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:index-filename "index.org"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:index-title "My Notes" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:link-home "index.html" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; :section-numbers nil
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:style "<link rel=3D\"s= tylesheet\"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 href=3D\"= css/worg.css\"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 type=3D\"= text/css\"/>")
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("note-static"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:base-directory "~/Docs/notes/o= rg/"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:publishing-directory "~/Docs/n= otes/html/"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:recursive t
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:base-extension
> "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|= el"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:publishing-function org-publish-att= achment)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("My Notes"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:components ("note-org" &q= uot;note-static")
> =C2=A0:auto-sitemap t
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:auto-index t
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)))
>
> Any suggestion on how to debug and fix this problem? Or this is normal= ?
> Thanks a lot!!
>
>
> Thanks,
> -Zhiqiu


Footnotes:
[1] =C2=A0<pre class=3D"src src-c++"><span style=3D"= ;color: #ffffff;">int</span> <span style=3D"color: #f= fc66d;">main</span>(){
=C2=A0<span style=3D"color: #6d9cbe;">std</span>::co= ut &lt;&lt; <span style=3D"color: #a5c261;">"h= ello"</span> &lt;&lt; <span style=3D"color: #6d9= cbe;">std</span>::endl;
}
</pre>


--
Eric Schulte
http://cs.unm.ed= u/~eschulte/

--0015175cf796ba2e5104b9475c92--