I wanted to write a program in perl to clean up source file in TeX.
Source file is an ascii file in which there are special character that indicate special functions. For example, rest of the line after % will be ignored by TeX; any word that start with \ is a command which may not or may have any number of arguments enclosed in {}. Here is my plan for now:
original text:
this is a great project. % this is just my opinion.
% You may disagree.
What do you think?
changed text:
this is a great project.
%%%%%%%%%%%%
%% this is just my opinion.
%% You may disagree.
%%%%%%%%%%%%
What do you think|?
Original text:
Please help me. \yourkindness{will be}{rewarded} by someone. %May not be me.
changed text:
Please help me.
\yourkindness
{will be}
{rewarded}
%%%%%%%%%%%%
%% My not be me.
%%%%%%%%%%%%
Original text:
I would like to convey my \thanks in advance.
Changed text:
I would like to convey my
\thanks
in advance.
Each line in changed text should have atmost 100 characters and
it should not break any word from the orignal text.
Are there any programs already out there with these features?
Will you please give me some suggestions how I can write such a program
in perl?
Thanks.
Source file is an ascii file in which there are special character that indicate special functions. For example, rest of the line after % will be ignored by TeX; any word that start with \ is a command which may not or may have any number of arguments enclosed in {}. Here is my plan for now:
original text:
this is a great project. % this is just my opinion.
% You may disagree.
What do you think?
changed text:
this is a great project.
%%%%%%%%%%%%
%% this is just my opinion.
%% You may disagree.
%%%%%%%%%%%%
What do you think|?
Original text:
Please help me. \yourkindness{will be}{rewarded} by someone. %May not be me.
changed text:
Please help me.
\yourkindness
{will be}
{rewarded}
%%%%%%%%%%%%
%% My not be me.
%%%%%%%%%%%%
Original text:
I would like to convey my \thanks in advance.
Changed text:
I would like to convey my
\thanks
in advance.
Each line in changed text should have atmost 100 characters and
it should not break any word from the orignal text.
Are there any programs already out there with these features?
Will you please give me some suggestions how I can write such a program
in perl?
Thanks.