Re: AUCTeX and "builtin latex mode" integration

2023-05-08 Thread Hongyi Zhao
On Mon, May 8, 2023 at 6:45 PM Arash Esbati  wrote:
>
> Ikumi Keita  writes:
>
> > I attach a tentative patch to make AUCTeX major mode names not overwrap
> > built-in TeX modes. In this patch, the new mode names (value of
> > `major-mode') are
> >  - plain-TeX-mode
> >  - LaTeX-mode
> >  - docTeX-mode
> >  - Texinfo-mode
> >  - ConTeXt-mode
> >  - AmSTeX-mode
> > (There are additional renamed modes
> >+ japanese-plain-TeX-mode
> >+ japanese-LaTeX-mode
> >+ ConTeXt-en-mode
> >+ ConTeXt-nl-mode
> >  but they don't have their own `major-mode' value.
> > The name and role of `TeX-tex-mode' doesn't change.)
>
> Thanks for working on this, Keita.  I have to re-read the thread, but
> wasn't a point also that latex-mode and LaTeX-mode are also confusing to
> some users?  If so, can we think about coming up with mode names instead
> of camel-case'ing the built-in ones?

In fact, the latex-mode and LaTeX-mode are both the valid modes names
referred in the Emacs reftex manual:

(add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
(add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode

[1] https://www.gnu.org/software/emacs/manual/html_node/reftex/Installation.html

Best,
Zhao

> > I think that its core functionality works as
> > expected. If you are interested in this feature, please give it a try.
> >
> > 1. I'd like to push it to savannah server as a feature branch of AUCTeX
> >repository (it isn't ready to merge into master branch yet.) Do you
> >think it's OK?
>
> Yes, please do so.
>
> > If so, I'm not sure how to do that so I'd like to confirm.
>
> I don't use magit, but you should be ok on command line doing:
>
> $ git switch feature-branch-name
> $ git commit
> $ git push -u origin feature-branch-name
>
> where -u is a shortcut for --set-upstream as described by Stefan.
>
> > (By the way, I have come up with only a poor name
> > "feature/distinct-mode-name". Please tell me another name if you find
> > a better one.)
>
> I think we can live with that :-)
>
> Best, Arash
>



Re: On the usage and function of TeX-auto-generate-global and TeX-auto-global.

2021-07-04 Thread Hongyi Zhao
On Sun, Jul 4, 2021 at 9:42 PM Colin Baxter  wrote:
>
> >>>>> Hongyi Zhao  writes:
>
> > On Sun, Jul 4, 2021 at 9:19 PM Colin Baxter  wrote:
> >>
> >> Hello Hongyi
> >>
> >> I'm curious - what's your setting for the variable
> >> "TeX-auto-local"?
>
> > `M-x describe-variable RET TeX-auto-local RET'
>
> > TeX-auto-local is a variable defined in ‘tex.el’.
>
> Thanks. I asked because I've set my TeX-auto-local to
> ~/.emacs.d/auctex/auto-local. It seems to be the only 'TeX-local'
> variable that ever gets used. I have set TeX-auto-global to
> ~/.emacs.d/auctex/auto-global and it's always empty.

You must run the following command to generate the stuff populated in
this directory:

`M-x TeX-auto-generate-global RET'

See [1] for more detailed information.

[1] https://www.gnu.org/software/auctex/manual/auctex/Customizing.html


> I guess all the
> work is being done by TeX-auto-local. I have certainly wondered when
> Tex-auto-global is ever used.
>
> Best wishes,
>
> Colin.

HY
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



Re: On the usage and function of TeX-auto-generate-global and TeX-auto-global.

2021-07-04 Thread Hongyi Zhao
On Sun, Jul 4, 2021 at 9:19 PM Colin Baxter  wrote:
>
> Hello Hongyi
>
> I'm curious - what's your setting for the variable "TeX-auto-local"?

`M-x describe-variable RET TeX-auto-local RET'

TeX-auto-local is a variable defined in ‘tex.el’.

Its value is ".auctex-auto"
Original value was "auto"

  You can customize this variable.

Directory containing automatically generated TeX information.

This correspond to TeX macros found in the current directory, and must
be relative to that.

HY

>
> Best wishes,
>
> Colin Baxter.



-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



Re: On the usage and function of TeX-auto-generate-global and TeX-auto-global.

2021-07-04 Thread Hongyi Zhao
On Sun, Jul 4, 2021 at 3:42 PM Ikumi Keita  wrote:
>
> Hi Hongyi,
>
> >>>>> Hongyi Zhao  writes:
> > According to my understanding, the `TeX-auto-global' variable setting
> > is intending to set the file's store location of the comprehensive
> > macro and variable hint lisp files, and the command
> > `TeX-auto-generate-global' is for generating the comprehensive macro
> > and variable hint lisp files.
>
> Right. See https://www.gnu.org/software/auctex/manual/auctex/Customizing.html
> .
>
> > But based on my later tries, it seems that there is no need to run the
> > above command at all, and auctex already can give wonderful and rather
> > extensive completion results with its initial configuration.
>
> As described in the above documentation, AUCTeX has built-in support for
> many major packages. But it doesn't offer support for *ALL* LaTeX
> packages.
> Running `TeX-auto-generate-global' analyses all packages installed on
> your TEXMFSYS tree at that time and generates support files which give
> completions etc. So you can obtain completions for packages which
> AUCTeX doesn't support by default.
>
> But beware that `TeX-auto-generate-global' is not so smart so that it
> sometimes introduces unexpected side effects.[1]

If I want to enable `TeX-auto-generate-global' and minimize the
probability of adverse effects, what's the suggested best practice?

>
> Regards,
> Ikumi Keita
>
> [1] https://lists.gnu.org/r/auctex/2021-01/msg00037.html

HY
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



Re: On the usage and function of TeX-auto-generate-global and TeX-auto-global.

2021-07-04 Thread Hongyi Zhao
On Sun, Jul 4, 2021 at 1:58 PM Mandar Mitra  wrote:
>
> Hongyi Zhao wrote (Sun, Jul 04, 2021 at 11:10:55AM +0800):
> > This way, the above command won't need root privilege. But based on my
> > later tries, it seems that there is no need to run the above command
> > at all, and auctex already can give wonderful and rather extensive
> > completion results with its initial configuration. To be frank, I'm
> > still not sure on the usage and function of TeX-auto-generate-global
> > and TeX-auto-global [1].
> >
> > Any hints will be highly appreciated.
>
> From tex-site.el:
>
> (defcustom TeX-auto-global
> (if (file-writable-p "/usr/local/var/auctex") "/usr/local/var/auctex" 
> "~/.emacs.d/auctex")
> ...

But I don't have all the folders above:

werner@X10DAi:~$ ~/.emacs.d/auctex
bash: /home/werner/.emacs.d/auctex: No such file or directory
werner@X10DAi:~$ /usr/local/var/auctex
bash: /usr/local/var/auctex: No such file or directory

>
> Also, you probably have set TeX-parse-self to t as recommended in the basic 
> setup.

Yes. See all settings below on my Ubuntu 20.04 box:

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-parse-self t ; parse on load
  TeX-auto-save t  ; parse on save
  ;; use hidden dirs for auctex files
  TeX-auto-local ".auctex-auto"
  TeX-style-local ".auctex-style"
  TeX-source-correlate-mode t
  TeX-source-correlate-method 'synctex
  ;; don't start the emacs server when correlating sources
  TeX-source-correlate-start-server nil
  ;; automatically insert braces after sub/superscript in math mode
  TeX-electric-sub-and-superscript t
  ;; just save, dont ask me before each compilation
  TeX-save-query nil)

> I guess this combination explains why things "just work"?

I am still not very clear about its working mechanism. Any more hints?

> -mandar
>

Regards
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



On the usage and function of TeX-auto-generate-global and TeX-auto-global.

2021-07-03 Thread Hongyi Zhao
On Ubuntu 20.04, I'm using texlive 2021, git master Emacs and auctex.
I noticed the variable `TeX-auto-global' and relative command
`TeX-auto-generate-global' defined in auctex. According to my
understanding, the `TeX-auto-global' variable setting is intending to
set the file's store location of the comprehensive macro and variable
hint lisp files, and the command `TeX-auto-generate-global' is for
generating the comprehensive macro and variable hint lisp files. So, I
tried with the following testing/configuration/operation.

The `TeX-auto-global' variable is set by:

(setq TeX-auto-global "~/.local/var/auctex/")

Then, in Emacs, run the following command:

M-x TeX-auto-generate-global RET

This way, the above command won't need root privilege. But based on my
later tries, it seems that there is no need to run the above command
at all, and auctex already can give wonderful and rather extensive
completion results with its initial configuration. To be frank, I'm
still not sure on the usage and function of TeX-auto-generate-global
and TeX-auto-global [1].

Any hints will be highly appreciated.

[1] I've posted my confusion on
<https://github.com/raxod502/straight.el/issues/802#issuecomment-863726482>,
but considering that here is the appropriate list for such issues, so
I repost it here.

Regards
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



Re: Eglot Failed to completion for commands defined in specified loaded packages for auctex.

2021-06-16 Thread Hongyi Zhao
On Wed, Jun 16, 2021 at 1:05 PM Tassilo Horn  wrote:
>
> Hongyi Zhao  writes:
>
> > Then I open the following tex document in Emacs
> >
> > ```
> > \documentclass{paper}
> > \usepackage{braket}
> > \begin{document}
> >Some testing comes here.
> > \end{document}
> > ```
> >
> > and enable Eglot (M-x eglot), but I find that Eglot Failed to do the
> > completion for commands defined in specified loaded packages for
> > auctex. But TeXstudio doesn't have this problem.
>
> Do you know what Eglot is?  It's an LSP (Language Server Protocol)
> client which requests completions, documentation, etc. from an LSP
> server.  I doubt there is a LaTeX LSP server.
>
> You can use company-mode with capf (and dabbrev) backend with auctex to
> get completion popups, see this screenshot:

I think I have installed them, as shown in the screenshot below.

>
> That should work out of the box with no additional packages except for
> company and then enabling `company-mode' in your LaTeX buffer.
>
> Bye,
> Tassilo



-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China


Re: A strange auto typesetting problem when using auctex.

2021-06-14 Thread Hongyi Zhao
On Tue, Jun 15, 2021 at 4:11 AM Arash Esbati  wrote:
>
> Hongyi Zhao  writes:
>
> > Then I try to test auctex with the following LaTeX sample file:
> >
> > %% LaTeX sample file
> > \documentclass{paper}
> > \usepackage{hyperref}
> > \begin{document}
> > See
> > \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
> > 98}
> > \end{document}
> > %% LaTeX sample file ends here
> >
> > When I put the point after the `{page 98}' and hit RET, the LaTeX file
> > will be automatically completed into the following:
> >
> > %% LaTeX sample file
> > \documentclass{paper}
> > \usepackage{hyperref}
> > \begin{document}
> > See
> > \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
> >   % 98}
> >
> > \end{document}
> > %% LaTeX sample file ends here
> >
> > As you can see, the auto-completed typesetting result is wrong due to
> > the leading `%' before ` 98}'.
>
> I can't reproduce what you describe.

