Results 1 to 5 of 5

Thread: Printing source code

  1. #1
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Printing source code

    Hi,

    I'm writing an application for a thesis for school. We'd like to include a printout of the source code when we hand in our thesis.

    Because there a lot of source code files, printing each on individually would take a lot of time. Does anybody know if there's a program to format and print source code files? (on Linux or Windows) Or another handy way :P

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Printing source code

    The easiest way would be to just concatenate the entire lot and print that. It'll save on paper too.

    cat *.c >output
    cat *.h >>output

  3. #3
    Join Date
    Jul 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Printing source code

    Apply doxygen to your sources. You can then produce a very nice PDF with all your source code files correctly indented and formatted. Plus if you want it can also generate API documentation, inheritance graphs, etc.

    Here is a short example of source code printout.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Printing source code

    From what I know either vim or emacs (I don't remember which one) provides nice code pretty-printing capabilities. Otherwise if you want your code to look professional, use LaTeX with the listings package.

    http://ctan.org/tex-archive/macros/l...s/listings.pdf

    BTW. It's a good idea to write the thesis itself in LaTeX too.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Printing source code

    Yes, I already had written my thesis in LaTeX. And that was really much better than with Word

    Anyway, I ended up with manually creating a LaTex file (and using lstlistings), so I could remove the comments and the beginning of each file, sort the files on subject (GUI, math etc.)

Similar Threads

  1. copyright and gpl
    By janus in forum General Discussion
    Replies: 8
    Last Post: 21st October 2008, 01:13
  2. Objective C, Python and Ruby code with C++ Qt application
    By Berberis in forum Qt Programming
    Replies: 2
    Last Post: 5th June 2008, 12:40
  3. source code from Qt4 designer
    By freelancer.kiran in forum Qt Tools
    Replies: 2
    Last Post: 12th May 2008, 07:40
  4. Replies: 0
    Last Post: 28th June 2006, 20:49
  5. Replies: 11
    Last Post: 24th March 2006, 06:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.