[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Bug: org-use-sub-superscripts not working [8.2.3b (8.2.3b-elpa @
From: |
Nick Dokos |
Subject: |
Re: [O] Bug: org-use-sub-superscripts not working [8.2.3b (8.2.3b-elpa @ c:/Users/xxx/.emacs.d/elpa/org-20131112/)] |
Date: |
Thu, 14 Nov 2013 16:19:27 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
address@hidden writes:
> hi list,
> i am not sure whether i have discovered a bug or just using this not in
> the right way.
> i have an org document where i have lots of underscores in words (they
> are function names, e.g. BC_send) and do not want them to be interpreted
> as subscripts.
>
> the documentation says that the variable org-use-sub-superscript can be
> used to customize this behaviour:
> - t..convert every underscore
> - {}..only convert when text is preprended by an underscore and within braces
> - nil..no conversion at all
>
> in my environment, this does not work. output is always the same.
> i exported to html.
> i have set the variable in my
> .emacs. i have also tried without my defs with emacs -q --no-desktop.
The name of the variable is org-export-with-sub-superscripts. If you make
this change to your code below, it DTRT I think. If you say
#+OPTIONS: ^:nil
that's the variable that is set.
Maybe org-use-sub-superscripts is a remnant that should be deleted: not
sure why it is still around. I note that it is defined and used in
org.el, whereas org-export-with-sub-superscripts is defined and used in
ox.el.
>
> i found a similar report on the list, where they tried #+OPTIONS, this
> does also not fix my problem.
This *should* have fixed the problem though.
Nick
> finally i have wrote a little elisp file to programmatically reproduce
> my situation, here it is:
> ------------cut-----------------------
> (defun insert-version ()
> "insert org and emacs version information"
> (interactive)
> (insert (concat "emacs-version: " emacs-version "\n"))
> (insert (concat "org-version: " org-version "\n")))
>
> (defun insert-org-text ()
> "insert some org text with sub and superscripts
> and select the org text"
> (interactive)
> (insert (concat "\n\norg-use-sub-superscripts: ")
> (if
> (eq org-use-sub-superscripts t) "t\n"
> (if (eq org-use-sub-superscripts '{}) "{}\n"
> (if (eq org-use-sub-superscripts nil) "nil\n" "not
> nil\n"))))
> (insert "plain underscore: X_sub 3^super\n")
> (insert "braces : X_{sub} 3^{super}\n")
> (push-mark)
> (insert "plain underscore: X_sub 3^super\n")
> (insert "braces : X_{sub} 3^{super}\n")
> (exchange-point-and-mark))
>
> (progn
> (let ((orgfile "blaa.org"))
> (get-buffer-create orgfile)
> (set-buffer orgfile)
> (split-window-horizontally)
> (switch-to-buffer-other-window orgfile)
> (kill-region (point-min) (point-max))
> (org-mode)
> (insert-version)
> (setq values '(t {} nil))
> (while values
> (setq org-use-sub-superscripts (car values))
> (insert-org-text)
> (org-html-convert-region-to-html)
> (setq values (cdr values)))))
> -------------cut---------
> and here is my output:
> -------------cut---------
> ...