See the analysis by Tassilo.

>
> Besides that, my simple approach would be to replace %20 with 'space' in
> your file, i.e.:
>
> \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine
>   L. Quantum mechanics - a modern development
>   (1998)(T)(673s).pdf}{page 98}
>
> This gives AUCTeX enough possibilties for better filling and the link
> should also work in your pdf viewer.

I don't think this is good manner for dealing with URL, as in such
way, it will not be recognized by other applications, so the direct
click and open will be unavailable.

>
> Best, Arash



-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



Re: A strange auto typesetting problem when using auctex.

2021-06-14 Thread Hongyi Zhao
On Tue, Jun 15, 2021 at 3:35 AM Tassilo Horn  wrote:
>
> Hongyi Zhao  writes:
>
> >> That's because the URL contains % and therefore looks like a "code
> >> comment" to auctex, e.g.
> >>
> >>   \some\latex{code}% And some comment bla bla bla bla...
> >>
> >> which would be properly filled as
> >>
> >>   \some\latex{code}% And some comment bla bla bla
> >>% ...bla...
> >>
> >> Of course, here it is wrong.
> >>
> >> I don't see what we could do here, unfortunately.  But please file a bug
> >> report (M-x TeX-submit-bug-report RET).
> >
> > Where will this submit the bug report?
>
> To the GNU bug tracker, debbugs.gnu.org, assigned to the package auctex.
>
> > But now, very strange, the problem disappeared.
>
> Me neither. :-)
>
> The reason is that once the auto-parser has kicked in and seen that you
> are using the hyperref LaTeX package, it'll recognize the \href macro
> (which is now also fontified correctly, e.g., not with
> font-lock-comment-face including and after the first %) and know that
> the % in the URL are not starting a comment.
>
> To demonstrate: When you comment the \usepackage{hyperref} and hit `C-c
> C-n' the problem will be back.  Uncommenting it again then and hitting
> `C-c C-n' makes it disappear.

