3

I would like to put the following code in an article that is written in AP Style:

puts 'Hello, world!'

How do I do this? If I were to put the code (C++, Ruby, whatever) in an article that was written in a newspaper, how would I write it? Is the entire thing surrounded by quotes, brackets, etc? How do you deal with line breaks?

I didn't find any help in this guide.

Monica Cellio
  • 21,489
  • 3
  • 68
  • 110
Carl Roberts
  • 131
  • 2

1 Answers1

1

I don't believe this is specifically covered by AP style. My personal approach would be to present the code in a block quote. (Or, if it's something really short, just a different font face.) But you're not going to find a "rule" that everybody follows for this situation. It's really up to the individual publisher.

Jason Bassford
  • 2,550
  • 12
  • 21