Keynote code highlighted [go]

Source: Internet
Author: User

Even if I do PPT, I can't do without code. In keynote, if I want to paste the code, how can I highlight the syntax?

Supplement 1, this feature is supported by pygments, so the Supported languages can be seen in: http://pygments.org/languages/

Supplement 2: directly convert the content in the clipboard in the following section and set the language to-s py. py indicates that if the code is saved as a file, it should be. PY, so if you want to paste a piece of objective-C code, it is obviously-s m.

The original text and source are reproduced as follows without further translation:

Http://www.peterbe.com/plog/highlighted-code-syntax-in-keynote

Do you want to display some code in a keynote presentation?

It's easy. All you need is homebrew installed.

First you need to install the program highlight.

 
$ Brew install highlight

So you have a piece of code. For example some Python code. The take that snippet of code and save it to a file likeCode. py. Now all you need to do is run this:

 
$ Highlight-o rtf code. py | pbcopy

Then, switch back into keynote and simply paste.

But if you don't want to create a file of the snippet, simply copy the snippet from within your editor and run this:

 
$ Pbpaste | highlight-s Py-o rtf | pbcopy

The-S pyMeans "syntax is py (for Python )".

You can useHighlightFor a bunch of other things like creating html. SeeMan highlightFor more tips.

Keynote code highlighted [go]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.