MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: LaTex on a Mac

  • To: mathgroup at smc.vnet.net
  • Subject: [mg18702] Re: LaTex on a Mac
  • From: Paul Abbott <paul at physics.uwa.edu.au>
  • Date: Sat, 17 Jul 1999 02:36:29 -0400
  • Organization: University of Western Australia
  • References: <7mei23$9es@smc.vnet.net> <7mjse0$fck@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Jens-Peer Kuska wrote:

> I type some text as a section header, in TeX I can simply say
> \section{some text}
> I don't have to touch the mouse. I Mathematica I have typical to type
> the text, select the cell with the mouse and can use Alt-4.

Why not use Alt-4 and then type the text?  No need to use the mouse.

> Next example: I will type a file name. Typical I use different font
> shapes to decide between filenames, Mathematica Indentifers ... In TeX I
> have a
> nice macro say \FileReference{}. Now I can simply type
> \FileReference{someinput.m}
> In Mathematica I have to make a new cell style "FileReference" and than
> I create a palette that makes from a selected text a new
> StyleBox[_,"FileReference"].
> Even with the best collection of keyboard short cuts I can't avoid to
> use a mouse.

Not true. Define the style and position it in your stylesheet so that it is
one of the first 9 (listed) styles. If it is, say, the 6th style then Alt-6
will work.

> More over if my publisher say : Make a separate index of all the file
> names you have referenced I just change my TeX macro a bit and it will
> work
> for the next 100 years.

I still don't see your point? You can do this in Mathematica too.

> An other example, I have two macros \diff{f}{t} and \Diff{f}{t} to
> typeset \frac{\partial f}{\partial t} and \frac{\DifferentialD
> f}{\DifferntialD t}.
> Clearly the macros save a lot of typing.

Well, not in this example. In both cases you can get the desired output
with 12 keystrokes, e.g.,

    : p d : f : / : p d : t

(where : represents \[EscapeKey]) but typing your macro takes 11
keystrokes.

> How ever neither a style box
> will manage this because I have two parameter nor a automatic replacement
> will help
> me because the automatic replacement don't kow what to use for the
> parameters and I can't have two selections.

You could use Evaluate in Place as shown in the following example:

Notebook[{
Cell["Make the following (macro) definition:", "Text"],

Cell[BoxData[
    FormBox[
      RowBox[{\(diff[x_]\), ":=",
        RowBox[{"HoldForm", "[",
          FractionBox[\(\[PartialD]f\), \(\[PartialD]x\),
            MultilineFunction->None], "]"}]}], TraditionalForm]], "Input"],

Cell[TextData[{
  "(the ",
  Cell[BoxData[
      FormBox[
        StyleBox["HoldForm",
          "Input"], TraditionalForm]]],
  " prevents the evaluation of the derivative)."
}], "Text"],

Cell["\<\
In the following text cell I have created an inline cell (using \
\[ControlKey]\[LeftModified]9\[RightModified] and ended by \[ControlKey]\
\[LeftModified]0\[RightModified]):\
\>", "Text"],

Cell[TextData[{
  "The derivative is ",
  Cell[BoxData[
      \(TraditionalForm\`diff[x]\)]],
  "."
}], "Text"],

Cell[TextData[{
  "Now I select the contents of the inline cell, ",
  Cell[BoxData[
      \(TraditionalForm\`diff[x]\)]],
  ", and do an Evaluate in Place (\[CommandKey]-\[ReturnKey]). Here is what
I \
get:"
}], "Text"],

Cell[TextData[{
  "The derivative is ",
  Cell[BoxData[
      FormBox[
        TagBox[
          FractionBox[\(\[PartialD]f\), \(\[PartialD]x\),
            MultilineFunction->None],
          HoldForm], TraditionalForm]]],
  "."
}], "Text"]
}
]

> Ok I can make a palette with
> placeholders but than I have t use the mouse again and it is always
> slower than to type $\diff{f}{t}$.

My mouse is a touchpad and this is right next to the keyboard -- so there
is no speed penalty.

> More over if it turns out that my publisher don't like the \DifferntialD
> and would like to see a \mathrm{d} instead, it take me a smile in TeX to
> change
> that. Mathematica's expanded version will cause that I have to change
> every
> used \Diff{} because it is expanded.

Leave the Mathematica macros unevaluated (i.e. do not do the Evaluate in
Place). Then, with one click of a button you can find all inline cells and
do Evaluate in Place.

> The next example is a typical german case. I german you may type
> "Schroedinger Gleichung" or "Schroedinger-Gleichung" for the
> Schroedinger equation. It depend on your personal taste to use a hyphen
> or not. How
> ever it is important that the document does not mix up the two versions.
> In
> TeX you can simply make a macro \SEqn and all works fine. A key event
> translation will not help me because it expands the definition when I
> type it in.
> If it turns out that I have written "Legendre-Polynome" (with hyphen)
> but "Schroedinger Gleichung" (with out a hypen)
> I have to change the expanded sequences in Mathematica, in TeX I can
> just modify my macros and I have a consistent naming scheme.

And in the front end you can just do a find and replace?

> The general advice while preparing a document is
> a) think about all the typographic elements you whant to use
> b) make macros for *every*, absolute every typographic element
> c) use the macros stricly in the text to keep the logical markup
>    independent of the layout

This is one way of doing things. Another is to use a well-defined
StyleSheet.

> The Frontend make it extrem complicated to make a well structured
> document.

It depends. You are obviously proficient at TeX. I use TeX but prefer the
front end. It would be interesting
to have a document formatting "race" ...

> Finaly I would end up with a over crowded screen for my
> 30 markup macros and I would be still unable to use more than one
> parameter for a StyleBox[].

I do not understand this comment.

Cheers,
    Paul

____________________________________________________________________
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia
Nedlands WA  6907                     mailto:paul at physics.uwa.edu.au
AUSTRALIA                            http://physics.uwa.edu.au/~paul

            God IS a weakly left-handed dice player
____________________________________________________________________




  • Prev by Date: Re: Position of Sign change in long list
  • Next by Date: Re: Rudimentary Spell Checker
  • Previous by thread: Re: LaTex on a Mac
  • Next by thread: Thickness in 3D parametric plots