I am sure it was asked before, but a search in the archives didn't turn up a solution. I am writing my master's thesis and I need to include C-code in my document. I would like it to be colored and have line numbers.
There is a nice Copy as RTF command in Textmate that would do everything I need, except it doesn't work, if I add line numbers manually because this obviously breaks the code structure and highlighting breaks. So the line numbering will have to be done after the code is colorized.
I would like to have RTF text since I want to paste it into Word later. (Maybe I shouldn't use Word O_o )
I am sure some of you have had the same problem and maybe someone has a working solution. I also couldn't find any commandline tool that would read and write rtf line by line, which would be a simple post-processing step then to add the numbering. It might be possible to change the original Copy as RTF Bundle, but having a quick look inside it was a bit tricky to find where to add the necessary code.
Help is greatly appreciated.
Thomas
perhaps this is a bit uncool - but have you tried using TextWrangler to do this? it's free. I don't care for it as a IDE but there are some text manipulations that are far easier to do (as one off's) in TextWrangler...
On Apr 15, 2011, at 9:19 AM, Thomas Krajacic wrote:
I am sure it was asked before, but a search in the archives didn't turn up a solution. I am writing my master's thesis and I need to include C-code in my document. I would like it to be colored and have line numbers.
There is a nice Copy as RTF command in Textmate that would do everything I need, except it doesn't work, if I add line numbers manually because this obviously breaks the code structure and highlighting breaks. So the line numbering will have to be done after the code is colorized.
I would like to have RTF text since I want to paste it into Word later. (Maybe I shouldn't use Word O_o )
I am sure some of you have had the same problem and maybe someone has a working solution. I also couldn't find any commandline tool that would read and write rtf line by line, which would be a simple post-processing step then to add the numbering. It might be possible to change the original Copy as RTF Bundle, but having a quick look inside it was a bit tricky to find where to add the necessary code.
Help is greatly appreciated.
Thomas
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
AFAIK Textwrangler is just a text editor and hence can also not deal with RTF text. It would have to have an "export as RTF with line numbers" function to do what I want, which I highly doubt. And I don't think that any text editor tops Textmate in extensibility by means of scripting ;)
On 15 Apr 2011, at 18:28, plastichairdoo wrote:
perhaps this is a bit uncool - but have you tried using TextWrangler to do this? it's free. I don't care for it as a IDE but there are some text manipulations that are far easier to do (as one off's) in TextWrangler...
On Apr 15, 2011, at 9:19 AM, Thomas Krajacic wrote:
I am sure it was asked before, but a search in the archives didn't turn up a solution. I am writing my master's thesis and I need to include C-code in my document. I would like it to be colored and have line numbers.
There is a nice Copy as RTF command in Textmate that would do everything I need, except it doesn't work, if I add line numbers manually because this obviously breaks the code structure and highlighting breaks. So the line numbering will have to be done after the code is colorized.
I would like to have RTF text since I want to paste it into Word later. (Maybe I shouldn't use Word O_o )
I am sure some of you have had the same problem and maybe someone has a working solution. I also couldn't find any commandline tool that would read and write rtf line by line, which would be a simple post-processing step then to add the numbering. It might be possible to change the original Copy as RTF Bundle, but having a quick look inside it was a bit tricky to find where to add the necessary code.
Help is greatly appreciated.
Thomas
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
you're right about the lack of RTF export - forgot about that! and you're correct about TM and scripting - but sometimes I just want to do some quick text manipulation and don't feel like brushing up on my Ruby! I find I use TextWrangler about once every couple of months for a specific job...
anyway - what about using Markdown?
On Apr 15, 2011, at 9:36 AM, Thomas Krajacic wrote:
AFAIK Textwrangler is just a text editor and hence can also not deal with RTF text. It would have to have an "export as RTF with line numbers" function to do what I want, which I highly doubt. And I don't think that any text editor tops Textmate in extensibility by means of scripting ;)
On 15 Apr 2011, at 18:28, plastichairdoo wrote:
perhaps this is a bit uncool - but have you tried using TextWrangler to do this? it's free. I don't care for it as a IDE but there are some text manipulations that are far easier to do (as one off's) in TextWrangler...
On Apr 15, 2011, at 9:19 AM, Thomas Krajacic wrote:
I am sure it was asked before, but a search in the archives didn't turn up a solution. I am writing my master's thesis and I need to include C-code in my document. I would like it to be colored and have line numbers.
There is a nice Copy as RTF command in Textmate that would do everything I need, except it doesn't work, if I add line numbers manually because this obviously breaks the code structure and highlighting breaks. So the line numbering will have to be done after the code is colorized.
I would like to have RTF text since I want to paste it into Word later. (Maybe I shouldn't use Word O_o )
I am sure some of you have had the same problem and maybe someone has a working solution. I also couldn't find any commandline tool that would read and write rtf line by line, which would be a simple post-processing step then to add the numbering. It might be possible to change the original Copy as RTF Bundle, but having a quick look inside it was a bit tricky to find where to add the necessary code.
Help is greatly appreciated.
Thomas
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Maybe just take screenshots as PDF or PNG, and put those into Word... You can grab a sub-page selection with Shift-Command-4 (drag crosshairs to select and grab). If you also hold the Control key down at the same time, the clip goes to your clipboard rather than the Desktop. And then you can simply paste into Word.
Walter
On Apr 15, 2011, at 12:36 PM, Thomas Krajacic wrote:
AFAIK Textwrangler is just a text editor and hence can also not deal with RTF text. It would have to have an "export as RTF with line numbers" function to do what I want, which I highly doubt. And I don't think that any text editor tops Textmate in extensibility by means of scripting ;)
On 15 Apr 2011, at 18:28, plastichairdoo wrote:
perhaps this is a bit uncool - but have you tried using TextWrangler to do this? it's free. I don't care for it as a IDE but there are some text manipulations that are far easier to do (as one off's) in TextWrangler...
On Apr 15, 2011, at 9:19 AM, Thomas Krajacic wrote:
I am sure it was asked before, but a search in the archives didn't turn up a solution. I am writing my master's thesis and I need to include C-code in my document. I would like it to be colored and have line numbers.
There is a nice Copy as RTF command in Textmate that would do everything I need, except it doesn't work, if I add line numbers manually because this obviously breaks the code structure and highlighting breaks. So the line numbering will have to be done after the code is colorized.
I would like to have RTF text since I want to paste it into Word later. (Maybe I shouldn't use Word O_o )
I am sure some of you have had the same problem and maybe someone has a working solution. I also couldn't find any commandline tool that would read and write rtf line by line, which would be a simple post-processing step then to add the numbering. It might be possible to change the original Copy as RTF Bundle, but having a quick look inside it was a bit tricky to find where to add the necessary code.
Help is greatly appreciated.
Thomas
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Did you try https://github.com/drnic/copy-as-rtf-tmbundle
I do not know who did write it actually and I believe I was involved in that but it should do your desired job.
Cheers, --Hans
That bundle I was referring to in my original post. It doesn't add line numbers though which is it's only shortcoming (for my purpose).
On 15 Apr 2011, at 18:55, Hans-Jörg Bibiko wrote:
Did you try https://github.com/drnic/copy-as-rtf-tmbundle
I do not know who did write it actually and I believe I was involved in that but it should do your desired job.
Cheers, --Hans
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
another options is to do - Bundle TextMate > Create HTML from Document with Line Numbers - Show Preview that new generated HTML code - Select all in the HTML window and Copy it ... then eg paste it into TextEdit (rich text mode)
but one should have some problems with long lines
[Meanwhile I'm looking for my own bundle command because it got rid of displaying line numbers]
--Hans
I totally missed the HTML with line numbers command! This is awesome! True about the long lines being problematic though. But I can manually wrap my code before output. I usually wrap to 80 columns anyway, since the automatic wrapping is not properly indenting unfortunately.
THX for the hint!
On 15 Apr 2011, at 20:18, Hans-Jörg Bibiko wrote:
another options is to do
- Bundle TextMate > Create HTML from Document with Line Numbers
- Show Preview that new generated HTML code
- Select all in the HTML window and Copy it
... then eg paste it into TextEdit (rich text mode)
but one should have some problems with long lines
[Meanwhile I'm looking for my own bundle command because it got rid of displaying line numbers]
--Hans
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate