Hi, folks.
I am a long-time (and happy) user of TextPad. I am using version 4.7.3, paid mode.
I am about to try something new, and am hoping it can be done with TextPad: I would like line numbers to be included in the text of a document. So far, I know Preferences can be set so that line numbers will print with a document. But can I also specify a setting such that line numbers actually become part of the document, so that they get copied over to, say, a Word document?
Here's exactly what I want to do:
I have written several "C" programs in the Microsoft Visual C++ programming environment. I would like to copy the source code for those programs into webpages:
1) Cntrl-A to select everything (within the programming environment);
2) Cntrl-C to copy text;
3) Cntrl-V to paste the text into TextPad;
4) Insert the additional HTML code to convert the document into an HTML page for posting on a website.
Step 4 is the one about which I am unsure; I would like the line numbers to show up in the final webpage so that specific lines of code may be discussed in tutorials or discussions about the program.
So . . . rather than manually type in each line number, can TextPad save me this step?
Sincerely,
Michael
Including Line Numbers in Text
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Replace with to insert numbers at the beginnings of lines (the _ should be a space character) (of course, Regular expression must be selected)
Or select the first column (or any other column that should be after the line numbers) either by using the Alt key or the block select mode, then use Edit - Fill block - With numbers, set the other options as you want, then klick ok.
Code: Select all
^
Code: Select all
\i_
Or select the first column (or any other column that should be after the line numbers) either by using the Alt key or the block select mode, then use Edit - Fill block - With numbers, set the other options as you want, then klick ok.
MudGuard,
Thanks for this! I've wanted to do something like this for a long time and didn't think it could be done.
So the next question is: how would you do it so as to make the numbers align right on say three digits...e.g.:
001
010
100
Edit: With a space following the number.
001 text
010 text
Also using the block select > Fill Block method I don't seem to be able to get it to do anything but insert the numbers, even with 'leading zeros' checked. Any ideas?
Never mind! I see using block select mode you need to select the number of columns you want to allocate to the numbers. The problem remains as to how to insert a space after the numbers without a second operation.
Thanks for this! I've wanted to do something like this for a long time and didn't think it could be done.
So the next question is: how would you do it so as to make the numbers align right on say three digits...e.g.:
001
010
100
Edit: With a space following the number.
001 text
010 text
Also using the block select > Fill Block method I don't seem to be able to get it to do anything but insert the numbers, even with 'leading zeros' checked. Any ideas?
Never mind! I see using block select mode you need to select the number of columns you want to allocate to the numbers. The problem remains as to how to insert a space after the numbers without a second operation.
Best Wishes!
Mike Olds
Mike Olds
Vielen Dank, "MudGuard".
Your first suggestion works, although it will need some tweaking as line numbers go from two- to three-digit numbers (I want the "C" source code to be left-aligned smoothly, so I will probably end up padding the line-numbering field--so that it has a constant 5-space width).
However, you lost me with the second option.
I see "Fill Block..." as a selection in the "Edit" menu, but it is greyed out.
If I go to the "Configure" menu, and select "Block Select Mode", then go back to the "Edit" menu, the "Fill Block..." option is still greyed out. What am I overlooking?
Regards,
Michael
Your first suggestion works, although it will need some tweaking as line numbers go from two- to three-digit numbers (I want the "C" source code to be left-aligned smoothly, so I will probably end up padding the line-numbering field--so that it has a constant 5-space width).
However, you lost me with the second option.
I see "Fill Block..." as a selection in the "Edit" menu, but it is greyed out.
If I go to the "Configure" menu, and select "Block Select Mode", then go back to the "Edit" menu, the "Fill Block..." option is still greyed out. What am I overlooking?
Regards,
Michael