Thank you for your insightful analysis.

>
> Bye the way, you might want to add
>
> (setq TeX-parse-self t)
> (setq TeX-auto-save t)

So far, I am using the following settings:

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)


>
> to your auctex config as described in (info "(auctex) Top").
>
> Bye,
> Tassilo

Regards
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



Re: A strange auto typesetting problem when using auctex.

2021-06-14 Thread Hongyi Zhao
On Mon, Jun 14, 2021 at 8:05 PM Tassilo Horn  wrote:
>
> Hongyi Zhao  writes:
>
> > Then I try to test auctex with the following LaTeX sample file:
> >
> > %% LaTeX sample file
> > \documentclass{paper}
> > \usepackage{hyperref}
> > \begin{document}
> > See
> > \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
> > 98}
> > \end{document}
> > %% LaTeX sample file ends here
> >
> > When I put the point after the `{page 98}' and hit RET, the LaTeX file
> > will be automatically completed into the following:
>
> RET doesn't suffice for me but when I fill that paragraph, I get the
> same symptom.
>
> > Any hints for this problem?
>
> That's because the URL contains % and therefore looks like a "code
> comment" to auctex, e.g.
>
>   \some\latex{code}% And some comment bla bla bla bla...
>
> which would be properly filled as
>
>   \some\latex{code}% And some comment bla bla bla
>% ...bla...
>
> Of course, here it is wrong.
>
> I don't see what we could do here, unfortunately.  But please file a bug
> report (M-x TeX-submit-bug-report RET).

Where will this submit the bug report?

But now, very strange, the problem disappeared.

Regards
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



Re: A strange auto typesetting problem when using auctex.

2021-06-13 Thread Hongyi Zhao
On Mon, Jun 14, 2021 at 11:45 AM Hongyi Zhao  wrote:
>
> On Ubuntu 20.04, I use the latest git master Emacs version compiled by
> myself. I install and load auctex's git master version with the
> following bootstrap code in `~/.emacs.d/init.el':
>
> ;;Bootstrap auctex via straight
> (straight-use-package
>  `( auctex :type git :host nil :repo
> "https://git.savannah.gnu.org/git/auctex.git";
> :pre-build ,(pcase system-type
> (`berkeley-unix '("gmake"))
> (_ '(
> ;("bash" "-c" "cd ~/.emacs.d/straight/repos/auctex")
> ("./autogen.sh")
> ("./configure")
> ("make")
> ("sudo" "make" "install"))
>
> (load "auctex.el" nil t t)
> (load "preview-latex.el" nil t t)
> ;;; auctex config ends here
>
> Then I try to test auctex with the following LaTeX sample file:
>
> %% LaTeX sample file
> \documentclass{paper}
> \usepackage{hyperref}
> \begin{document}
> See
> \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
> 98}
> \end{document}
> %% LaTeX sample file ends here
>
> When I put the point after the `{page 98}' and hit RET, the LaTeX file
> will be automatically completed into the following:
>
> %% LaTeX sample file
> \documentclass{paper}
> \usepackage{hyperref}
> \begin{document}
> See
> \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
>   % 98}
>
> \end{document}
> %% LaTeX sample file ends here
>
> As you can see, the auto-completed typesetting result is wrong due to
> the leading `%' before ` 98}'.
>
> Any hints for this problem?

