=n0=
这样写, 导出为html
如图, 仍然显示为=
, 但是根据某个链接, 应该作为<code>
tag才对. 是应该打开什么设置么?
你需要在 =n_0=
的等号两边加空格
3 个赞
但是中文的标点加空格不好看。 比如: ()之类的,再加空格就间隔太大了
這個很不錯啊。一直不知道中文中如何解決這個問題。
不知道哪位壇友能否幫忙定製一個專門針對中文的 org-emphasize, 這樣的話不用每次都要手工輸入這個zero width whitespace?
不想手输的话,一个最简单的方法是用snippets, 也可以用smartparens
之类的包。
比如:
# -*- mode: snippet -*-
# name: vb
# key: vb
# --
`(delete-backward-char 1)`=$0=
有个包 embrace ,选定区域后加成对的符号。
(global-set-key (kbd "C-,") 'embrace-commander)
(defun embrace-org-mode-hook ()
(dolist (lst '((?= " =" . "= ")
(?~ " ~" . "~ ")
(?/ " /" . "/ ")
(?* " *" . "* ")
(?_ " _" . "_ ")
(?+ " +" . "+ ")
(?k "@@html:<kbd>@@" . "@@html:</kbd>@@")))
(embrace-add-pair (car lst) (cadr lst) (cddr lst))))
(add-hook 'org-mode-hook 'embrace-org-mode-hook)
請問這個 embrace-add-pair 的定義如何?
我也有过类似需求,在已有文字下标记,看了下是这样:
(defvar lld-wrap-pair-alist '(("=" . "=")
("-" . "=")
("~" . "~")
("*" . "*")
("[" . "]")
("<" . ">")))
(defun lld-wrap-with-1 (arg)
"wrap with arg"
(if (not (region-active-p))
(insert arg)
(let ((rb (region-beginning))
(re (region-end))
(pair (assoc arg lld-wrap-pair-alist)))
(goto-char re)
(insert (cdr pair))
(goto-char rb)
(insert (car pair)))))
(defun lld-wrap-with (s)
"Create a wrapper function using S."
`(lambda (&optional arg)
(interactive)
(lld-wrap-with-1 ,s)))
(define-key org-mode-map (kbd "=") (lld-wrap-with "="))
;; 全角
(define-key org-mode-map (kbd "=") (lld-wrap-with "="))
(define-key org-mode-map (kbd "~") (lld-wrap-with "~"))
;; 全角
(define-key org-mode-map (kbd "~") (lld-wrap-with "~"))
(define-key org-mode-map (kbd "*") (lld-wrap-with "*"))
;; 全角
(define-key org-mode-map (kbd "×") (lld-wrap-with "*"))
(define-key org-mode-map (kbd "<") (lld-wrap-with "<"))
(define-key org-mode-map (kbd "[") (lld-wrap-with "["))
(define-key org-mode-map (kbd "【") (lld-wrap-with "["))
选中时按 = 之类的就可以标记。