Menu

#25 use macros in latex file to control the selection of sources

open
nobody
None
9
2012-10-30
2005-11-04
James Luo
No

I am a PhD student and I always prefer latex rather than
Word. I hope what I will say can represent some major
desires of research students.

When we want to convert tex files to rtf files, our
purpose is to send a Word file to our supervisors or
cooperators who don't use latex. For example my
supervisor wants to comment on a rtf/Words file and
keep revision tracks. Therefore if I need to discuss with
him on a draft of paper or a report, I have to convert my
tex file to a rtf file. Then he makes some revisions and I
input his revisions into my tex file. A few days later we
will have another meeting and I have to convert my tex
file to a rtf file again.

The trouble is that for the first meeting I would use
latex2rtf to convert a tex file to a rtf file. The generated
rtf file normally have some format problems (mostly on
tables and figures). So I do some manual works to
correct or improve the rtf file. The rtf file is now close to
Word file and my supervisor will be happy. But for the
next meeting, if I use latex2rtf to convert new version of
latex files to rtf files, I have to do similar manual works
again. That is annoying especially when one is writing
his PhD thesis, there will be many rounds of revisions.
As can be seen latex2rtf are not able to remember what
I have improved.

Note that what will be changed frequently by the
supervisors are mostly plain texts, and they rarely
change the figures and tables.

So why not give latex2rtf users a change to save and
retrieve well-formatted version of figures and tables? Let
these figures and tables have their own individual files
that independent of latex and latex2rtf. These files may
be png files, XML files, Eq codes. What latex2rtf will do
is to insert their contents into the correct positions of rtf
files.

It won't take much time to build up these independent
files. And such works are once for all. After that we
don't need to care whether latex2rtf can handle orginal
latex codes well or bad.

For example the approach used by Scientific Workplace
is a good choice, namely by defining some special
commented macros in the latex file. This is indeed very
convenient. For example

\begin{equation}
%L2RDATA{link=eqabc.xml}
....
\end{equation}

\begin{figure}
%L2RDATA{link=figabc.png}
.....
\end{figure}

\begin{table}
....
%L2RDATA{link=tababc.xml}
\end{table}

What a user need to do is to produce these files once
and organize these files. There are also free tools for
converting RTF tables to XML and XML to RTF tables.

Look forward to your reply!!!

Discussion

  • James Luo

    James Luo - 2005-11-05

    Logged In: YES
    user_id=1373217

    As developers and other people have discussed in the
    mailling list, Microsoft doesn't open the standards of
    Microsoft Equation OLE, and it is hard
    to produce Microsoft Equation OLE from Latex.

    However if we produce some equations within Microsoft Word
    and save it as rtf file,
    we can find the ASCII code for the equations, for example:

    {*\objclass Equation.DSMT4}{*\objdata .......}

    Therefore my suggestions make sense.
    1. Save {*\objclass Equation.DSMT4}{*\objdata .......} as an
    individual txt file.
    2. Specify Latex2rtf's own macros and use them inside a tex
    file. The macros are commented so won't interfere Latex. The

    For example

    \begin{equation}
    %L2RDATA{link=./eqabc.txt}
    ....
    \end{equation}

    This macro will just insert the text {*\objclass
    Equation.DSMT4}{*\objdata .......} into the rtf file.
    Such macros will allow Latex users more freedom to make rtf
    files.

     
  • James Luo

    James Luo - 2005-11-05

    Logged In: YES
    user_id=1373217

    There is a more convenient way.

    Let Latex2rtf users produce a rtf file containing multiple
    equations they want to include. These equations can be input
    easily in Word or WordPad. It is not a problem to
    recommend people to input equations based on certain
    format provided by Latex2rtf (e.g. special string may be
    helpful for Latex2rtf to locate useful strings such SEQ fields).
    Latex2rtf can even provide a rtf template and let users to fill in
    equations at specified positions.

    If Latex2rtf can extract equations according to their index or
    order, for example based on the following code, Latex2rtf will
    insert the 2nd equation in eqs_ch1.rtf into the final rtf file.

    \begin{equation}
    %L2RDATA{link=eqs_ch1.rtf,index=2}
    ....
    \end{equation}

    Then a user only needs to collect those equations that are
    not produced well by Latex2rtf from the first converted rtf file,
    put them in another rtf or the template rtf and format them.

     

Log in to post a comment.