Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index



I used NoteTab [free] and NotePad ++ as my first Windows programming and HTML editor.

Having the extension to do the highlighting in Writer is a good idea though.

If I remember correctly, for the Note. . . editors you can find "add ons" that are specific to the programming code. I have not tried them in a few years, but they were a real big aid to my early programming within the Windows environment. I do not remember when I installed the first one, but it was in the early days of my having dial-up Internet access, or a little later. I do not remember if I got online with Win 95 or 98 era. but I know I used them when I was using he "new" Windows version - XP.

Would you tell us how large of a document these code samples will be in?

Are you writing a programming guide type of documentation?

Hopefully the RTF formatting option works. Sometimes pictures of text do not work well, since the snapshot resolution and the print resolution could be very different. I tend to have to make 600 DPI scanned images to get a decent "near 1 to 1 size" image when I print out a "best" print option.

If you need to do the snapshot, I would run the image through a scaling option, with a edge smoothing "effect", to make the image in a large enough DPI and actual print size for your needs that actually look well.

On 08/12/2013 09:13 AM, William Drago wrote:
I do this all the time using the syntax highlighter in Notepad++.

If you don't have Notepad++ (my favorite code/text editor), get it here: http://notepad-plus-plus.org/

Here's how to get syntax highlighted code into your LibreOffice documents:

1: Open source file with Notepad++
2: In Notepad++ click Plugins > NppExport > Export to RTF

You will now have a syntax highlighted copy of your source file however, it will be double spaced. To remove the extra spaces proceed as follows:

1: With any editor, open the .rtf file you just created
2: Search and replace "\par" with "\line"
3: Save file

Open the .rtf file with LibreOffice Writer, select all (CTRL-A), copy & paste into your working document.

This sounds like a bit of an ordeal, but I do this quite frequently, and once you've done it a few times, it becomes very fast and easy.

Good luck,

-Bill





On 8/11/2013 9:22 PM, aihaike wrote:
Hey Miguel,

thank you for you reply.
This the kind of macro I need but it does not seem to work with LibreOffice
4 unfortunately.
I think I'm going to make a snapshot of my codes and include them  as a
picture.
          Éric.



--
View this message in context: http://nabble.documentfoundation.org/Including-code-example-in-documents-tp4069680p4069685.html
Sent from the Users mailing list archive at Nabble.com.





--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.