Finally, I found the problem was caused by the '%' character appearing
in the URL, which in its literal form, is a comment character of
LaTeX, so the Emacs/auctex thinks that the newline should be commented
out continuously.

Change the URL line into the following will fix the problem:

\href{http://www.fulviofrisone.com/attachments/article/480/Ballentine\%20L.\%20Quantum\%20mechanics\%20-\%20a\%20modern\%20development\%20(1998)(T)(673s).pdf}{page
98}

Regards
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



A strange auto typesetting problem when using auctex.

2021-06-13 Thread Hongyi Zhao
On Ubuntu 20.04, I use the latest git master Emacs version compiled by
myself. I install and load auctex's git master version with the
following bootstrap code in `~/.emacs.d/init.el':

;;Bootstrap auctex via straight
(straight-use-package
 `( auctex :type git :host nil :repo
"https://git.savannah.gnu.org/git/auctex.git";
:pre-build ,(pcase system-type
(`berkeley-unix '("gmake"))
(_ '(
;("bash" "-c" "cd ~/.emacs.d/straight/repos/auctex")
("./autogen.sh")
("./configure")
("make")
("sudo" "make" "install"))

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
;;; auctex config ends here

Then I try to test auctex with the following LaTeX sample file:

%% LaTeX sample file
\documentclass{paper}
\usepackage{hyperref}
\begin{document}
See
\href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
98}
\end{document}
%% LaTeX sample file ends here

When I put the point after the `{page 98}' and hit RET, the LaTeX file
will be automatically completed into the following:

%% LaTeX sample file
\documentclass{paper}
\usepackage{hyperref}
\begin{document}
See
\href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
  % 98}

\end{document}
%% LaTeX sample file ends here

As you can see, the auto-completed typesetting result is wrong due to
the leading `%' before ` 98}'.

Any hints for this problem?

Regards
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



Re: [AUCTeX-devel] Can autctex support metapost?

2007-02-26 Thread Hongyi Zhao
On Mon, Feb 26, 2007 at 10:22:34PM +0100, Ralf Angeli wrote:
> Emacs includes a specialized Metapost mode.  I don't know if it
> supports your requirements, though.

I find Metapost mode only can give limited supports for mp file,  for
example, if I want preview, compile the mp file, I don,t  know what to do with 
Metapost mode.

---
Hongyi Zhao (赵弘毅)
GnuPG DSA: 0xD108493B

老子道德经:第三十八章
夫礼者,忠信之薄而乱之首。
前识者,道之华而愚之始。
是以大丈夫处其厚,不居其薄;
处其实,不居其华。故去彼取此。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] Can autctex support metapost?

