Beautifying TeX source file using perl

Discussion in 'Perl' started by rgompa, Mar 29, 2008.

  1. rgompa

    rgompa

    Joined:
    Mar 27, 2008
    Messages:
    1
    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.
     
    rgompa, Mar 29, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWlrZSBNb29yZQ==?=

    Numeric Entry Only Tex Box

    =?Utf-8?B?TWlrZSBNb29yZQ==?=, Nov 12, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    16,766
    Peter Blum
    Nov 15, 2004
  2. Darren Clark

    Parsing Email bounce back tex

    Darren Clark, Feb 23, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,288
    MasterGaurav
    Feb 24, 2005
  3. David Tolpin

    ANN: TeX Hyphenator in Java

    David Tolpin, Aug 21, 2003, in forum: Java
    Replies:
    0
    Views:
    579
    David Tolpin
    Aug 21, 2003
  4. Oleg Paraschenko

    TeXML, the XML vocabulary for TeX

    Oleg Paraschenko, Apr 12, 2004, in forum: XML
    Replies:
    0
    Views:
    444
    Oleg Paraschenko
    Apr 12, 2004
  5. Neha Chopra

    Auto Complete using tex input

    Neha Chopra, Dec 7, 2007, in forum: Ruby
    Replies:
    5
    Views:
    168
    Xavier Noria
    Dec 10, 2007
Loading...

Share This Page