all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* suppress superscript and subscript formatting?
@ 2025-02-04  0:35 Shane Elipot
  2025-02-04  9:21 ` Stephen Berman
  0 siblings, 1 reply; 9+ messages in thread
From: Shane Elipot @ 2025-02-04  0:35 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

in LaTeX-mode, I have tried in vain to suppress the seemingly default formatting of superscript and subscript command in math mode, such as $x^2$ which raises visually the “2”. I have tried several configurations already but I am still unable to suppress this behavior. The whole point of Emacs for me is to *not* have any of these features in my editing windows, otherwise I would use Word or something …

Any help would be greatly appreciated.

Best

So far in my .emacs file I have all of the following, nothing works:

;; super-/sub-script on baseline
(setq font-latex-script-display (quote (nil)))

(global-prettify-symbols-mode -1)
(add-hook 'latex-mode-hook (lambda () (prettify-symbols-mode -1)))

;; Disable AUCTeX automatic features
(setq TeX-auto-save nil)
(setq TeX-parse-self nil)

(setq font-latex-fontify-script nil)

(eval-after-load 'font-latex
  '(setq font-latex-fontify-script nil)) ;; Disable subscript/superscript fontification

(setq latex-unicode-math-mode nil)







^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: suppress superscript and subscript formatting?
  2025-02-04  0:35 suppress superscript and subscript formatting? Shane Elipot
@ 2025-02-04  9:21 ` Stephen Berman
  2025-02-04  9:42   ` Stephen Berman
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2025-02-04  9:21 UTC (permalink / raw)
  To: Shane Elipot; +Cc: help-gnu-emacs

On Mon, 3 Feb 2025 16:35:34 -0800 Shane Elipot <selipot@gmail.com> wrote:

> Hi,
>
> in LaTeX-mode, I have tried in vain to suppress the seemingly default
> formatting of superscript and subscript command in math mode, such as $x^2$
> which raises visually the “2”. I have tried several configurations already but
> I am still unable to suppress this behavior. The whole point of Emacs for me
> is to *not* have any of these features in my editing windows, otherwise I
> would use Word or something …
>
> Any help would be greatly appreciated.

For AUCTeX, customize `font-latex-script-display' to '(nil).
For built-in latex-mode, customize `tex-font-script-display' to '(0 0).

Steve Berman



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: suppress superscript and subscript formatting?
  2025-02-04  9:21 ` Stephen Berman
@ 2025-02-04  9:42   ` Stephen Berman
  2025-02-04 10:03     ` Arash Esbati
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2025-02-04  9:42 UTC (permalink / raw)
  To: Shane Elipot; +Cc: help-gnu-emacs

On Tue, 04 Feb 2025 10:21:59 +0100 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Mon, 3 Feb 2025 16:35:34 -0800 Shane Elipot <selipot@gmail.com> wrote:
>
>> Hi,
>>
>> in LaTeX-mode, I have tried in vain to suppress the seemingly default
>> formatting of superscript and subscript command in math mode, such as $x^2$
>> which raises visually the “2”. I have tried several configurations already but
>> I am still unable to suppress this behavior. The whole point of Emacs for me
>> is to *not* have any of these features in my editing windows, otherwise I
>> would use Word or something …
>>
>> Any help would be greatly appreciated.
>
> For AUCTeX, customize `font-latex-script-display' to '(nil).

Oh, I missed that you had tried this in your init file:

(setq font-latex-script-display (quote (nil)))

I tested my suggestion by using the Customize UI and it worked for me.
Does it also fail for you when you use the Customize UI or alternatively
using `setopt' instead of `setq' in your init file?