2007-02-26 Thread Hongyi Zhao
Hi all,

If I want to use metapost to generate some figs, can I use the auctex
in emacs to suport the mp file's edit and compilation?

---
Hongyi Zhao (赵弘毅)
GnuPG DSA: 0xD108493B

老子道德经:第四十九章
圣人在天下,歙歙为天下浑其心,
百姓皆注其耳目,圣人皆孩之。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] How can use gs-afpl to view ps files with pages scrolled up and down in Emacs?

2007-02-08 Thread Hongyi Zhao
Hi all,

Now, I use the auctex compiled from its latest cvs and I put the
following line to my .emacs in order to view ps files in emacs with auctex:


(setq my-tex-commands-extra (list
[...]
(list "MyViewPSWithgs-afpl" "gs-afpl %s.ps" 'TeX-run-LaTeX nil t)
[...]
))
===

But I find that when the ps files are opened with gs-afpl, I only can
view the first page of the file, and can't scrolled the pages up and
down of the file, in order to view the ps files with pages can be up and
down, what should I do?

---
Hongyi Zhao (赵弘毅)
GnuPG DSA: 0xD108493B

老子道德经:第六十三章
为无为,事无事,味无味,
大小多少,报怨以德。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Re: Auctex preview mode cann't generate preview for images when use pdfscreen.

2007-01-05 Thread Hongyi Zhao
On Fri, Jan 05, 2007 at 09:56:20PM +0100, Ralf Angeli wrote:
> * Hongyi Zhao (2007-01-04) writes:
> 
> > On Wed, Jan 03, 2007 at 08:50:54PM +0100, Ralf Angeli wrote:
> >> * Hongyi Zhao (2007-01-03) writes:
> >> 
> >> > I use the auctex compiled from its CVS and found that it cann't generate
> >> > preview-images for pdfscreen. But when I use it for other cases, I can. 
> >> 
> >> Could you please send a bug report using `M-x preview-report-bug RET'?
> >> Please include a sample file and describe which constructs you want to
> >> have previewed.
> >
> > Attached, thanks.
> 
> Your example is working fine here with CVS Emacs and CVS AUCTeX when
> TeX PDF mode is activated (see (info "(auctex)Commands")).  Did you
> activate TeX PDF mode?  If you did, the modeline should contain the
> string "PDFLaTeX".

Thanks, after I use "C-c, C-t, C-p" to activate the TeX PDF mode, the
thing is OK.

---
Hongyi Zhao (赵弘毅)
GnuPG DSA: 0xD108493B

老子道德经:第六十七章
今舍慈且勇,舍俭且广,舍后且先,死矣!
夫慈,以战则胜,以守则固。
天将救之,以慈卫之。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] How can I use auctex to preview images when I use the

2007-01-05 Thread Hongyi Zhao
ConTeXt? 

Hi everyone,

I want to know whether the acutex has the capability to support
previewing images when using the ConTeXt or not?  If not, how can I do that 
thing?

Who can tell me?  Thanks!

---
Hongyi Zhao (赵弘毅)
GnuPG DSA: 0xD108493B

老子道德经:第七十九章
有德司契,无德司彻。
天道无亲,常与善人。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Auctex preview mode cann't generate preview for images when use pdfscreen.

2007-01-04 Thread Hongyi Zhao
On Thu, Jan 04, 2007 at 09:28:13PM +0100, Ralf Angeli wrote:
> * Hongyi Zhao (2007-01-04) writes:
> 
> > On Wed, Jan 03, 2007 at 08:50:54PM +0100, Ralf Angeli wrote:
> >> * Hongyi Zhao (2007-01-03) writes:
> >> 
> >> > I use the auctex compiled from its CVS and found that it cann't generate
> >> > preview-images for pdfscreen. But when I use it for other cases, I can. 
> >> 
> >> Could you please send a bug report using `M-x preview-report-bug RET'?
> >> Please include a sample file and describe which constructs you want to
> >> have previewed.
> >
> > Attached, thanks.
> 
> The output of `M-x preview-report-bug RET' is missing.

See the following, please:


From: Hongyi Zhao <[EMAIL PROTECTED]>
To: bug-auctex@gnu.org
Subject: preview-1.279; Auctex preview mode cann't generate preview
for images when use pdfscreen.
--text follows this line--

Remember to cover the basics.  Including a minimal LaTeX example
file exhibiting the problem might help.



Emacs  : GNU Emacs 23.0.0.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6)
 of 2006-12-28 on ubuntu-edgy
Package: preview-1.279

current state:
==
(setq
 AUC-TeX-version "2006-12-30"
 LaTeX-command-style '(("" "%(PDF)%(latex) %S%(PDFout)"))
 image-types '(png gif tiff jpeg xpm postscript xbm pbm)
 preview-image-type 'png
 preview-image-creators '((dvipng
   (open preview-gs-open
preview-dvipng-process-setup)
   (place preview-gs-place)
   (close preview-dvipng-close))
  (png (open preview-gs-open) (place
preview-gs-place)
   (close preview-gs-close))
  (jpeg (open preview-gs-open)
   (place preview-gs-place) (close
preview-gs-close))
  (pnm (open preview-gs-open) (place
preview-gs-place)
   (close preview-gs-close))
  (tiff (open preview-gs-open)
   (place preview-gs-place) (close
preview-gs-close))
  )
 preview-dvipng-image-type 'png
 preview-dvipng-command "dvipng -picky -noghostscript %d -o
\"%m/prev%%03d.png\""
 preview-pdf2dsc-command "pdf2dsc %s.pdf %m/preview.dsc"
 preview-gs-command "gs"
 preview-gs-options '("-q" "-dSAFER" "-dNOPAUSE" "-DNOPLATFONTS"
"-dPrinted"
  "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4")
 preview-gs-image-type-alist '((png png "-sDEVICE=png16m")
   (dvipng png "-sDEVICE=png16m")
   (jpeg jpeg "-sDEVICE=jpeg")
   (pnm pbm "-sDEVICE=pnmraw")
   (tiff tiff "-sDEVICE=tiff12nc"))
 preview-fast-conversion t
 preview-prefer-TeX-bb nil
 preview-dvips-command "dvips -Pwww -i -E %d -o %m/preview.000"
 preview-fast-dvips-command "dvips -Pwww %d -o %m/preview.ps"
 preview-scale-function 'preview-scale-from-face
 preview-LaTeX-command '("%`%l
\"\\nonstopmode\\nofiles\\PassOptionsToPackage{"
 ("," . preview-required-option-list)
 
"}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined"
preview-default-preamble "\\fi}\"%' %t")
 preview-required-option-list '("active" "tightpage" "auctex"
