views:

292

answers:

1

I was wondering if anyone knew how to beautify or format JSON inside a Latex document. I am using Lyx as a front-end for writing the latex file. Are there any addons that people use? I tried to search but am not able to get anything relevant.

+1  A: 

I do embed code into lyx mostly as program listings imported from external textfiles. There are numerous options that you could apply to the program listing, from line numbers to word wraps and many more.

BeowulfOF
Autoformatting isn't one of those, though. At least `listings` doesn't have the option as the approach to prettifying is rather braindead anyway (just literal/keyword highlighting instead of understanding the grammar).
Joey
I guess I'm missing something here. So, I've used listing to insert the JSON but what am I expecting here because I don't see any significant difference in the generated PDF. I mean, leave alone the keyword highlighting, I don't even see any formatting. Any inputs?
Legend
Never mind. I missed the settings option. I'm playing with it now.
Legend
And of course, unfortunately, there is no option for JSON.
Legend
What options do you use right now?
BeowulfOF