texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] A small remark on tables in menus


From: David Allouche
Subject: Re: [Texmacs-dev] A small remark on tables in menus
Date: Sat, 28 Sep 2002 18:17:14 +0200
User-agent: Mutt/1.4i

On Mon, Aug 05, 2002 at 11:40:00PM +0200, Nicolas Girard wrote:
> 
> This is a small remark on a thing which annoys me from time to time.
> 
> Look at the 'Insert' menu in 'text' mode (is this the right way to 
> call it ?) ; among others, you find:
> 
> Mathematics
>     formula
>     equation
>     equations
>     numbered equation
>   ...
>   Table
>     ...
> 
> It obviously makes sense to insert an equation while you are in text
> mode. But IMHO it also makes sense to insert a 'choice' table while
> you're in text mode ; however this option can't be found in the 'Table'
> submenu, you've got to enter math mode to make it appear.
> 
> This has already played me a trick: i know i saw it in the 'Insert'
> menu, i look for if for a minute, and then i realize i have to switch to
> math mode.

I argued a lot here with Joris about how menus should behave. Your
post is another example of how using "if menus" (which may be hidden),
instead of "when menus" (which may be dimmed), for submenus is bad.

I know think that we should use "if menus" for top level menus, but
only for those. That helps manage the scare menubar real-estate and do
provide immediate visual feedback to the user when something change.

But Joris seems to keep on disagreeing.


> Does this little inconvenience come from a slight inconsistency in the
> menus or else from a bad/indirect use of the 'choice' table ? I indeed
> often use it when i need to express a real choice, rather than a set of
> equations.
> 
> BTW, as i'm writing it, it appears to me that these two uses have two
> semantically distinct uses of the 'choice' table. Would it be useful to
> define a 'choice' table in text mode, and a 'choice' table in math mode
> with a different meaning ?

The current "choice" macro as it is designed must be used in
"mode=math" context to be displayed properly. You can see what happens
in text context by inserting "choice" in math context as usual and
then deleting the enclosing math environment with M-backspace.

The point is that it uses big delimiters, which are a math-mode
feature.

Since your desired "text-choice" macro would have different syntactic
usage than the existing "choice" macro (table cells would be in text
mode), regardless of semanting differences, I think there may be point
in creating a new macro.

However, the current philosophy of TeXmacs seems to use only
"classical word processor" features in text mode, and all more exotic
features (symbols, big delimiters, trees) only in math mode. It may be
a mathematician bias, but it is quite self-consistent.

So, I think the best way to fix your problem here would be using a
user-specific package file and some user-defined menus and key
bindings. Please ask for help if you cannot work it out with the
existing documentation.

You could design the macro this way (paste in TeXmacs after selecting
"Tools->Selection->Import->Scheme"):
(Requires the package std-math.ts)

(assign "text-choice"
  (macro "x" (with "mode" "math" (shrink-inline
    (concat (left "{")
            (with "mode" "text" (tformat (arg "x")))
            (right "."))))))

Or, if you do not want your text to be shrinked if the choice is not
in formula style (which is most likely considering the intended use):

(assign "text-choice"
  (macro "x" (with "mode" "math"
    (concat (left "{")
            (with "mode" "text" (tformat (arg "x")))
            (right ".")))))

-- 
_.      _    .   GNU TeXmacs -- Writing is a pleasure.
 |\     |    |\       Home page -- http://www.texmacs.org
 | \ ,-.|,--.| \      Resources -- http://alqua.com/tmresources
 |  \|  |,-+||--\            TeXmacs is NOT a LaTeX front-end
-+--'`- \`-'\-   -           and is unrelated to emacs.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]