(preview-preserve-counters
"counters"))
 preview-preserve-counters nil
 preview-default-option-list '("displaymath" "floats" "graphics"
"textmath"
   "sections" "footnotes")
 preview-default-preamble '("\\RequirePackage["
("," . preview-default-option-list)
"]{preview}[2004/11/05]")
 preview-LaTeX-command-replacements nil
 preview-dump-replacements '(preview-LaTeX-command-replacements
 ("\\`\\([^ ]+\\)\\(\\( +-\\([^
\"]\\|\\.\\|\"[^\"]*\"\\)*\\)*\\)\\(.*\\)\\'" "\\1 -ini
-interaction=nonstopmode \"&\\1\" " preview-format-name ".ini \\5")
 )
 preview-undump-replacements '(("\\`\\([^ ]+\\) .*? \"input\"
\\(.*\\)\\'"
"\\1 -interaction=nonstopmode \"&"
preview-format-name "\" \\2")
   )
 preview-auto-cac

Re: [AUCTeX-devel] Auctex preview mode cann't generate preview for images when use pdfscreen.

2007-01-04 Thread Hongyi Zhao
On Wed, Jan 03, 2007 at 08:50:54PM +0100, Ralf Angeli wrote:
> * Hongyi Zhao (2007-01-03) writes:
> 
> > I use the auctex compiled from its CVS and found that it cann't generate
> > preview-images for pdfscreen. But when I use it for other cases, I can. 
> 
> Could you please send a bug report using `M-x preview-report-bug RET'?
> Please include a sample file and describe which constructs you want to
> have previewed.

Attached, thanks.

---
Hongyi Zhao (赵弘毅)  |  GnuPG DSA: 0xD108493B

老子道德经:第三十章
师之所处,荆棘生焉。
大军之后,必有凶年。


preview-latex-for-pdfscreen.tar.bz2
Description: Binary data
___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] Auctex preview mode cann't generate preview for images when use pdfscreen.

2007-01-02 Thread Hongyi Zhao
Hi everyone,

I use the auctex compiled from its CVS and found that it cann't generate
preview-images for pdfscreen. But when I use it for other cases, I can. 

Hongyi Zhao (赵弘毅)
GnuPG DSA: 0xD108493B
---
题目:《秋日》
作者:程颢(1032-1085)
闲来无事不从容,睡觉东窗日已红。
万物静观皆自得,四时佳兴与人同。
道通天地有形外,思入风云变态中。
富贵不淫贫贱乐,男儿到此是豪雄。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] About the auctex's XDVI inverse search.

2006-12-12 Thread Hongyi Zhao
Hi, everyone,

I use the Emacs Unicode 2 CVS version.  I've done all the thing according to
the URL:

===
http://xdvi.sourceforge.net/inverse-search.html
===

I use the "C-c, C-t, C-s" to activate the Tex-Source-Specials mode, then I
compile my tex file and open the dvi with XDVI, but I can't go from the DVI
to its correspoding point in tex file when I use the C-Mouse-1.


-- 
Hongyi Zhao <[EMAIL PROTECTED]>
赵弘毅
--

《早发白帝城》
作者:李白
朝辞白帝彩云间,千里江陵一日还。
两岸猿声啼不住,轻舟已过万重山。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [EMAIL PROTECTED]: Auctex preview mode can't be activated by Emacs automatically.]

2006-12-09 Thread Hongyi Zhao
> Ralf said "<-- Type `C-x  C-e' here", meaning that you should put the
> cursor right behind the closing parenthesis before typing C-c C-e.

