开发者

Formatting C code for a document [closed]

开发者 https://www.devze.com 2023-02-18 05:18 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_StackOverflow中文版

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

Improve this question

I am working on a book containing a number of C examples. I am looking for a way I can spit the code through a processor that will give it to me with alternating grey/white lines with line numbers and b&w only syntax highlighting.

Any suggestions?

Thanks,

Alan


Are you sure you want to use MS-Word, especially for a book text? If it's not completely required, have a look at latex and packages like:

  • listings
  • minted

Alternatively if you don't want to do full, proper text layout, just find some application which does format the code and copy&paste it. Visual Studio can copy formats apparently.


Download Notepad++ then select

TextFX -> TextFX Edit -> Reindent C++ code|Indent & surround| ...| more options

To get the colors read this question

Then just paste it in your word processor.

0

精彩评论

暂无评论...
验证码 换一张
取 消