Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

presenting code in documents.

  • 03-03-2009 4:19pm
    #1
    Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭


    I have to stick some C code into documents (.doc files) and i hate the way it's all crappily idented and no syntax highlighted.

    is there any plug-ins you can get for word/open office (preferrably word 2003) that will indent and syntax highlight portions of the document.

    also i have a word press blog where i put some snippets of code as well, and would like to know if there's a similar thing, it's no big deal if there isn't for wordpress i can live without it, but there must be something for .doc files surely?

    i've tried googling it, but as always i tend mess up the wording of the google query and end up not getting results which i expect.


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    Google Microsoft Word syntax highlighting seems to give a few good results. Or at least some good starts.


  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    if you download dev C++ for windows (you might have it already), open the C file in it. Then you can export as a RTF file, which will give you a file which word can open. It will include the formatting + syntax colouring too.... it doesn't look too bad for reports etc..


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    thanks guys, will try these out when i get home, no access to a windows pc here at work :pac:


  • Registered Users, Registered Users 2 Posts: 7,518 ✭✭✭matrim


    I'm not 100% sure with wordpress but in HTML wrapping in a <pre> tag will keep the indenting but not syntax highlighting.

    I know wiki's and such have addons to do syntax highlighting so wordpress might have something like that too

    edit : after a quick google for "wordpress code tag" http://codex.wordpress.org/Writing_Code_in_Your_Posts


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    cheers all i'm going to go down the dev c++ and export to rtf format. it's the least hassle solution :)


  • Advertisement
  • Closed Accounts Posts: 2,046 ✭✭✭democrates


    Does using the Courier font not do the job?
    Edit: forget that it only addresses indenting, sloppy glance at op on my part.


  • Registered Users, Registered Users 2 Posts: 1,512 ✭✭✭stevire


    For C++/Delphi:
    http://www.softaward.com/635.html

    For HTML/JavaScript/VBScript/PHP:
    http://www.codeproject.com/KB/COM/wordhighlight.aspx

    Both tried and tested in Word 2003


  • Registered Users, Registered Users 2 Posts: 163 ✭✭stephenlane80


    Hi,

    You can convert the code to farmatter html with this tool: http://www.carlosag.net/Tools/CodeColorizer/

    Then you can copy the formatted html into wordpress and word,

    I use latex for most of my documents which has an excelent plugin called "listing" for displaying code and stuff


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    stevire wrote: »
    For C++/Delphi:
    http://www.softaward.com/635.html

    For HTML/JavaScript/VBScript/PHP:
    http://www.codeproject.com/KB/COM/wordhighlight.aspx

    Both tried and tested in Word 2003

    cheers just tested them now and they work too.
    Hi,

    You can convert the code to farmatter html with this tool: http://www.carlosag.net/Tools/CodeColorizer/

    Then you can copy the formatted html into wordpress and word,

    I use latex for most of my documents which has an excelent plugin called "listing" for displaying code and stuff

    i was hmmming and hawing about whether or not to use latex for my document, but i thought the learning curve and the little time i had to finish this document that i'd be safer going with word.

    i also found the using Xcode on OS X will preserve the syntax hightlighting when pasting into MS word on OS X, which is what i went for in the end because Xcode seems to hightlight C GTK+ code better than the rest.


  • Registered Users, Registered Users 2 Posts: 5,618 ✭✭✭Civilian_Target


    Copy and paste from Eclipse keeps code highlighting.


  • Advertisement
  • Closed Accounts Posts: 2,039 ✭✭✭rmacm


    i was hmmming and hawing about whether or not to use latex for my document, but i thought the learning curve and the little time i had to finish this document that i'd be safer going with word.

    If it's worth anything I was in the same position when I was doing my final year project report and I decided to abandon Word and use Latex. The learning curve wasn't huge and my supervisor helped me out a bit.

    I found this tutorial pretty useful http://andy-roberts.net/misc/latex/ granted since I've started working I've been forced to learn how to use Word properly and work with styles etc which tends to make things a bit easier.


Advertisement