But now, I get the following error message:


Debugger entered--Lisp error: (error "Info file auctex does not exist")
  signal(error ("Info file auctex does not exist"))
  error("Info file %s does not exist" "auctex")
  Info-find-file("auctex")
  Info-find-node("auctex" "Loading the package")
  Info-goto-node("(auctex)Loading the package")
  info("(auctex)Loading the package")
  eval((info "(auctex)Loading the package"))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp)


> 
> >
> > Now, if I want to load the preview-latex, I must use the following method:
> >
> > 
> > M-x preview-install-styles
> > 
> 
> Utter nonsense.  Please stop digging around in the dark.  AUCTeX comes
> with a file "INSTALL" which describes what steps to undertake for
> installing and activating both AUCTeX and preview-latex.  In fact, it
> would appear that loading all files in your site-start.d directory
> should do the trick, judging from your configure line.

I copy all the style files into my site-start.d directory, but it make
nosense.

> 
> What are the contents of your site-start.el file?

See the following, and its location is /etc/emacs/site-start.el.

===
;; Emacsen independent startup file.  All of the various installed
;; flavors of emacs (emacs 19, emacs 20, xemacs) will load this file
;; at startup.  Make sure any code you put here is emacs flavor
;; independent.

;; Package maintainers: do not have Debian packages edit this file.
;; See the policy manual for the proper way to handle Emacs package
;; initialization code.

