Software for typing programming papers

Click For Summary

Discussion Overview

The discussion revolves around the challenges and tools available for formatting programming code in academic papers, particularly in comparison to LaTeX for mathematical typesetting. Participants explore various software options and their capabilities in preserving code formatting when copied into other applications.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants inquire whether there are specific tools for writing programming papers that can automatically format code, similar to LaTeX for math.
  • One participant suggests using Notepad++ for syntax highlighting but notes that copying to other programs like Word loses formatting.
  • Another participant mentions that MATLAB preserves formatting when copying code, raising the question of whether other editors can do the same.
  • There is a discussion about the nature of code formatting, with one participant arguing that automatically formatting code is not as critical as typesetting math, which requires specialized systems like LaTeX.
  • Some participants express frustration with Notepad++'s handling of formatting, while others defend its functionality as a text editor.
  • One participant recommends the "listings" package in LaTeX for including source code, asserting that it works well for this purpose.

Areas of Agreement / Disagreement

Participants express differing opinions on the effectiveness of various text editors, particularly Notepad++, and whether they meet the needs for formatting code in papers. There is no consensus on a single best solution, and multiple competing views remain regarding the tools and methods for formatting programming code.

Contextual Notes

Some limitations include the dependence on specific software capabilities, the subjective nature of user experience with different editors, and the unresolved question of how to best preserve formatting when transferring code between applications.

gsingh2011
Messages
115
Reaction score
1
Just like there's LaTeX for writing math papers and LaTeX editors to parse it, is there anything for writing papers in programming? Specifically a nice way to automatically format code.
 
Technology news on Phys.org
gsingh2011 said:
Just like there's LaTeX for writing math papers and LaTeX editors to parse it, is there anything for writing papers in programming? Specifically a nice way to automatically format code.

Couldn't you use something like notepad++ or some other program that does syntax highlighting and all that jazz and then copy the output and paste it somewhere else?
 
The syntax is only highlighted in Notepad++, copying it to another program like Word removes the formatting.
 
Oh ok that sucks. When you copy code in MATLAB it preserves the formatting and color/indentation information.

There was to be some editor out there that preserves this information when it's copied!
 
chiro said:
Oh ok that sucks. When you copy code in MATLAB it preserves the formatting and color/indentation information.

There was to be some editor out there that preserves this information when it's copied!
You mean copying from one MATLAB window to another, or copying from MATLAB to another program? If the former case, it's not actually preserving the information, it's just re-formatting it in the new window.

Anyway, automatically formatting code is not on the same level as typesetting math. Source code itself is just text, so you can type it just fine in LaTeX or anything else. Syntax highlighting and indentation and such things are just little tweaks that you can do to make the code a little more readable, kind of akin to fixing up the spelling and grammar of something you wrote and adding italics to emphasize key words. You wouldn't expect LaTeX or any other writing software to do those sorts of things automatically. In contrast, typesetting math is actually impossible with a regular text editor or word processor. You need a special system, which is what LaTeX provides.

I ran a Google search for latex code and here's the first thing that popped up: http://scott.sherrillmix.com/blog/programmer/displaying-code-in-latex/
 
gsingh2011 said:
The syntax is only highlighted in Notepad++, copying it to another program like Word removes the formatting.

If this is true, this may be an indication that Notepad++ is atrocious.

chiro said:
There was to be some editor out there that preserves this information when it's copied!

If I copy from Visual Studio or http://www.flos-freeware.ch/notepad2.html" into Word, formatting is transferred.
 
Last edited by a moderator:
In LaTeX you can use the "listings" package. Here is a nice and concise description:
http://texblog.wordpress.com/2008/04/02/include-source-code-in-latex-with-listings/"
 
Last edited by a moderator:
MisterX said:
If this is true, this may be an indication that Notepad++ is atrocious.
Actually, it's an indication that Notepad++ is good, since it's doing exactly what it's supposed to do. When I copy from a text editor and paste into another program, I expect that all I will be copying is text. Sure, sometimes copying with syntax highlighting is a useful feature, but that could be enabled with a special copy command on the Edit menu, or perhaps through the Paste Special feature in Word (I'm not sure if it works that way).

In any case, Notepad++ is widely considered to be one of the best text editors available for Windows. I've used it myself and I completely agree, it's great.
 
Edgardo said:
In LaTeX you can use the "listings" package. Here is a nice and concise description:
http://texblog.wordpress.com/2008/04/02/include-source-code-in-latex-with-listings/"

Listings works really well.
 
Last edited by a moderator:

Similar threads

Replies
38
Views
4K
Replies
5
Views
2K
Replies
7
Views
3K
Replies
16
Views
3K
  • · Replies 29 ·
Replies
29
Views
5K
Replies
37
Views
6K
  • · Replies 29 ·
Replies
29
Views
3K
Replies
9
Views
3K
  • · Replies 6 ·
Replies
6
Views
1K
Replies
7
Views
3K