* Controlling font styles in latex-mode
@ 2010-04-17 16:44 Ramesh Sridharan
2010-04-18 8:50 ` Peter Dyballa
0 siblings, 1 reply; 3+ messages in thread
From: Ramesh Sridharan @ 2010-04-17 16:44 UTC (permalink / raw)
To: help-gnu-emacs
I was wondering how to tell emacs not to allow style changes that
change font face. In particular, latex-mode causes a number of changes
I don't like:
- Text inside of a \section{} or \subsection{} block is bigger and
variable-width
- Superscripts and subscripts are shown in superscript or subscript,
making them smaller.
I find syntax highlighting very useful, so I don't want to disable
font-lock altogether. Is there any way to prevent changes to the font
size or face (i.e. I don't want anything to become bigger, smaller, or
change in font, but color changes are OK)?
I've tried (setq font-lock-maximum-decoration X) with X as nil and t,
but nil is too little (i.e. it completely gets rid of syntax
highlighting), and t is too much (i.e. it's overly decorated as
described above). Here are the relevant (i.e. non-comment) lines of my
.emacs:
;;;;;;;;;;;;
(modify-frame-parameters nil '((wait-for-wm . nil)))
(set-background-color "black")
(set-foreground-color "white")
(set-cursor-color "white")
(global-font-lock-mode t)
(show-paren-mode)
;;;;;;;;;;;;
I'm using emacs 22.2.1 on Debian (lenny).
Thanks,
Ramesh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Controlling font styles in latex-mode
2010-04-17 16:44 Controlling font styles in latex-mode Ramesh Sridharan
@ 2010-04-18 8:50 ` Peter Dyballa
0 siblings, 0 replies; 3+ messages in thread
From: Peter Dyballa @ 2010-04-18 8:50 UTC (permalink / raw)
To: Ramesh Sridharan; +Cc: help-gnu-emacs
Am 17.04.2010 um 18:44 schrieb Ramesh Sridharan:
> I find syntax highlighting very useful, so I don't want to disable
> font-lock altogether. Is there any way to prevent changes to the font
> size or face (i.e. I don't want anything to become bigger, smaller, or
> change in font, but color changes are OK)?
Customisation? (Point in that face, C-u x =, in *Help* buffer follow
the hyper-link, save for session, save for the remainder of your life.
No, this won't work, you're working with software from last
millennium! I think... M-x describe-face RET should work.)
Or extract some code from tex-mode.el and put it into your init file.
--
Greetings
Pete
Theory and practice are the same, in theory, but, in practice, they
are different.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Controlling font styles in latex-mode
@ 2010-04-18 13:28 Steve Revilak
0 siblings, 0 replies; 3+ messages in thread
From: Steve Revilak @ 2010-04-18 13:28 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]
>From: Ramesh Sridharan <ramesh.eecs@gmail.com>
>I was wondering how to tell emacs not to allow style changes that
>change font face. In particular, latex-mode causes a number of changes
>I don't like:
>
>- Text inside of a \section{} or \subsection{} block is bigger and
>variable-width
>- Superscripts and subscripts are shown in superscript or subscript,
>making them smaller.
...
>I'm using emacs 22.2.1 on Debian (lenny).
You should be able to make most of the changes with M-x
customize-face. For example, to change the appearance of text within
\section{...},
- put point in the \section{...} name (i.e. between the braces)
- M-x customize-face
Then change the face to suit your taste.
IIRC emacs-22 gives you the ability to change the face of superscript
and subscript characters, but the raise/lower amounts are hardwired
into tex-mode.el. For example, I have a copy of emacs-22.3 where
(defun tex-font-lock-suscript) in tex-mode.el ends with the following
code:
(if (eq (char-after pos) ?_)
'(face subscript display (raise -0.3))
'(face superscript display (raise +0.3))))
The only way I was able to prevent the raising (lowering) of
superscript (subscript) characters in emacs 22, was by changing the
`raise' amounts to 0.0, and then byte-recompiling tex-mode.el. The
process was something like this
- mv tex-mode.el.gz tex-mode.el.gz.ORIG
- mv tex-mode.elc tex-mode.elc.ORIG
- gunzip -c < tex-mode.el.gz.ORIG > tex-mode.el
- edit tex-mode.el. Change the raise amounts from -0.3 (or +0.3) to
0.0
- byte compile the modified tex-mode.el. dired's `B' command does
this (but there are other ways)
Emacs-23 adds a new variable, tex-font-script-display, which controls
the raise/lower amounts, and eliminates the need to modify
tex-mode.el.
Steve
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-18 13:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-17 16:44 Controlling font styles in latex-mode Ramesh Sridharan
2010-04-18 8:50 ` Peter Dyballa
-- strict thread matches above, loose matches on Subject: below --
2010-04-18 13:28 Steve Revilak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).