===

-- 
Hongyi Zhao <[EMAIL PROTECTED]>
赵弘毅
--

题目:《雨晴》
作者:陈与义(1090-1138)
天缺西南江面清,纤云不动小滩横。
墙头语鹊衣犹湿,楼外残雷气未平。
尽取微凉供稳睡,急搜奇句报新晴。
今宵绝胜无人共,卧看星河尽意明。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [EMAIL PROTECTED]: Auctex preview mode can't be activated by Emacs automatically.]

2006-12-09 Thread Hongyi Zhao
> > ===
> > (add-to-list 'load-path
> > "~/EmacsConfigureRelative/MyEmacsLispFiles/auctex/style")
> > (add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
> > (autoload 'LaTeX-preview-setup "preview")
> 
> Please remove _all_ of this again from your .emacs file.  It's wrong
> and will most certainly lead to problems.

I have removed them.

> 
> > But when I open a tex source file with Emacs, the Preview menu-bar will not
> > be autoloaded. 
> 
> Why don't you just use the method of activating preview-latex
> described in the manual?
> 
> See (info "(auctex)Loading the package") <-- Type `C-x C-e' here.

`C-x C-e` doesn't work on my Emacs, the minibuffer will say:


End of file during parsing


Now, if I want to load the preview-latex, I must use the following method:


M-x preview-install-styles


Then, the Emacs minibuffer will say:

==
Permanent location for preview TeX styles
==

Then I give the path of preview TeX styles files, I think it is a redundant
method, because these style files have been put into the load-path.  But what
should I simplify the operation?

-- 
Hongyi Zhao <[EMAIL PROTECTED]>
赵弘毅
--

题目:《泊船瓜洲》
作者:王安石(1021-1086)
京口瓜洲一水间,钟山只隔数重山。
春风又绿江南岸,明月何时照我还。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [EMAIL PROTECTED]: Auctex preview mode can't be activated by Emacs automatically.]

2006-12-09 Thread Hongyi Zhao
> > I find that the preview mode can't be activated automatically, while other
> > minor modes can.
> 
> preview-latex is not a minor mode.  How are you trying to activate it?

Oh, thank you.  Now I want the preview-latex can be autoloaded on the
Emacs's menu-bar, so I put the following into my .emacs:

===
(add-to-list 'load-path
"~/EmacsConfigureRelative/MyEmacsLispFiles/auctex/style")
(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
(autoload 'LaTeX-preview-setup "preview")
===

But when I open a tex source file with Emacs, the Preview menu-bar will not
be autoloaded. 

-- 
Hongyi Zhao <[EMAIL PROTECTED]>
赵弘毅
--

《寄人》
作者:张泌
别梦依依到谢家,小廊回合曲阑斜。
多情只有春庭月,犹为离人照落花。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] [EMAIL PROTECTED]: Auctex preview mode can't be activated by Emacs automatically.]

2006-12-08 Thread Hongyi Zhao
I get the Auctex from its CVS repository and install it like this:


% cd _Auctex_Build_Dir

% ./configure --prefix=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles \
--with-emacs=/usr/bin/emacs
--with-lispdir=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles \
--with-auctexstartfile=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles/site-start.d/auctex.el
\
--with-previewstartfile=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles/site-start.d/preview-latex.el
\
--with-packagelispdir=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles/auctex
\
--bindir=/usr/bin --sbindir=/usr/sbin \
--with-texmf-dir=/usr/local/texlive/2006/texmf \
--localstatedir=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles/auctex/var
\
--datarootdir=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles/auctex/share
\
--with-packagedatadir=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles/auctex
\
--with-auto-dir=/home/zhaohs/EmacsConfigureRelative/MyEmacsLispFiles/auctex/style

% make 

% make install


I find that the preview mode can't be activated automatically, while other
minor modes can.

-- 
Hongyi Zhao <[EMAIL PROTECTED]>
赵弘毅
--

《滁州西涧》
作者:韦应物
独怜幽草涧边生,上有黄鹂深树鸣。
春潮带雨晚来急,野渡无人舟自横。


___
auctex-devel mailing list
auctex-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/auctex-devel