Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert LaTeX to Scientific Workplace 3.0

872 views
Skip to first unread message

Alet Roux

unread,
Jul 3, 2004, 10:23:06 AM7/3/04
to
Dear all

I am looking for a tool that expands commands in a LaTeX document; for
instance, if I have something like

\newcommand{\round}[1]{\left( #1 \right)}
... $\round{...}$

then it should be converted into

... $\left(...\right)$

I am a PhD student who would like to work in LaTeX (using
TextPad/MiKTeX 2.4), but my supervisor uses Scientific Word 3.0, and I
would like to share documents with him without pain.

Thank you very much in advance.

Alet

Christopher Mabb

unread,
Jul 3, 2004, 11:44:45 AM7/3/04
to
Alet,
We'll be happy to provide technical support to your supervisor for his
copy of Scientific Word. Why not suggest it to him?
If anyone would like a free 30-day demo CD for Scientific Word (WYSIWYG
LaTeX) or Scientific WorkPlace (WYSIWYG LaTeX plus MuPAD), please just Email
us your postal address.
Cheers,

Christopher
--
Christopher Mabb, Scientific Word Ltd., UK
Tel: (0845) 766 0340; Intl: +44 (1875) 616516; Fax: (01875) 613513
Email: chris...@sciword.demon.co.uk
Web: http://www.sciword.demon.co.uk

"Alet Roux" <alet...@yahoo.co.uk> wrote in message
news:7b36150f.04070...@posting.google.com...

Alet Roux

unread,
Jul 5, 2004, 7:05:26 AM7/5/04
to
Dear Christopher

> We'll be happy to provide technical support to your supervisor for his
> copy of Scientific Word. Why not suggest it to him?

Could you please tell me how to do this simple thing? As far as I can
tell from other posts, this problem is a bit of a sticking point, and
if the makers of Scientific Workplace could provide such a tool, many
people would be better disposed towards Scientific Workplace. Mind
you, even I would be interested.

Looking forward to hearing from you.

Alet

J.S. Milne

unread,
Jul 5, 2004, 5:47:22 PM7/5/04
to
If SWP finds a line \newcommand{\ga}{\alpha} at the start of a file,
it will go through the file and replace every \ga with \alpha, however
your \newcommand is too complicated. Looks like a job for Perl.

Incidentally, you may have this problem even if your
supervisor/coworker didn't use SWP, since he may not wish to memorize
all your \newcommands. It's not really a question of converting LaTeX
to SWP but rather converting your LaTeX to something everyone else can
read.

Alet Roux

unread,
Jul 6, 2004, 8:29:33 AM7/6/04
to
g...@jmilne.org (J.S. Milne) wrote in message news:<4475a487.04070...@posting.google.com>...

> If SWP finds a line \newcommand{\ga}{\alpha} at the start of a file,
> it will go through the file and replace every \ga with \alpha, however
> your \newcommand is too complicated. Looks like a job for Perl.

(Caveat: I don't have a lot of programming experience, none in Perl.
But here's what I found out so far)

It seems to me that using regular expressions is in general an easy
solution to this problem, provided that commands/patterns don't run
over the end of lines. Unfortunately, my documents all contain quite
convoluted mathematics, and SWP limits the output width, so this is
unavoidable in my case. Another problem is the issue of nested
commands, of which I unfortunatley tend to have very many in my
documents.

Have tried the (new?) Perl package Latex-parser, without success
(yet). This package tokenizes the whole file, and returns a list (it
doesn't descend into nested commands).

Next thing, I'll try the (more mature?) Latex::TOM package (available
at http://br.endernet.org/~akrowne/elaine/latex_tom/), which seems
more suitable to my purposes, as it seems to handle nested commands
automatically, and has more replacement and output routines. I'll have
a look at this soon.

> Incidentally, you may have this problem even if your
> supervisor/coworker didn't use SWP, since he may not wish to memorize
> all your \newcommands. It's not really a question of converting LaTeX
> to SWP but rather converting your LaTeX to something everyone else can
> read.

Good point, actually. I intend to have this done both ways, so I can
have either my flavour of LaTeX or portable LaTeX (my immediate
concern is SWP, though). I'm actually quite surprised that something
like this doesn't already exist -- will post whatever good news I
have.

Philip A. Viton

unread,
Jul 6, 2004, 9:09:59 AM7/6/04
to
In article <4475a487.04070...@posting.google.com>,
g...@jmilne.org says...

> If SWP finds a line \newcommand{\ga}{\alpha} at the start of a file,
> it will go through the file and replace every \ga with \alpha, however
> your \newcommand is too complicated. Looks like a job for Perl.

Another possibility here is to put all your \newcommands into a separate
style file, and then load that style in the preamble. This will prevent
SWP from making (or trying to make) the substitutions. The effect will
(?should) be that all your macros will appear in the document as "TeX
fields", which will at least make it loadable by SWP.

But I do agree with the continuation below: the fact that the document
can be loaded in SWP won't make it easy to work with.


>
> Incidentally, you may have this problem even if your
> supervisor/coworker didn't use SWP, since he may not wish to memorize
> all your \newcommands. It's not really a question of converting LaTeX
> to SWP but rather converting your LaTeX to something everyone else can
> read.
>

--


Phil Viton
Ohio State University

0 new messages