Ralf Angeli | 2 Sep 2005 10:46
Picon

Re: must force $ in math::array::textrm

* Jonas Koelker (2005-08-31) writes:

> The dollar signs inside \textrm{} must be forced ("Math mode because of
> `displaymath'.  Use C-q $ to force a dollar").  Since \textrm isn't in
> math-mode by default, the Right Thing (in my mind, at least) is to
> allow the dollar without forcing it.

Fixed in CVS.  Thanks for the report.

> PS.  I don't follow the list, so you'll have to cc me if you want need
> to get in touch with me (say, to tell me to get my ass on the list).

You can access the list as a newsgroup via Gmane if that's more
convenient for you.  Information about that can be found on the AUCTeX
homepage.

--

-- 
Ralf
Stefan Pofahl | 2 Sep 2005 16:42
Picon

add to a key stroke: texify --tex-opt=--src --quiet %t"

Hi,

I want to have the command "texify --tex-opt=--src --quiet %t"
on a key strocke (texify.exe is part of miktex).
What is to do?
I tried the following in my init.el:
;; ---  add "Texify" to the TeX-command-list  ---
 (eval-after-load "tex"
   '(progn
      (add-to-list 'TeX-command-list
        (list "Texify" "texify --tex-opt=--src --quiet %t"
         'TeX-run-command nil t)
      )
   ) ; end of << '(progn  >>
 ) ; end of << (eval-after-load "tex" >>
;; --- add a key stroke definition --------------
(add-hook 'LaTeX-mode-hook 
  '(lambda nil
      ; control key bindings
      (define-key LaTeX-mode-map '[(control c)(control a)] 'do-LaTeX) 
  ;; safe buffer, run latex
    )    ) ;;end add-hook 'LaTeX-mode-hook
;; ------------------------
(eval-when-compile
  (require 'tex)) ;; (tip from: David Kastrup)
;; --- defined the wanted function --------------
(defun do-LaTeX ()
    "LaTex the curent file."
    (interactive)
    (save-buffer)
(Continue reading)

Ralf Angeli | 5 Sep 2005 10:23
Picon

Re: add to a key stroke: texify --tex-opt=--src --quiet %t"

* Stefan Pofahl (2005-09-02) writes:

>     (TeX-command "Texify" %t)
>     )
> ;;----------------------------
>
> It does not work, what is to do?
> (TeX-command "Texify" 'TeX-active-buffer)
> I also not working :-(
> But 
> (TeX-command "Texify" 'TeX-master-file)
> and 
> (TeX-command "Texify" 'TeX-region-file)
> work both.
> What is to do?

What's the problem with using the `TeX-master-file' option?

--

-- 
Ralf
Ralf Angeli | 5 Sep 2005 11:38
Picon

Re: add to a key stroke: texify --tex-opt=--src --quiet %t"

* Stefan Pofahl (2005-09-05) writes:

> On 5 Sep 2005 at 10:23, Ralf Angeli wrote:
>
>> What's the problem with using the `TeX-master-file' option?
>> 
> The variable %t is changing it's value, when you change from
> master-file to buffer or region, this is a nice feature.

First, "%t" is not a variable but a placeholder used for expansion.
Second, how should AUCTeX know if you want to process the document,
the current buffer or a region?  You have to explicitely tell it to
execute the intended option.  That's why there are commands like
`TeX-command-master', `TeX-command-buffer' or `TeX-command-region'.

> The variable `TeX-active-buffer' should be the same as %t,
> but I don't know how to use it.

Maybe it helps reading the doc string of `TeX-command', especially
what it expects as its second argument.

--

-- 
Ralf
Stefan Pofahl | 5 Sep 2005 10:58
Picon

Re: add to a key stroke: texify --tex-opt=--src --quiet %t"

On 5 Sep 2005 at 10:23, Ralf Angeli wrote:

> > But 
> > (TeX-command "Texify" 'TeX-master-file)
> > and 
> > (TeX-command "Texify" 'TeX-region-file)
> > work both.
> > What is to do?
> 
> What's the problem with using the `TeX-master-file' option?
> 
> -- 
> Ralf
The variable %t is changing it's value, when you change from
master-file to buffer or region, this is a nice feature.
The variable `TeX-active-buffer' should be the same as %t,
but I don't know how to use it.

`TeX-active-buffer' is defined in tex-buf.el:
;;;; tex-buf.el
;;; Active Process

(defvar TeX-current-process-region-p nil
  "This variable is set to t iff the last TeX command is on a 
region.")
[...]
(defun TeX-active-buffer ()
  "Return the buffer of the active process for this buffer."
  (if TeX-current-process-region-p
      (TeX-process-buffer (TeX-region-file))
(Continue reading)

Stefan Pofahl | 5 Sep 2005 14:04
Picon

Re: add to a key stroke: texify --tex-opt=--src --quiet %t"

On 5 Sep 2005 at 11:38, Ralf Angeli wrote:

> Maybe it helps reading the doc string of `TeX-command', especially
> what it expects as its second argument.
> 
> -- 
> Ralf
Sorry Ralf, 

the explanation:
-------------------------------------------------------------------
(TeX-command NAME FILE &optional OVERRIDE-CONFIRM)

Documentation:
Run command NAME on the file you get by calling FILE.

FILE is a function return a file name.  It has one optional argument,
the extension to use on the file.
-------------------------------------------------------------------

is not helping me :-(

Why can I not use the placeholder %t?

And how can I make use of the function:
-------------------------------------------------------------------
`TeX-active-buffer' is a compiled Lisp function
  -- loaded from "tex-buf"
(TeX-active-buffer)

(Continue reading)

Ralf Angeli | 5 Sep 2005 14:44
Picon

Re: add to a key stroke: texify --tex-opt=--src --quiet %t"

* Stefan Pofahl (2005-09-05) writes:

> On 5 Sep 2005 at 11:38, Ralf Angeli wrote:
>
>> Maybe it helps reading the doc string of `TeX-command', especially
>> what it expects as its second argument.
>> 
> Sorry Ralf, 
>
> the explanation:
> -------------------------------------------------------------------
> (TeX-command NAME FILE &optional OVERRIDE-CONFIRM)
>
> Documentation:
> Run command NAME on the file you get by calling FILE.
>
> FILE is a function return a file name.  It has one optional argument,
> the extension to use on the file.
> -------------------------------------------------------------------
>
> is not helping me :-(

It expects the symbol of a function returning a file name.  You
cannot throw random garbage at it.

> Why can I not use the placeholder %t?

"%t" is used in strings which are parsed by `TeX-command-expand' and
the related machinery.  It has no meaning outside of such context.

(Continue reading)

Stefan Pofahl | 5 Sep 2005 16:05
Picon

Re: add to a key stroke: texify --tex-opt=--src --quiet %t"

Hi Ralf and the others!

On 5 Sep 2005 at 14:44, Ralf Angeli wrote:
> It expects the symbol of a function returning a file name.  You
> cannot throw random garbage at it.
What do you mean by random garbage?
I'm just looking for a symbol of a function that returns the propper
filename depending on my selection in the auctex-context-menu: 
running the master-file or the buffer/region with the next latex-run.
> 
> > Why can I not use the placeholder %t?
> 
> "%t" is used in strings which are parsed by `TeX-command-expand' and
> the related machinery.  It has no meaning outside of such context.
> 
%t gives the correct output, it is either master.tex or _region_.tex,
depending on my selection in the context menu.

Is it perhaps possible to make use of the boolean variable:
`TeX-current-process-region-p', defined in tex-buf.el?
--------------------------------------------------------------
(defvar TeX-current-process-region-p nil
  "This variable is set to t iff the last TeX command is on a 
region.")
--------------------------------------------------------------
Regards, Stefan
Ralf Angeli | 5 Sep 2005 19:38
Picon

Re: add to a key stroke: texify --tex-opt=--src --quiet %t"

"Stefan Pofahl" <stefan.pofahl <at> zsw-bw.de> writes:

> On 5 Sep 2005 at 14:44, Ralf Angeli wrote:
>> It expects the symbol of a function returning a file name.  You
>> cannot throw random garbage at it.
> What do you mean by random garbage?

%t

> I'm just looking for a symbol of a function that returns the propper
> filename depending on my selection in the auctex-context-menu: 
> running the master-file or the buffer/region with the next latex-run.

At last you say how you want to control the whole thing.  (I suppose
with "auctex-context-menu" you mean the Command menu.)

Well, you may have noticed that your command is picking up the the
selected option if invoked from the menu.  So you could abuse the
function used when calling a command from the menu.  That means
(TeX-command-menu "Texify")
should do what you want.

>> > Why can I not use the placeholder %t?
>> 
>> "%t" is used in strings which are parsed by `TeX-command-expand' and
>> the related machinery.  It has no meaning outside of such context.
>> 
> %t gives the correct output, it is either master.tex or _region_.tex,
> depending on my selection in the context menu.

(Continue reading)

Ralf Angeli | 6 Sep 2005 15:57
Picon

Re: add to a key stroke: texify --tex-opt=--src --quiet %t"

* Stefan Pofahl (2005-09-06) writes:

> On 5 Sep 2005 at 19:38, Ralf Angeli wrote:
>
>> Well, you may have noticed that your command is picking up the the
>> selected option if invoked from the menu.  So you could abuse the
>> function used when calling a command from the menu.  That means
>> (TeX-command-menu "Texify") should do what you want.
> Ralf, thank you very much, that was what I'm looking for, this is a 
> good tip.
> You improved my init.el for miktex-users very much :-)

It was a suggestion which suits your personal usage patterns.  I am
not sure if it is generally useful to make the outcome of key
sequences dependent on selections in a menu.  Ideally there should be
a way to achieve the same only by using the keyboard as well.

Sometimes I feel like an arms dealer ...

--

-- 
Ralf

Gmane