Software for typing programming papers

In summary: It takes a little more effort to set it up, but the end result is very readable source code that looks like it was typeset in LaTeX.
  • #1
gsingh2011
115
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
  • #2
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?
 
  • #3
The syntax is only highlighted in Notepad++, copying it to another program like Word removes the formatting.
 
  • #4
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!
 
  • #5
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/
 
  • #6
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:
  • #7
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:
  • #8
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.
 
  • #9
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:

1. What is software for typing programming papers?

Software for typing programming papers is a computer program that is specifically designed to assist in writing and formatting papers related to programming. It typically includes features such as code formatting, syntax highlighting, and auto-completion to make the writing process more efficient.

2. Why is software for typing programming papers important?

Software for typing programming papers is important because it helps programmers and computer scientists to efficiently write and organize their ideas and code in a professional and user-friendly manner. It also allows for easier collaboration and sharing of code with others.

3. What are some common features of software for typing programming papers?

Some common features of software for typing programming papers include code formatting, syntax highlighting, auto-completion, spell check, and the ability to insert images, tables, and equations. Some programs may also have collaboration and version control capabilities.

4. Is software for typing programming papers free?

There are both free and paid options for software for typing programming papers. Some popular free options include Microsoft Visual Studio Code, Atom, and Sublime Text. Paid options may offer more advanced features and support.

5. Can software for typing programming papers be used for other types of writing?

While software for typing programming papers is specifically designed for programming-related writing, it can also be used for other types of writing such as technical reports, essays, or even creative writing. However, it may not have all the necessary features for these types of writing, so it's important to consider your specific needs before using it for other purposes.

Similar threads

Replies
5
Views
1K
  • Programming and Computer Science
Replies
7
Views
654
  • Programming and Computer Science
Replies
28
Views
712
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
2
Replies
37
Views
2K
  • Programming and Computer Science
Replies
29
Views
2K
  • Programming and Computer Science
Replies
12
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
256
  • Programming and Computer Science
Replies
4
Views
627
  • Programming and Computer Science
Replies
7
Views
1K
Back
Top