* Hiding references when editing LaTeX?
@ 2003-02-26 19:15 Felix E. Klee
2003-02-26 19:39 ` David Kastrup
0 siblings, 1 reply; 18+ messages in thread
From: Felix E. Klee @ 2003-02-26 19:15 UTC (permalink / raw)
Hi,
I like to use long names for labels in my LaTeX code. However, I find the
corresponding long reference commands disturbing when reading the code. Is
it possible to hide these references?
An example:
Instead of
We use equation \ref{SomeVeryVeryLongReference} to show something.
I want to see
We use equation # to show something.
but upon moving the cursor on top of the '#' I want to see
We use equation \ref{SomeVeryVeryLongReference} to show something.
again.
Felix
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-26 19:15 Hiding references when editing LaTeX? Felix E. Klee
@ 2003-02-26 19:39 ` David Kastrup
2003-02-26 19:54 ` Felix E. Klee
2003-02-26 20:21 ` Felix E. Klee
0 siblings, 2 replies; 18+ messages in thread
From: David Kastrup @ 2003-02-26 19:39 UTC (permalink / raw)
"Felix E. Klee" <felix.klee@inka.de> writes:
> I like to use long names for labels in my LaTeX code.
Why? Are you using RefTeX? It comes bundled with Emacs, creates
labels automatically and makes handling them a breeze. For example,
in connection with AUCTeX it automatically assigns labels like
\label{eq:21} which sounds like a pretty bad idea until you realize
that C-c ) will give you a list of all relevant equations to scroll
through and hit the right one. So no need to memorize any labels.
> However, I find the
> corresponding long reference commands disturbing when reading the code. Is
> it possible to hide these references?
> An example:
> Instead of
> We use equation \ref{SomeVeryVeryLongReference} to show something.
> I want to see
> We use equation # to show something.
> but upon moving the cursor on top of the '#' I want to see
> We use equation \ref{SomeVeryVeryLongReference} to show something.
> again.
preview-latex <URL:http://preview-latex.sourceforge.net> would do
exactly that if you created a file prauctex.cfg with the contents
\PreviewCommand[!][\#]\ref
\InputIfFileExists{preview/prauctex.cfg}{}{}
in your project directory. You could also try
\PreviewCommand[!]\ref
to have the dereferenced label itself displayed as typeset by LaTeX,
or
\RequirePackage{url}
\PreviewCommand[!][\@firstoftwo\url#1]\ref
to have the original label text in typewriter mode and so on.
Also handy for collapsing footnotes into their respective footnote
mark. In short, preview-latex allows you to tell LaTeX how you want
certain constructs display in your Emacs window, obviously defaulting
to their normal typeset rendition.
But for labels, I'd really recommend going with RefTeX instead. Try
it. Manual should be available with
C-h i d m reftex RET
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-26 19:39 ` David Kastrup
@ 2003-02-26 19:54 ` Felix E. Klee
2003-02-26 20:21 ` Felix E. Klee
1 sibling, 0 replies; 18+ messages in thread
From: Felix E. Klee @ 2003-02-26 19:54 UTC (permalink / raw)
David Kastrup wrote:
> Why? Are you using RefTeX? It comes bundled with Emacs, creates
> labels automatically and makes handling them a breeze. For example,
> in connection with AUCTeX it automatically assigns labels like
> \label{eq:21} which sounds like a pretty bad idea until you realize
> that C-c ) will give you a list of all relevant equations to scroll
> through and hit the right one. So no need to memorize any labels.
I already use RefTeX but I find the label names are too long in the
corresponding references. They are disturbing when reading text onscreen.
>> An example:
>> Instead of
>> We use equation \ref{SomeVeryVeryLongReference} to show something.
>> I want to see
>> We use equation # to show something.
>> but upon moving the cursor on top of the '#' I want to see
>> We use equation \ref{SomeVeryVeryLongReference} to show something.
>> again.
>
> preview-latex <URL:http://preview-latex.sourceforge.net> would do
> exactly that
I am already using it all the time.
> if you created a file prauctex.cfg with the contents
>
> \PreviewCommand[!][\#]\ref
> \InputIfFileExists{preview/prauctex.cfg}{}{}
>
> in your project directory. You could also try
> \PreviewCommand[!]\ref
> to have the dereferenced label itself displayed as typeset by LaTeX,
> or
> \RequirePackage{url}
> \PreviewCommand[!][\@firstoftwo\url#1]\ref
> to have the original label text in typewriter mode and so on.
>
> Also handy for collapsing footnotes into their respective footnote
> mark. In short, preview-latex allows you to tell LaTeX how you want
> certain constructs display in your Emacs window, obviously defaulting
> to their normal typeset rendition.
Thanks I'll try this out. Preview-LaTeX is wonderful - I love it:)
> But for labels, I'd really recommend going with RefTeX instead. Try
> it. Manual should be available with
> C-h i d m reftex RET
I don't see a reason why I shouldn't use RefTeX and Preview-LaTeX for
handling references at the same time.
Felix
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-26 19:39 ` David Kastrup
2003-02-26 19:54 ` Felix E. Klee
@ 2003-02-26 20:21 ` Felix E. Klee
2003-02-26 20:31 ` David Kastrup
1 sibling, 1 reply; 18+ messages in thread
From: Felix E. Klee @ 2003-02-26 20:21 UTC (permalink / raw)
David Kastrup wrote:
> \PreviewCommand[!][\#]\ref
> \InputIfFileExists{preview/prauctex.cfg}{}{}
>
> in your project directory. You could also try
> \PreviewCommand[!]\ref
> to have the dereferenced label itself displayed as typeset by LaTeX,
> or
> \RequirePackage{url}
> \PreviewCommand[!][\@firstoftwo\url#1]\ref
> to have the original label text in typewriter mode and so on.
Hm, I just tried it but it doesn't work. Here's what I did:
1. I created the cfg file with the contents (I also tried
\PreviewCommand[!]\ref instead)
\PreviewCommand[!][\#]\ref
\InputIfFileExists{preview/prauctex.cfg}{}{}
in the project directory, restarted EMACS (to avoid trouble). Then, I
opened a tex file belonging to the project and hit C-c C-p C-b. This
caused equations, sections, etc. to be TeXed but the \ref's weren't
affected.
2. I appended "\PreviewCommand[!][\#]\ref" to "Preview Default Preamble" in
the Preview-Latex customization group and saved the setting for future
sessions. Then, I restarted EMACS and opened a tex file and hit C-c C-p
C-b, the \ref's aren't affected.
BTW, RefTeX wasn't turned on during the above experiments.
I'm sure I'm doing something obvious wrong, but I appended the information
generated by preview-report-bug below anyhow. Any ideas what might be the
cause of my trouble?
Felix
Emacs : GNU Emacs 21.2.1 (i586-suse-linux, X toolkit, Xaw3d scroll bars)
of 2002-09-11 on amdsimb
Package: rel-0-7-8
current state:
==============
Output from running `gs -h':
ESP Ghostscript 7.05.3 (2002-06-28)
Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
-dNOPAUSE no pause after page | -q `quiet', fewer
messages
-g<width>x<height> page size in pixels | -r<res> pixels/inch resolution
-sDEVICE=<devname> select device | -dBATCH exit after last file
-sOutputFile=<file> select output file: - for stdout, |command for pipe,
embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PDF
Available devices:
x11 x11alpha x11cmyk x11cmyk2 x11cmyk4 x11cmyk8 x11gray2 x11gray4 x11mono
x11rg16x x11rg32x appledmp iwhi iwlo iwlq t4693d2 t4693d4 t4693d8 tek4696
ap3250 dmprt epson eps9mid eps9high epsonc lp8000 lq850 st800 stcolor
photoex escp escpc escpage lp8800c lp8300c lp8500c lp3000c lp8200c
lp8000c alc2000 alc4000 alc8500 lp2000 lp2200 lp9400 lp8900 lp8700 lp8100
lp7700 lp8600f lp8400f lp8300f lp1900 lp9600s lp9300 lp9600 lp8600 lp1800
epl5800 epl5900 epl2050 epl2050p epl2120 mj700v2c mj500c mj6000c mj8000c
hl1250 hl1240 hl7x0 samsunggdi atx23 atx24 atx38 coslw2p coslwxl cdeskjet
cdjcolor cdjmono cdj500 cdj550 cdj670 cdj850 cdj880 cdj890 cdj970 cdj1600
chp2200 deskjet djet500 djet500c dnj650c djet820c paintjet pj pjetxl pjxl
pjxl300 dj505j picty180 laserjet ljet2p ljet3 ljet3d ljet4 ljet4pjl
lj4dithp lj3100sw ljet4d lj4dith ljetplus lj5mono lj5gray cljet5 cljet5c
cljet5pr declj250 lj250 dl2100 fs600 bj10e bj10v bj10vh bj200 bjcmono
bjcgray bjccmyk bjccolor bjc600 bjc800 bjc880j lips2p lips3 lips4 lips4v
lbp8 lbp310 lbp320 lxm5700m lxm3200 lex7000 lex5700 lex3200 lex2050 fmpr
fmlbp md50Mono md50Eco md1xMono md2k md5k la50 la70 la75 la75plus ln03
lp2563 ccr cp50 ibmpro imagen jetp3852 m8510 necp6 npdl pr201 pr150
pr1000 pr1000_4 oce9050 oki182 oki4w okiibm ml600 r4081 rpdl sj48 jj100
xes pbm pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw
pksm pksmraw plan9bm inferno dfaxhigh dfaxlow faxg3 faxg32d faxg4 cfax
bff tiffcrle tiffg3 tiffg32d tiffg4 tiff12nc tiff24nc tifflzw tiffpack
psmono psgray psrgb bbox bit bitrgb bitcmyk sunhmono mgrmono mgrgray2
mgrgray4 mgrgray8 mgr4 mgr8 cgmmono cgm8 cgm24 cif jpeg jpeggray miff24
pcxmono pcxgray pcx16 pcx256 pcx24b pcxcmyk pcx2up pngmono pnggray png16
png256 png16m pnga sgirgb mag16 mag256 bmpmono bmpgray bmpsep1 bmpsep8
bmp16 bmp256 bmp16m bmp32b bmpamono bmpa16 bmpa16m bmpa256 bmpa32b
bmpasep1 bmpasep8 pdfwrite pswrite epswrite pxlmono pxlcolor ijs cups
omni uniprint pcl3 hpdjplus hpdjportable hpdj310 hpdj320 hpdj340 hpdj400
hpdj500 hpdj500c hpdj510 hpdj520 hpdj540 hpdj550c hpdj560c hpdj600
hpdj660c hpdj670c hpdj680c hpdj690c hpdj850c hpdj855c hpdj870c hpdj890c
hpdj1120c hpdj stp nullpage
Search path:
. : /usr/share/ghostscript/7.05/lib : /usr/share/ghostscript/fonts
For more information, see /usr/share/ghostscript/7.05/doc/Use.htm.
Report bugs to bug-gs@ghostscript.com, using the form in Bug-form.htm.
(setq
AUC-TeX-version "11.11"
LaTeX-command-style '(("." "latex"))
image-types '(png gif tiff jpeg xpm pbm postscript xbm)
preview-image-type 'png
preview-image-creators '((postscript (open preview-eps-open) (place
preview-eps-place))
(png (open previe
w-gs-open png ("-sDEVICE=png16m")) (place preview-gs-place)
(close preview-gs-close))
(jpeg (open previ
ew-gs-open jpeg ("-sDEVICE=jpeg")) (place preview-gs-place)
(close preview-gs-close))
(pnm (open previe
w-gs-open pbm ("-sDEVICE=pnmraw")) (place preview-gs-place)
(close preview-gs-close))
(tiff (open preview-g
s-open tiff ("-sDEVICE=tiff12nc")) (place preview-gs-place)
(close preview-gs-close))
)
preview-gs-command "gs"
preview-gs-options '("-q" "-dSAFER" "-dDELAYSAFER" "-dNOPAUSE"
"-DNOPLATFONTS" "-dTextAlphaBits=4"
"-dGraphicsAlphaBits=4")
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\\PassOptionsToPackage{" ("," .
preview-required-option-list)
"}{preview}\\AtB
eginDocument{\\ifx\\ifPreview\\undefined" preview-default-preamble
"\\fi}\\input{%t}\"")
preview-required-option-list '("active" "dvips" "auctex")
preview-default-option-list '("displaymath" "floats" "graphics" "textmath"
"sections" "footnotes")
preview-default-preamble '("\\RequirePackage[" ("," .
preview-default-option-list) "]{preview}"
"\\PreviewCommand[!][\\#]\\ref")
preview-LaTeX-command-replacements '(("\\`\\(pdf\\)?\\(.*\\)\\'" "\\2"))
preview-dump-replacements '(preview-LaTeX-command-replacements
("\\`\\(pdf\\)?\\(e?\\)\\(la\\)?tex\\(\\( -\\([^ \"]\\|\"[^\"]*\"\\)*\\
)*\\)\\(.*\\)\\'" "\\2initex\\4 \"&\\2\\3tex\" " preview-format-name ".ini \\7")
)
preview-undump-replacements '(("\\`\\(e?\\)\\(la\\)?tex\\(\\( -\\([^
\"]\\|\"[^\"]*\"\\)*\\)*\\).*\\input{\\([^}]*\\)}.*\\'" "\\1virtex\\3 \"&"
preview-format-name "\" \\6")
)
preview-auto-cache-preamble 'ask
)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-26 20:21 ` Felix E. Klee
@ 2003-02-26 20:31 ` David Kastrup
2003-02-27 11:46 ` Felix E. Klee
0 siblings, 1 reply; 18+ messages in thread
From: David Kastrup @ 2003-02-26 20:31 UTC (permalink / raw)
"Felix E. Klee" <felix.klee@inka.de> writes:
> David Kastrup wrote:
> > \PreviewCommand[!][\#]\ref
> > \InputIfFileExists{preview/prauctex.cfg}{}{}
> >
> > in your project directory. You could also try
> > \PreviewCommand[!]\ref
> > to have the dereferenced label itself displayed as typeset by LaTeX,
> > or
> > \RequirePackage{url}
> > \PreviewCommand[!][\@firstoftwo\url#1]\ref
> > to have the original label text in typewriter mode and so on.
>
> Hm, I just tried it but it doesn't work. Here's what I did:
Reading the manual or the FAQ or the style file documentation about
customization would have been sufficient to tell you in mere seconds
that I am an idiot that does not even remember the names of his
own macros.
Apropos: try \PreviewMacro instead of \PreviewCommand.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-26 20:31 ` David Kastrup
@ 2003-02-27 11:46 ` Felix E. Klee
2003-02-27 13:20 ` David Kastrup
0 siblings, 1 reply; 18+ messages in thread
From: Felix E. Klee @ 2003-02-27 11:46 UTC (permalink / raw)
David Kastrup wrote:
> Apropos: try \PreviewMacro instead of \PreviewCommand.
Thanks, now it works. However, it is not quite what I was after: I wanted
the '#' to be displayed in the default font, not as an image.
Felix
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 11:46 ` Felix E. Klee
@ 2003-02-27 13:20 ` David Kastrup
2003-02-27 13:39 ` Felix E. Klee
0 siblings, 1 reply; 18+ messages in thread
From: David Kastrup @ 2003-02-27 13:20 UTC (permalink / raw)
"Felix E. Klee" <felix.klee@inka.de> writes:
> David Kastrup wrote:
> > Apropos: try \PreviewMacro instead of \PreviewCommand.
>
> Thanks, now it works. However, it is not quite what I was after: I
> wanted the '#' to be displayed in the default font, not as an image.
Well, _that_ is something that preview-latex can't do. Yet. In
principle, it would not be too hard _not_ to write out an image, but
merely text how something should be displayed.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 13:20 ` David Kastrup
@ 2003-02-27 13:39 ` Felix E. Klee
2003-02-27 13:40 ` David Kastrup
0 siblings, 1 reply; 18+ messages in thread
From: Felix E. Klee @ 2003-02-27 13:39 UTC (permalink / raw)
David Kastrup wrote:
>> > Apropos: try \PreviewMacro instead of \PreviewCommand.
>>
>> Thanks, now it works. However, it is not quite what I was after: I
>> wanted the '#' to be displayed in the default font, not as an image.
>
> Well, _that_ is something that preview-latex can't do. Yet.
BTW, such a feature would also be great for example for replacing "\emph{bla
bla bla}" by "bla bla bla" displayed in bold face.
Felix
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 13:39 ` Felix E. Klee
@ 2003-02-27 13:40 ` David Kastrup
2003-02-27 14:11 ` Felix E. Klee
0 siblings, 1 reply; 18+ messages in thread
From: David Kastrup @ 2003-02-27 13:40 UTC (permalink / raw)
"Felix E. Klee" <felix.klee@inka.de> writes:
> David Kastrup wrote:
> >> > Apropos: try \PreviewMacro instead of \PreviewCommand.
> >>
> >> Thanks, now it works. However, it is not quite what I was after: I
> >> wanted the '#' to be displayed in the default font, not as an image.
> >
> > Well, _that_ is something that preview-latex can't do. Yet.
>
> BTW, such a feature would also be great for example for replacing
> "\emph{bla bla bla}" by "bla bla bla" displayed in bold face.
If you think it great, you can already do so with font-lock-mode.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 13:40 ` David Kastrup
@ 2003-02-27 14:11 ` Felix E. Klee
2003-02-27 14:34 ` David Kastrup
0 siblings, 1 reply; 18+ messages in thread
From: Felix E. Klee @ 2003-02-27 14:11 UTC (permalink / raw)
David Kastrup wrote:
>> >> > Apropos: try \PreviewMacro instead of \PreviewCommand.
>> >>
>> >> Thanks, now it works. However, it is not quite what I was after: I
>> >> wanted the '#' to be displayed in the default font, not as an image.
>> >
>> > Well, _that_ is something that preview-latex can't do. Yet.
>>
>> BTW, such a feature would also be great for example for replacing
>> "\emph{bla bla bla}" by "bla bla bla" displayed in bold face.
>
> If you think it great, you can already do so with font-lock-mode.
But font-lock-mode can't hide he "\emph{" and the corresponding "}", right?
Felix
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 14:11 ` Felix E. Klee
@ 2003-02-27 14:34 ` David Kastrup
2003-02-27 16:12 ` Oliver Scholz
0 siblings, 1 reply; 18+ messages in thread
From: David Kastrup @ 2003-02-27 14:34 UTC (permalink / raw)
"Felix E. Klee" <felix.klee@inka.de> writes:
> David Kastrup wrote:
> >> >> > Apropos: try \PreviewMacro instead of \PreviewCommand.
> >> >>
> >> >> Thanks, now it works. However, it is not quite what I was after: I
> >> >> wanted the '#' to be displayed in the default font, not as an image.
> >> >
> >> > Well, _that_ is something that preview-latex can't do. Yet.
> >>
> >> BTW, such a feature would also be great for example for replacing
> >> "\emph{bla bla bla}" by "bla bla bla" displayed in bold face.
> >
> > If you think it great, you can already do so with font-lock-mode.
>
> But font-lock-mode can't hide he "\emph{" and the corresponding "}", right?
Well, you could let it use an invisible font or something, but that
would probably be not quite convenient for editing. Perhaps in
connection with auto-reveal-mode something could be fudged.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 14:34 ` David Kastrup
@ 2003-02-27 16:12 ` Oliver Scholz
2003-02-27 16:40 ` David Kastrup
0 siblings, 1 reply; 18+ messages in thread
From: Oliver Scholz @ 2003-02-27 16:12 UTC (permalink / raw)
David Kastrup <dak@gnu.org> writes:
> "Felix E. Klee" <felix.klee@inka.de> writes:
[...]
>> But font-lock-mode can't hide he "\emph{" and the corresponding "}", right?
>
> Well, you could let it use an invisible font or something, but that
> would probably be not quite convenient for editing. Perhaps in
> connection with auto-reveal-mode something could be fudged.
[...]
Hmm, what would be the cleaner/easier solution: to add that feature to
preview-latex or to the font-locking in AUCTeX?
[What do you mean by "invisible font"?]
Oliver
--
9 Ventôse an 211 de la Révolution
Liberté, Egalité, Fraternité!
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 16:12 ` Oliver Scholz
@ 2003-02-27 16:40 ` David Kastrup
2003-02-27 17:01 ` Oliver Scholz
2003-02-28 10:36 ` Felix E. Klee
0 siblings, 2 replies; 18+ messages in thread
From: David Kastrup @ 2003-02-27 16:40 UTC (permalink / raw)
Oliver Scholz <alkibiades@gmx.de> writes:
> David Kastrup <dak@gnu.org> writes:
>
> > "Felix E. Klee" <felix.klee@inka.de> writes:
> [...]
> >> But font-lock-mode can't hide he "\emph{" and the corresponding "}", right?
> > Well, you could let it use an invisible font or something, but that
> > would probably be not quite convenient for editing. Perhaps in
> > connection with auto-reveal-mode something could be fudged.
> [...]
>
> Hmm, what would be the cleaner/easier solution: to add that feature to
> preview-latex or to the font-locking in AUCTeX?
preview-latex would need to achieve two different things here: not
display \emph at all, and add text properties to the argument. The
interface does not currently permit a command and its arguments to be
treated differently, and it might be quite a feat to implement
something like that consistently. OTOH, it would offer quite numerous
possibilities to mark things up in the Emacs buffer that are hard to
parse correctly otherwise. For example, if you take the source code
of packages like verbatim.sty, it is almost impossible with all the
catcode changes and whatever going on to let Emacs correctly
determine just what is to be font locked as verbatim and what not.
Using preview-latex would make getting the correct information easy.
> [What do you mean by "invisible font"?]
Text property 'invisible would probably be sufficient. I am not sure
if font-lock-mode can only select particular faces (in which case one
would use something like invisible-face) or arbitrary text properties.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 16:40 ` David Kastrup
@ 2003-02-27 17:01 ` Oliver Scholz
2003-02-28 16:23 ` Oliver Scholz
2003-02-28 10:36 ` Felix E. Klee
1 sibling, 1 reply; 18+ messages in thread
From: Oliver Scholz @ 2003-02-27 17:01 UTC (permalink / raw)
David Kastrup <dak@gnu.org> writes:
[...]
> OTOH, it would offer quite numerous possibilities to mark things up
> in the Emacs buffer that are hard to parse correctly otherwise. For
> example, if you take the source code of packages like verbatim.sty,
> it is almost impossible with all the catcode changes and whatever
> going on to let Emacs correctly determine just what is to be font
> locked as verbatim and what not. Using preview-latex would make
> getting the correct information easy.
Unfortunately I am rather a dummy when it comes to LaTeX, so
personally I would rather not go down that path.
>> [What do you mean by "invisible font"?]
>
> Text property 'invisible would probably be sufficient. I am not sure
> if font-lock-mode can only select particular faces (in which case one
> would use something like invisible-face) or arbitrary text properties.
AFAIK you can't put arbitrary text properties on the text out of the
box. But font-lock can execute arbitrary code when it finds a
match. This could be used to do this. It could also put appropriate
functions on the `point-entered' and `point-left' properties to
implement the auto-reveal/auto-hide stuff.
Should this be implemented as a minor mode?
Oliver
--
9 Ventôse an 211 de la Révolution
Liberté, Egalité, Fraternité!
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 16:40 ` David Kastrup
2003-02-27 17:01 ` Oliver Scholz
@ 2003-02-28 10:36 ` Felix E. Klee
2003-02-28 11:07 ` David Kastrup
1 sibling, 1 reply; 18+ messages in thread
From: Felix E. Klee @ 2003-02-28 10:36 UTC (permalink / raw)
David Kastrup wrote:
>> [...]
>> >> But font-lock-mode can't hide he "\emph{" and the corresponding "}",
>> >> right?
>> > Well, you could let it use an invisible font or something, but that
>> > would probably be not quite convenient for editing. Perhaps in
>> > connection with auto-reveal-mode something could be fudged.
>> [...]
>>
>> Hmm, what would be the cleaner/easier solution: to add that feature to
>> preview-latex or to the font-locking in AUCTeX?
>
> preview-latex would need to achieve two different things here: not
> display \emph at all, and add text properties to the argument. The
> interface does not currently permit a command and its arguments to be
> treated differently, and it might be quite a feat to implement
> something like that consistently.
Is this really neccessary? Preview-LaTeX takes for example "\emph{bla bla
bla}" and passes it to an external tool, latex, which creates an image that
replaces the corresponding text. Wouldn't it be possible to let the user
specify another tool (probably a simple lisp function) instead that takes
"\emph{bla bla bla}", processes it and creates soem text (eg. "*bla bla
bla*", faces might be problematic) that is used to replace "\emph{bla bla
bla}"?
Felix
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-28 10:36 ` Felix E. Klee
@ 2003-02-28 11:07 ` David Kastrup
2003-02-28 12:33 ` Felix E. Klee
0 siblings, 1 reply; 18+ messages in thread
From: David Kastrup @ 2003-02-28 11:07 UTC (permalink / raw)
"Felix E. Klee" <felix.klee@inka.de> writes:
> David Kastrup wrote:
> >> [...]
> >> >> But font-lock-mode can't hide he "\emph{" and the corresponding "}",
> >> >> right?
> >> > Well, you could let it use an invisible font or something, but that
> >> > would probably be not quite convenient for editing. Perhaps in
> >> > connection with auto-reveal-mode something could be fudged.
> >> [...]
> >>
> >> Hmm, what would be the cleaner/easier solution: to add that feature to
> >> preview-latex or to the font-locking in AUCTeX?
> >
> > preview-latex would need to achieve two different things here: not
> > display \emph at all, and add text properties to the argument. The
> > interface does not currently permit a command and its arguments to be
> > treated differently, and it might be quite a feat to implement
> > something like that consistently.
>
> Is this really neccessary? Preview-LaTeX takes for example "\emph{bla bla
> bla}" and passes it to an external tool, latex, which creates an image that
> replaces the corresponding text. Wouldn't it be possible to let the user
> specify another tool (probably a simple lisp function) instead that takes
> "\emph{bla bla bla}", processes it and creates soem text (eg. "*bla bla
> bla*", faces might be problematic) that is used to replace "\emph{bla bla
> bla}"?
That would be close to useless. The main problem with preview-latex
is that images themselves are not editable, and the larger the unit
becomes (like a whole figure), the less convenient for editing. When
you enter such an image, it gets replaced by its source text. You
can already let preview-latex let an environment like \emph be
replaced by a _graphic_. The main problem is not that it is a
graphic, but that you can't edit it because the relation between its
looks and the source text can't be reestablished, and that its line
breaks are completely different and so on.
You demand something that has all the editing disadvantages of an
image without an obvious advantage to show.
No, if this feature is supposed to be usable separately, it must have
a way to specify text properties affixed to the source text instead
of merely a replacement text. That preview-latex would then make
sense even on text terminals would be a funny side effect.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-28 11:07 ` David Kastrup
@ 2003-02-28 12:33 ` Felix E. Klee
0 siblings, 0 replies; 18+ messages in thread
From: Felix E. Klee @ 2003-02-28 12:33 UTC (permalink / raw)
David Kastrup wrote:
>> Is this really neccessary? Preview-LaTeX takes for example "\emph{bla bla
>> bla}" and passes it to an external tool, latex, which creates an image
>> that replaces the corresponding text. Wouldn't it be possible to let the
>> user specify another tool (probably a simple lisp function) instead that
>> takes "\emph{bla bla bla}", processes it and creates soem text (eg. "*bla
>> bla bla*", faces might be problematic) that is used to replace "\emph{bla
>> bla bla}"?
>
> That would be close to useless. The main problem with preview-latex
> is that images themselves are not editable, and the larger the unit
> becomes (like a whole figure), the less convenient for editing. When
> you enter such an image, it gets replaced by its source text. You
> can already let preview-latex let an environment like \emph be
> replaced by a _graphic_. The main problem is not that it is a
> graphic, but that you can't edit it because the relation between its
> looks and the source text can't be reestablished, and that its line
> breaks are completely different and so on.
>
> You demand something that has all the editing disadvantages of an
> image without an obvious advantage to show.
Here are some advantages for displaying text instead of images:
1. It is faster.
2. It might be more readable when the face that is used is similar or
identical to the default face.
3. Text can be wrapped when a line gets too long.
> No, if this feature is supposed to be usable separately, it must have
> a way to specify text properties affixed to the source text instead
> of merely a replacement text.
That would be a cool feature, but is not absolutely neccessary, IMHO.
Felix
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Hiding references when editing LaTeX?
2003-02-27 17:01 ` Oliver Scholz
@ 2003-02-28 16:23 ` Oliver Scholz
0 siblings, 0 replies; 18+ messages in thread
From: Oliver Scholz @ 2003-02-28 16:23 UTC (permalink / raw)
Oliver Scholz <alkibiades@gmx.de> writes:
[...]
> It could also put appropriate functions on the `point-entered' and
> `point-left' properties to implement the auto-reveal/auto-hide
> stuff.
[...]
Hmpf, it seems that there is a bug in the code dealing with those
properties.
Oliver
--
10 Ventôse an 211 de la Révolution
Liberté, Egalité, Fraternité!
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2003-02-28 16:23 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-26 19:15 Hiding references when editing LaTeX? Felix E. Klee
2003-02-26 19:39 ` David Kastrup
2003-02-26 19:54 ` Felix E. Klee
2003-02-26 20:21 ` Felix E. Klee
2003-02-26 20:31 ` David Kastrup
2003-02-27 11:46 ` Felix E. Klee
2003-02-27 13:20 ` David Kastrup
2003-02-27 13:39 ` Felix E. Klee
2003-02-27 13:40 ` David Kastrup
2003-02-27 14:11 ` Felix E. Klee
2003-02-27 14:34 ` David Kastrup
2003-02-27 16:12 ` Oliver Scholz
2003-02-27 16:40 ` David Kastrup
2003-02-27 17:01 ` Oliver Scholz
2003-02-28 16:23 ` Oliver Scholz
2003-02-28 10:36 ` Felix E. Klee
2003-02-28 11:07 ` David Kastrup
2003-02-28 12:33 ` Felix E. Klee
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.