Steve Berman



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: suppress superscript and subscript formatting?
  2025-02-04  9:42   ` Stephen Berman
@ 2025-02-04 10:03     ` Arash Esbati
  2025-02-04 10:11       ` Stephen Berman
  0 siblings, 1 reply; 9+ messages in thread
From: Arash Esbati @ 2025-02-04 10:03 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Shane Elipot, help-gnu-emacs

Stephen Berman <stephen.berman@gmx.net> writes:

> Oh, I missed that you had tried this in your init file:
>
> (setq font-latex-script-display (quote (nil)))
>
> I tested my suggestion by using the Customize UI and it worked for me.
> Does it also fail for you when you use the Customize UI or alternatively
> using `setopt' instead of `setq' in your init file?

I didn't try the Custom UI, but

  (setq font-latex-script-display nil)

works for me which is different from

  (setq font-latex-script-display '(nil))

Best, Arash



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: suppress superscript and subscript formatting?
  2025-02-04 10:03     ` Arash Esbati
@ 2025-02-04 10:11       ` Stephen Berman
  2025-02-04 10:22         ` Stephen Berman
  2025-02-04 10:22         ` Arash Esbati
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Berman @ 2025-02-04 10:11 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Shane Elipot, help-gnu-emacs

On Tue, 04 Feb 2025 11:03:11 +0100 Arash Esbati <arash@gnu.org> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> Oh, I missed that you had tried this in your init file:
>>
>> (setq font-latex-script-display (quote (nil)))
>>
>> I tested my suggestion by using the Customize UI and it worked for me.
>> Does it also fail for you when you use the Customize UI or alternatively
>> using `setopt' instead of `setq' in your init file?
>
> I didn't try the Custom UI, but
>
>   (setq font-latex-script-display nil)

That also works for me.

> works for me which is different from
>
>   (setq font-latex-script-display '(nil))

But in fact that works for me, too, so I don't know why it apparently
doesn't work for the OP.

Steve Berman



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: suppress superscript and subscript formatting?
  2025-02-04 10:11       ` Stephen Berman
@ 2025-02-04 10:22         ` Stephen Berman
  2025-02-04 10:47           ` Arash Esbati
  2025-02-04 10:22         ` Arash Esbati
  1 sibling, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2025-02-04 10:22 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Shane Elipot, help-gnu-emacs

On Tue, 04 Feb 2025 11:11:10 +0100 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Tue, 04 Feb 2025 11:03:11 +0100 Arash Esbati <arash@gnu.org> wrote:
>
>> Stephen Berman <stephen.berman@gmx.net> writes:
>>
>>> Oh, I missed that you had tried this in your init file:
>>>
>>> (setq font-latex-script-display (quote (nil)))
>>>
>>> I tested my suggestion by using the Customize UI and it worked for me.
>>> Does it also fail for you when you use the Customize UI or alternatively
>>> using `setopt' instead of `setq' in your init file?
>>
>> I didn't try the Custom UI, but
>>
>>   (setq font-latex-script-display nil)
>
> That also works for me.
>
>> works for me which is different from
>>
>>   (setq font-latex-script-display '(nil))
>
> But in fact that works for me, too, so I don't know why it apparently
> doesn't work for the OP.

One possibility that occurs to me (but I haven't tested it) is that, if
the setq is evaluated in the init file before AUCTeX is loaded, then it
may be overwritten when AUCTeX is loaded.

Steve Berman



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: suppress superscript and subscript formatting?
  2025-02-04 10:11       ` Stephen Berman
  2025-02-04 10:22         ` Stephen Berman
@ 2025-02-04 10:22         ` Arash Esbati
  1 sibling, 0 replies; 9+ messages in thread
From: Arash Esbati @ 2025-02-04 10:22 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Shane Elipot, help-gnu-emacs

Stephen Berman <stephen.berman@gmx.net> writes:

> But in fact that works for me, too, so I don't know why it apparently
> doesn't work for the OP.

My apologies, I meant to say that this form:

  (setq font-latex-fontify-script nil)

works for me and disables the raising/lowering of super/subscripts.  I
don't touch `font-latex-script-display'.

I think the OP should tell us which AUCTeX version he's using and how he
installed it.  Maybe that helps debugging.

Best, Arash



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: suppress superscript and subscript formatting?
  2025-02-04 10:22         ` Stephen Berman
@ 2025-02-04 10:47           ` Arash Esbati
  2025-02-04 17:21             ` Shane Elipot
  0 siblings, 1 reply; 9+ messages in thread
From: Arash Esbati @ 2025-02-04 10:47 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Shane Elipot, help-gnu-emacs

Stephen Berman <stephen.berman@gmx.net> writes:

> One possibility that occurs to me (but I haven't tested it) is that, if
> the setq is evaluated in the init file before AUCTeX is loaded, then it
> may be overwritten when AUCTeX is loaded.

This shouldn't happen:

(progn
  (setq my/foo nil)
  (defcustom my/foo t "My foo")
  my/foo)
=> nil

`defcustom' doesn't overwrite the value of a variable which is the
default behavior of `defvar':

,----[ C-h f defvar RET ]
| defvar is a special-form in ‘C source code’.
| 
| (defvar SYMBOL &optional INITVALUE DOCSTRING)
| 
| Define SYMBOL as a variable, and return SYMBOL.
| You are not required to define a variable in order to use it, but
| defining it lets you supply an initial value and documentation, which
| can be referred to by the Emacs help facilities and other programming
| tools.
| 
| If SYMBOL’s value is void and the optional argument INITVALUE is
| provided, INITVALUE is evaluated and the result used to set SYMBOL’s
| value.  [...]
|
`----

Best, Arash



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: suppress superscript and subscript formatting?
  2025-02-04 10:47           ` Arash Esbati
@ 2025-02-04 17:21             ` Shane Elipot
  0 siblings, 0 replies; 9+ messages in thread
From: Shane Elipot @ 2025-02-04 17:21 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Stephen Berman, help-gnu-emacs

Thank you for your help. I reinstalled auctex and cleaned what was probably conflicting and improper settings in .emacs. This now works with

(setq font-latex-fontify-script nil)  




> On Feb 4, 2025, at 2:47 AM, Arash Esbati <arash@gnu.org> wrote:
> 
> Stephen Berman <stephen.berman@gmx.net> writes:
> 
>> One possibility that occurs to me (but I haven't tested it) is that, if
>> the setq is evaluated in the init file before AUCTeX is loaded, then it
>> may be overwritten when AUCTeX is loaded.
> 
> This shouldn't happen:
> 
> (progn
>  (setq my/foo nil)
>  (defcustom my/foo t "My foo")
>  my/foo)
> => nil
> 
> `defcustom' doesn't overwrite the value of a variable which is the
> default behavior of `defvar':
> 
> ,----[ C-h f defvar RET ]
> | defvar is a special-form in ‘C source code’.
> | 
> | (defvar SYMBOL &optional INITVALUE DOCSTRING)
> | 
> | Define SYMBOL as a variable, and return SYMBOL.
> | You are not required to define a variable in order to use it, but
> | defining it lets you supply an initial value and documentation, which
> | can be referred to by the Emacs help facilities and other programming
> | tools.
> | 
> | If SYMBOL’s value is void and the optional argument INITVALUE is
> | provided, INITVALUE is evaluated and the result used to set SYMBOL’s
> | value.  [...]
> |
> `----
> 
> Best, Arash



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-02-04 17:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04  0:35 suppress superscript and subscript formatting? Shane Elipot
2025-02-04  9:21 ` Stephen Berman
2025-02-04  9:42   ` Stephen Berman
2025-02-04 10:03     ` Arash Esbati
2025-02-04 10:11       ` Stephen Berman
2025-02-04 10:22         ` Stephen Berman
2025-02-04 10:47           ` Arash Esbati
2025-02-04 17:21             ` Shane Elipot
2025-02-04 10:22         ` Arash Esbati

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.