emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to set latex preview font to regular instead of italics?
@ 2022-11-05 22:17 Mati
  2022-11-06  4:15 ` Ihor Radchenko
  2022-11-06 17:54 ` Mati
  0 siblings, 2 replies; 4+ messages in thread
From: Mati @ 2022-11-05 22:17 UTC (permalink / raw)
  To: emacs-orgmode

As in subject, I can't find any info with search engine. Latex preview 
is (imho) ugly italic. Is there an easy way to make it regular?



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

* Re: How to set latex preview font to regular instead of italics?
  2022-11-05 22:17 How to set latex preview font to regular instead of italics? Mati
@ 2022-11-06  4:15 ` Ihor Radchenko
  2022-11-06 17:54 ` Mati
  1 sibling, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2022-11-06  4:15 UTC (permalink / raw)
  To: Mati; +Cc: emacs-orgmode

Mati <mati@electrum-bikes.pl> writes:

> As in subject, I can't find any info with search engine. Latex preview 
> is (imho) ugly italic. Is there an easy way to make it regular?

It would help if you provided more details on what you tried, including
your original Org file and the screenshots.
See https://orgmode.org/manual/Feedback.html#Feedback
I also suggest reading https://www.chiark.greenend.org.uk/~sgtatham/bugs.html

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: How to set latex preview font to regular instead of italics?
  2022-11-05 22:17 How to set latex preview font to regular instead of italics? Mati
  2022-11-06  4:15 ` Ihor Radchenko
@ 2022-11-06 17:54 ` Mati
  2022-11-06 19:04   ` Mati
  1 sibling, 1 reply; 4+ messages in thread
From: Mati @ 2022-11-06 17:54 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 5245 bytes --]

Ok, I found it's (La?)TeX default, specifically: By default math fonts 
are italic, and what I want is upright font. So, currently I found it 
can be done by \usepackage{mathastext} that makes italic math font a 
upright font or by using "Neo Euler" font . At the moment I succesfully 
applied it to PDF export, both mathastext and neo euler. I think I'll 
stick to Neo Euler, it's more straightforward, although Libertinus looks 
better, unfortunately it has weird SEM symbol. Maybe if other symbols 
are more straightforward I'll switch back. However, I still don't know 
how to apply those font settings to latex previews in org-mode.

I found great article on beautifying org latex export: 
https://so.nwalsh.com/2020/01/05-latex Here is my improved version of 
those export options, they might be useful for someone: (I also attach 
init.el for rest of my latex config)

One note before: You need to install Liberation font on your systems if 
you want to use it, it is used in my config. Next thing - if you want 
upright Libertine instead of Neo Euler, change some lines to this 
(you'll notice which):
>   \\usepackage{mathastext}
>   \\usepackage{libertinus}
>   \\setmainfont{Liberation Serif}
>   \\setsansfont[Scale=MatchLowercase]{Liberation Sans}
>   \\setmonofont[Scale=MatchLowercase]{Liberation Mono}
>   \\setmathfont{Libertinus Math}

Config:
> (setq
>   org-format-latex-options (plist-put org-format-latex-options ':scale' 5)
>   org-latex-compiler "lualatex"
>   org-latex-listings t
>   org-latex-default-packages-alist
>     '(("" "graphicx" t)
>       ("" "grffile" t)
>       ("" "longtable" nil)
>       ("" "wrapfig" nil)
>       ("" "rotating" nil)
>       ("normalem" "ulem" t)
>       ("" "textcomp" t)
>       ("" "capt-of" nil)
>       ("" "hyperref" nil))
>
>   org-latex-classes
>   '(;; ("equation"
> ;; "\\usepackage{fontspec}
> ;;   \\setmainfont{Liberation Serif}
> ;;   \\setmathfont[Scale=MatchLowercase]{DejaVu Math TeX Gyre}
> ;;   \\setsansfont[Scale=MatchLowercase]{Raleway}
> ;;   \\setmonofont[Scale=MatchLowercase]{Operator Mono SSm}")
>   ("article"
> "\\RequirePackage{fix-cm}
>   \\PassOptionsToPackage{svgnames}{xcolor}
>   \\documentclass[14pt]{article}
>   \\usepackage{neo-euler}
>   \\setmainfont{Liberation Serif}
>   \\setsansfont[Scale=MatchLowercase]{Liberation Sans}
>   \\setmonofont[Scale=MatchLowercase]{Liberation Mono}
>   \\setmathfont{Neo Euler}
>   \\usepackage{sectsty}
>   \\allsectionsfont{\\sffamily}
>   \\usepackage{enumitem}
> \\setlist[description]{style=unboxed,font=\\sffamily\\bfseries}
>   \\usepackage{listings}
>   \\lstset{frame=single,aboveskip=1em,
>       framesep=.5em,backgroundcolor=\\color{AliceBlue},
>       rulecolor=\\color{LightSteelBlue},framerule=1pt}
>   \\usepackage{xcolor}
> \\newcommand\\basicdefault[1]{\\scriptsize\\color{Black}\\ttfamily#1}
>   \\lstset{basicstyle=\\basicdefault{\\spaceskip1em}}
>   \\lstset{literate=
>           keywordstyle=\\color{DarkGreen}\\bfseries,
>           identifierstyle=\\color{DarkRed},
>           commentstyle=\\color{Gray}\\upshape,
>           stringstyle=\\color{DarkBlue}\\upshape,
>           emphstyle=\\color{Chocolate}\\upshape,
>           showstringspaces=false,
>           columns=fullflexible,
>           keepspaces=true}
>   \\usepackage[a4paper,margin=0.5in]{geometry}
>   \\usepackage{parskip}
>   \\makeatletter
>   \\renewcommand{\\maketitle}{%
>     \\begingroup\\parindent0pt
>     \\sffamily
>     \\Huge{\\bfseries\\@title}\\par\\bigskip
>     \\LARGE{\\bfseries\\@author}\\par\\medskip
>     \\normalsize\\@date\\par\\bigskip
>     \\endgroup\\@afterindentfalse\\@afterheading}
>   \\makeatother
>   [DEFAULT-PACKAGES]
>   \\hypersetup{linkcolor=Blue,urlcolor=DarkBlue,
>     citecolor=DarkRed,colorlinks=true}
>   \\AtBeginDocument{\\renewcommand{\\UrlFont}{\\ttfamily}}
>   [PACKAGES]
>   [EXTRA]"
>   ("\\section{%s}" . "\\section*{%s}")
>   ("\\subsection{%s}" . "\\subsection*{%s}")
>   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>   ("\\paragraph{%s}" . "\\paragraph*{%s}")
>   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
>
>   ("report" "\\documentclass[11pt]{report}"
>   ("\\part{%s}" . "\\part*{%s}")
>   ("\\chapter{%s}" . "\\chapter*{%s}")
>   ("\\section{%s}" . "\\section*{%s}")
>   ("\\subsection{%s}" . "\\subsection*{%s}")
>   ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
>
>   ("book" "\\documentclass[11pt]{book}"
>   ("\\part{%s}" . "\\part*{%s}")
>   ("\\chapter{%s}" . "\\chapter*{%s}")
>   ("\\section{%s}" . "\\section*{%s}")
>   ("\\subsection{%s}" . "\\subsection*{%s}")
>   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
>
> org-latex-pdf-process
>       (list (concat "latexmk -"
>                     org-latex-compiler
>                     " -recorder -synctex=1 %b"))
>       )

Credits of course go also to creators of this very nice template, I just 
improved it. In attachments there is example pdf produced with it.

btw: inline $...$ has broken fraction distances, use $$...$$ instead

[-- Attachment #2: init.el --]
[-- Type: text/plain, Size: 23677 bytes --]

(add-to-list 'default-frame-alist '(font . "Liberation Serif-16" ))
(set-face-attribute 'default t :font "Liberation Serif-16")
(set-fontset-font t nil (font-spec :size 16 :name "Iosevka NF"))

(add-to-list 'load-path "~/.emacs.d/site-lisp/maxima/")

(setq gc-cons-threshold 10000000)
;; Restore after startup
(add-hook 'after-init-hook
	  (lambda ()
	    (setq gc-cons-threshold 1000000)
	    (message "gc-cons-threshold restored to %S"
		     gc-cons-threshold)))

(setq delete-by-moving-to-trash t
      ;; Emacs has some awful scrolling by default. This gets rid of that.
      scroll-step 1 ; keyboard scroll one line at a time
;;      scroll-preserve-screen-position 'always
      scroll-conservatively 101
      next-screen-context-lines 5
      debugger-stack-frame-as-list t
      ;; Echo keystrokes a little faster
      echo-keystrokes 0.5
      ;; remove auditory clutter:
      ring-bell-function #'ignore
      preserve-screen-position t)

(fset 'yes-or-no-p 'y-or-n-p)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(setq max-mini-window-height 0.15)
(delete-selection-mode 1)


(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
  backup-by-copying t    ; Don't delink hardlinks
  version-control t      ; Use version numbers on backups
  delete-old-versions t  ; Automatically delete excess backups
  kept-new-versions 20   ; how many of the newest versions to keep
  kept-old-versions 5    ; and how many of the old
)

(setq custom-file (make-temp-file "emacs-custom"))

(add-to-list 'load-path "~/.emacs.d/extensions/")

(setq org-directory "~/.emacs.d/brajan/")

(defun find-config ()
  "Edit config.el"
  (interactive)
  (find-file "~/.emacs.d/init.el"))

(global-set-key (kbd "C-c c") 'find-config)

;; Install straight.el
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
    (url-retrieve-synchronously
     "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
     'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

;; Install use-package
(straight-use-package 'use-package)

;; Configure use-package to use straight.el by default
(use-package straight
  :custom (straight-use-package-by-default t))

(use-package dashboard
  :ensure t
  :config
  (dashboard-setup-startup-hook))

(use-package ir-black-theme)
(use-package grandshell-theme)
(use-package cyberpunk-theme)
(use-package alect-themes)
(use-package hemera-theme :ensure :defer)
(use-package nyx-theme :ensure :defer)

(use-package circadian
  :custom
  ;;(calendar-latitude 50.0)
  ;;(calendar-longitude 20.0)
  (circadian-themes '(("7:00" . hemera)
                      ("19:00" . nyx)))
  :config (circadian-setup))

(use-package all-the-icons
  :if (display-graphic-p))

;; (use-package svg-lib)

(use-package org-roam
;;  :after org
  :custom
  ((org-roam-directory (file-truename org-directory))
   (org-roam-index-file "~/.emacs.d/brajan/index.org"))
  :config
  (org-roam-db-autosync-mode 1)
;;  (org-roam-setup)
  :bind (("C-c n f" . org-roam-node-find)
	 ("C-c n r" . org-roam-node-random)      
	 (:map org-mode-map
	       (("C-c n i" . org-roam-node-insert)
		("C-c n o" . org-id-get-create)
		("C-c n t" . org-roam-tag-add)
		("C-c n a" . org-roam-alias-add)
		("C-c n l" . org-roam-buffer-toggle)))))

(use-package org-roam-ui
  :straight
    (:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
    :after org-roam
;;         normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;;         a hookable mode anymore, you're advised to pick something yourself
;;         if you don't care about startup time, use
;;  :hook (after-init . org-roam-ui-mode)
    :config
    (setq org-roam-ui-sync-theme t
          org-roam-ui-follow t
          org-roam-ui-update-on-save t
          org-roam-ui-open-on-start t))

(use-package olivetti
  :hook ((text-mode prog-mode) . olivetti-mode))

(use-package vertico
  :init (vertico-mode)

  ;; Different scroll margin
  ;; (setq vertico-scroll-margin 0)

  ;; Show more candidates
  ;; (setq vertico-count 20)

  ;; Grow and shrink the Vertico minibuffer
  (setq vertico-resize t)

  ;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
  ;; (setq vertico-cycle t)
  )

(use-package marginalia
  ;; Either bind `marginalia-cycle' globally or only in the minibuffer
  :bind (("M-A" . marginalia-cycle)
         :map minibuffer-local-map
         ("M-A" . marginalia-cycle))

  ;; The :init configuration is always executed (Not lazy!)
  :init

  ;; Must be in the :init section of use-package such that the mode gets
  ;; enabled right away. Note that this forces loading the package.
  (marginalia-mode))

(use-package all-the-icons-completion
  :after (marginalia all-the-icons)
  :hook (marginalia-mode . all-the-icons-completion-marginalia-setup)
  :init (all-the-icons-completion-mode))

(use-package savehist
  :init (savehist-mode))

(use-package emacs
  :init
  ;; Add prompt indicator to `completing-read-multiple'.
  ;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
  (defun crm-indicator (args)
    (cons (format "[CRM%s] %s"
                  (replace-regexp-in-string
                   "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
                   crm-separator)
                  (car args))
          (cdr args)))
  (advice-add #'completing-read-multiple :filter-args #'crm-indicator)

  ;; Do not allow the cursor in the minibuffer prompt
  (setq minibuffer-prompt-properties
        '(read-only t cursor-intangible t face minibuffer-prompt))
  (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)

  ;; Emacs 28: Hide commands in M-x which do not work in the current mode.
  ;; Vertico commands are hidden in normal buffers.
  ;; (setq read-extended-command-predicate
  ;;       #'command-completion-default-include-p)

  ;; Enable recursive minibuffers
  (setq enable-recursive-minibuffers t))

;; Optionally use the `orderless' completion style.
(use-package orderless
  :init
  ;; Configure a custom style dispatcher (see the Consult wiki)
  ;; (setq orderless-style-dispatchers '(+orderless-dispatch)
  ;;       orderless-component-separator #'orderless-escapable-split-on-space)
  (setq completion-styles '(orderless basic)
        completion-category-defaults nil
        completion-category-overrides '((file (styles partial-completion)))))

;; Nice bullets
;;(use-package org-superstar
;;  :custom
;;  org-superstar-headline-bullets-list
;;      '("►" "▸" "▸" "▸" "▸")
;;      :config
;;      (setq org-superstar-special-todo-items t)
;;      (add-hook 'org-mode-hook (lambda ()
;;                                 (org-superstar-mode 1))))

;; fwyr - layout optimized for polish
(defun meow-setup ()
  (setq meow-cheatsheet-layout meow-cheatsheet-layout-fwyr)
  (meow-motion-overwrite-define-key
   '("j" . meow-next)
   '("k" . meow-prev)
   '("<escape>" . ignore))
  (meow-leader-define-key
   ;; SPC j/k will run the original command in MOTION state.
   '("j" . "H-j")
   '("k" . "H-k")
   ;; Use SPC (0-9) for digit arguments.
   '("1" . meow-digit-argument)
   '("2" . meow-digit-argument)
   '("3" . meow-digit-argument)
   '("4" . meow-digit-argument)
   '("5" . meow-digit-argument)
   '("6" . meow-digit-argument)
   '("7" . meow-digit-argument)
   '("8" . meow-digit-argument)
   '("9" . meow-digit-argument)
   '("0" . meow-digit-argument)
   '("/" . meow-keypad-describe-key)
   '("?" . meow-cheatsheet))
  (meow-normal-define-key
   '("0" . meow-expand-0)
   '("9" . meow-expand-9)
   '("8" . meow-expand-8)
   '("7" . meow-expand-7)
   '("6" . meow-expand-6)
   '("5" . meow-expand-5)
   '("4" . meow-expand-4)
   '("3" . meow-expand-3)
   '("2" . meow-expand-2)
   '("1" . meow-expand-1)
   '("-" . negative-argument)
   '(";" . meow-reverse)
   '("," . meow-inner-of-thing)
   '("." . meow-bounds-of-thing)
   '("[" . meow-beginning-of-thing)
   '("]" . meow-end-of-thing)
   '("a" . meow-append)
   '("A" . meow-open-below)
   '("b" . meow-back-word)
   '("B" . meow-back-symbol)
   '("c" . meow-change)
   '("d" . meow-delete)
   '("D" . meow-backward-delete)
   '("e" . meow-next-word)
   '("E" . meow-next-symbol)
   '("f" . meow-find)
   '("g" . meow-cancel-selection)
   '("G" . meow-grab)
   '("h" . meow-left)
   '("H" . meow-left-expand)
   '("i" . meow-insert)
   '("I" . meow-open-above)
   '("j" . meow-next)
   '("J" . meow-next-expand)
   '("k" . meow-prev)
   '("K" . meow-prev-expand)
   '("l" . meow-right)
   '("L" . meow-right-expand)
   '("m" . meow-join)
   '("n" . meow-search)
   '("o" . meow-block)
   '("O" . meow-to-block)
   '("p" . meow-yank)
   '("q" . meow-quit)
   '("Q" . meow-goto-line)
   '("r" . meow-replace)
   '("R" . meow-swap-grab)
   '("s" . meow-kill)
   '("t" . meow-till)
   '("u" . meow-undo)
   '("U" . meow-undo-in-selection)
   '("v" . meow-yank)
   '("w" . meow-mark-word)
   '("W" . meow-mark-symbol)
   '("x" . meow-line)
   '("X" . meow-goto-line)
   '("y" . meow-save)
   '("Y" . meow-sync-grab)
   '("z" . meow-pop-selection)
   '("'" . repeat)
   '("<escape>" . meow-insert)
   '("<next>" . scroll-up-line)
   '("<prior>" . scroll-down-line)))

(use-package meow
  :config
  (meow-setup)
  (meow-global-mode 1)
  (meow-setup-indicator)
  :custom
  (meow-mode-state-list
  '((fundamental-mode . insert)
  (text-mode . insert)
  (prog-mode . insert))))

(meow-define-keys ;; state
 'insert

 ;; bind to a command
 '("<escape>" . ignore))

(use-package hydra)

(use-package emojify)

;; (use-package powerline
;;   :config
;;   (powerline-default-theme))

(use-package minions
  :hook (doom-modeline-mode . minions-mode))

(use-package doom-modeline
;;  :hook (after-init . doom-modeline-init)
  :custom-face
  (mode-line ((t (:height 0.90))))
  (mode-line-inactive ((t (:height 0.90))))
  :custom
  (doom-modeline-height 26)
  (doom-modeline-bar-width 6)
  (doom-modeline-github nil)

  ;; Whether display the mu4e notifications. It requires `mu4e-alert' package.
  (doom-modeline-mu4e t)
  ;; also enable the start of mu4e-alert
  (mu4e-alert-enable-mode-line-display)

  (doom-modeline-persp-name nil)
  (doom-modeline-buffer-file-name-style 'truncate-upto-project)

  ;; Whether to use hud instead of default bar. It's only respected in GUI.
  (doom-modeline-hud nil)

  ;; Whether display icons in the mode-line.
  ;; While using the server mode in GUI, should set the value explicitly.
  (doom-modeline-icon (display-graphic-p))

  ;; Whether display the indentation information.
  (doom-modeline-indent-info t)

  ;; The maximum displayed length of the branch name of version control.
  (setq doom-modeline-vcs-max-length 6)

  ;; Whether display the environment version.
  (setq doom-modeline-env-version t)

  ;; The limit of the window width.
  ;; If `window-width' is smaller than the limit, some information won't be displayed.
  (doom-modeline-window-width-limit fill-column)

  ;; If non-nil, a word count will be added to the selection-info modeline segment.
  (setq doom-modeline-enable-word-count t)

  ;; Whether display the modification icon for the buffer.
  ;; It respects `doom-modeline-icon' and `doom-modeline-buffer-state-icon'.
  (setq doom-modeline-buffer-modification-icon t)

  ;; Whether display the environment version.
  (doom-modeline-env-version t)
  (doom-modeline-major-mode-icon t)

  ;; Whether display the colorful icon for `major-mode'.
  ;; It respects `all-the-icons-color-icons'.
  (doom-modeline-major-mode-color-icon t)

  (doom-modeline-minor-modes t))

(doom-modeline-mode 1)

(use-package org-modern
  :demand t
  :bind
  (:map org-mode-map
       ("C-c m" . org-modern-mode)))

(use-package valign
  :custom (valign-fancy-bar 1)
  :hook (org-mode . valign-mode))

(use-package markdown-mode
  :ensure t
  :mode ("\\.md\\'" .  markdown-mode)
  :init (setq markdown-command "multimarkdown"))

(use-package company
  :straight (company :files (:defaults "icons"))
  :diminish company-mode
;; :bind (:map company-active-map
;;         ("<tab>" . nil)
;;         ("TAB" . nil))
  :custom
  (company-minimum-prefix-length 2)
  (company-idle-delay 0.01)
  :config
 )
(use-package company-prescient
    :after company
    :config
    (company-prescient-mode 1)
    (prescient-persist-mode)
 )
(use-package company-math)
(use-package company-auctex)
;;(use-package company-reftex)
(use-package company-maxima
  :init
  (add-to-list 'company-backends '(
       company-maxima-symbols
       company-maxima-libraries
 )))

(use-package pdf-tools
  :magic ("%PDF" . pdf-view-mode)
  :config
  (pdf-tools-install)
  (setq-default pdf-view-display-size 'fit-page)
  )


(defun try/TeX-command-save-buffer-and-run-all ()
    "Save the buffer and run TeX-command-run-all"
    (interactive)
    (let (TeX-save-query) (TeX-save-document (TeX-master-file)))
    (TeX-command-run-all nil))

;; (defun try/latex-mode-setup ()
;;   (require 'company-reftex)
;;         (turn-on-reftex)
;;         (require 'company-auctex)
;;         (require 'company-math)
;; (setq-local company-backends
      
;;     (append '(
;;                               (company-reftex-labels
;;                                 company-reftex-citations)
;;               (company-math-symbols-unicode company-math-symbols-latex company-latex-commands)
;;               (company-auctex-macros company-auctex-symbols company-auctex-environments)
;;               company-ispell
;;               )
;;             company-backends)))

;;  use cdlatex
(use-package cdlatex
  :custom
  (cdlatex-simplify-sub-super-scripts 1))

;; https://gist.github.com/saevarb/367d3266b3f302ecc896
;; https://piotr.is/2010/emacs-as-the-ultimate-latex-editor/

(use-package latex
  :straight auctex
  :defer t
  :custom
  (olivetti-body-width 100)
  (cdlatex-simplify-sub-super-scripts nil)
;;  (reftex-default-bibliography '("~/ref.bib"))
  (bibtex-dialect 'biblatex)
  :mode
    ("\\.tex\\'" . latex-mode)
  :bind (:map LaTeX-mode-map
	    ("C-c C-e" . cdlatex-environment)
	)
  :hook
    (LaTeX-mode . olivetti-mode)
    (LaTeX-mode . TeX-PDF-mode)
    (LaTeX-mode . company-mode)
    (LaTeX-mode . flyspell-mode)
    (LaTeX-mode . flycheck-mode)
    (LaTeX-mode . LaTeX-math-mode)
;;    (LaTeX-mode . turn-on-reftex)
;;    (LaTeX-mode . TeX-source-correlate-mode)
;;    (LaTeX-mode . try/latex-mode-setup)
    (LaTeX-mode . turn-on-cdlatex)

  :config
(setq
    ;; pdftools
    ;; https://emacs.stackexchange.com/questions/21755/use-pdfview-as-default-auctex-pdf-viewer#21764
    TeX-view-program-selection '((output-pdf "PDF Tools"))
    TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view))
;;    TeX-source-correlate-start-server t ;; not sure if last line is neccessary
    
    TeX-auto-save t
    TeX-save-query nil
    TeX-parse-self t)
;;    reftex-plug-into-AUCTeX t
   (setq-default
;;    TeX-master nil
    TeX-PDF-mode t
    TeX-engine 'luatex)
    (add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
   )

(use-package auctex-latexmk
  :config
  (auctex-latexmk-setup)
  :custom
  (auctex-latexmk-inherit-TeX-PDF-mode t)
  )

(use-package org-fragtog
  :hook
  (org-mode . org-fragtog-mode))

;;(use-package reduce-ide
;;  :straight
;;  (:host github :type git :repo "fjwright/REDUCE-IDE"))

;;(load-file "~/.emacs.d/site-lisp/maxima/setup-imaxima-imath.el")

(use-package maxima
  :custom (maxima-display-maxima-buffer nil)
  :mode ("\\.ma[cx]" . maxima-mode)
  :interpreter ("maxima" . maxima-mode))

;;(autoload 'maxima-mode "maxima" "Maxima mode" t)
(autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t)
;;(autoload 'maxima "maxima" "Maxima interaction" t)
(autoload 'imath-mode "imath" "Imath mode for math formula input" t)
;;(setq imaxima-use-maxima-mode-flag t)
;;(setq imaxima-gs-program "gswin64")
(setq imaxima-fnt-size "large")
(setq imaxima-pt-size 12)
;;(add-to-list 'auto-mode-alist '("\\.ma[cx]" . maxima-mode))

(org-babel-do-load-languages
 'org-babel-load-languages
 '((maxima . t))) ; this line activates maxima

(use-package gnuplot)

;; (use-package org-ref
;; :custom
;; (org-ref-default-bibliography "~/ref.bib")
;; (org-ref-pdf-directory "~/papers")
;; :config
;; (require 'org-ref-wos)
;; (require 'doi-utils)
;; )

;; (use-package eaf
;;   :load-path "~/.emacs.d/site-lisp/emacs-application-framework"
;;   :custom
;;   ; See https://github.com/emacs-eaf/emacs-application-framework/wiki/Customization
;;   (eaf-browser-continue-where-left-off t)
;;   (eaf-browser-enable-adblocker t)
;;   (browse-url-browser-function 'eaf-open-browser)
;;   (eaf-browser-dark-mode nil)
;;   :config
;;   (defalias 'browse-web #'eaf-open-browser)
;; ;;  (eaf-bind-key scroll_up "C-n" eaf-pdf-viewer-keybinding)
;; ;;  (eaf-bind-key scroll_down "C-p" eaf-pdf-viewer-keybinding)
;; ;;  (eaf-bind-key take_photo "p" eaf-camera-keybinding)
;; ;;  (eaf-bind-key nil "M-q" eaf-browser-keybinding) ;; unbind, see more in the Wiki
;; ;;  (require 'eaf-2048)
;; ;;  (require 'eaf-airshare)
;; ;;  (require 'eaf-browser)
;; ;;  (require 'eaf-camera)
;;   (require 'eaf-demo)
;;   (require 'eaf-file-browser)
;;   (require 'eaf-file-manager)
;; ;;  (require 'eaf-file-sender)
;; ;;  (require 'eaf-git)
;;   (require 'eaf-image-viewer)
;; ;;  (require 'eaf-jupyter)
;;   (require 'eaf-markdown-previewer)
;;   (require 'eaf-mindmap)
;;   (require 'eaf-music-player)
;; ;;  (require 'eaf-netease-cloud-music)
;;   (require 'eaf-org-previewer)
;;   (require 'eaf-pdf-viewer)
;; ;;  (require 'eaf-rss-reader)
;;   (require 'eaf-system-monitor)
;; ;;  (require 'eaf-terminal)
;;   (require 'eaf-video-player)
;; ;;  (require 'eaf-vue-demo)
;;  )

(use-package imenu-list)
(use-package imenu-anywhere)

;; (use-package tempel
;;   ;; Require trigger prefix before template name when completing.
;;   ;; :custom
;;   ;; (tempel-trigger-prefix "<")

;;   :bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
;;          ("M-*" . tempel-insert))

;;   :init

;;   ;; Setup completion at point
;;   (defun tempel-setup-capf ()
;;     ;; Add the Tempel Capf to `completion-at-point-functions'.
;;     ;; `tempel-expand' only triggers on exact matches. Alternatively use
;;     ;; `tempel-complete' if you want to see all matches, but then you
;;     ;; should also configure `tempel-trigger-prefix', such that Tempel
;;     ;; does not trigger too often when you don't expect it. NOTE: We add
;;     ;; `tempel-expand' *before* the main programming mode Capf, such
;;     ;; that it will be tried first.
;;     (setq-local completion-at-point-functions
;;                 (cons #'tempel-expand
;;                       completion-at-point-functions)))

;;   (add-hook 'prog-mode-hook 'tempel-setup-capf)
;;   (add-hook 'text-mode-hook 'tempel-setup-capf)

;;   ;; Optionally make the Tempel templates available to Abbrev,
;;   ;; either locally or globally. `expand-abbrev' is bound to C-x '.
;;   ;; (add-hook 'prog-mode-hook #'tempel-abbrev-mode)
;;   ;; (global-tempel-abbrev-mode)
;;   :custom
;;   (tempel-path "~/.emacs.d/extensions/templates.el")
;; )

(setq
  org-format-latex-options (plist-put org-format-latex-options ':scale' 5)
  org-latex-compiler "lualatex"
  org-latex-listings t
  org-latex-default-packages-alist
	'(("" "graphicx" t)
	  ("" "grffile" t)
	  ("" "longtable" nil)
	  ("" "wrapfig" nil)
	  ("" "rotating" nil)
	  ("normalem" "ulem" t)
	  ("" "textcomp" t)
	  ("" "capt-of" nil)
	  ("" "hyperref" nil))

  org-latex-classes
  '(;; ("equation"
;; "\\usepackage{fontspec}
;;   \\setmainfont{Liberation Serif}
;;   \\setmathfont[Scale=MatchLowercase]{DejaVu Math TeX Gyre}
;;   \\setsansfont[Scale=MatchLowercase]{Raleway}
;;   \\setmonofont[Scale=MatchLowercase]{Operator Mono SSm}")
  ("article"
"\\RequirePackage{fix-cm}
  \\PassOptionsToPackage{svgnames}{xcolor}
  \\documentclass[14pt]{article}
  \\usepackage{neo-euler}
  \\setmainfont{Liberation Serif}
  \\setsansfont[Scale=MatchLowercase]{Liberation Sans}
  \\setmonofont[Scale=MatchLowercase]{Liberation Mono}
  \\setmathfont{Neo Euler}
  \\usepackage{sectsty}
  \\allsectionsfont{\\sffamily}
  \\usepackage{enumitem}
  \\setlist[description]{style=unboxed,font=\\sffamily\\bfseries}
  \\usepackage{listings}
  \\lstset{frame=single,aboveskip=1em,
	  framesep=.5em,backgroundcolor=\\color{AliceBlue},
	  rulecolor=\\color{LightSteelBlue},framerule=1pt}
  \\usepackage{xcolor}
  \\newcommand\\basicdefault[1]{\\scriptsize\\color{Black}\\ttfamily#1}
  \\lstset{basicstyle=\\basicdefault{\\spaceskip1em}}
  \\lstset{literate=
	      keywordstyle=\\color{DarkGreen}\\bfseries,
	      identifierstyle=\\color{DarkRed},
	      commentstyle=\\color{Gray}\\upshape,
	      stringstyle=\\color{DarkBlue}\\upshape,
	      emphstyle=\\color{Chocolate}\\upshape,
	      showstringspaces=false,
	      columns=fullflexible,
	      keepspaces=true}
  \\usepackage[a4paper,margin=0.5in]{geometry}
  \\usepackage{parskip}
  \\makeatletter
  \\renewcommand{\\maketitle}{%
    \\begingroup\\parindent0pt
    \\sffamily
    \\Huge{\\bfseries\\@title}\\par\\bigskip
    \\LARGE{\\bfseries\\@author}\\par\\medskip
    \\normalsize\\@date\\par\\bigskip
    \\endgroup\\@afterindentfalse\\@afterheading}
  \\makeatother
  [DEFAULT-PACKAGES]
  \\hypersetup{linkcolor=Blue,urlcolor=DarkBlue,
    citecolor=DarkRed,colorlinks=true}
  \\AtBeginDocument{\\renewcommand{\\UrlFont}{\\ttfamily}}
  [PACKAGES]
  [EXTRA]"
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  ("\\paragraph{%s}" . "\\paragraph*{%s}")
  ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))

  ("report" "\\documentclass[11pt]{report}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))

  ("book" "\\documentclass[11pt]{book}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))

org-latex-pdf-process
      (list (concat "latexmk -"
                    org-latex-compiler 
                    " -recorder -synctex=1 %b"))
      )

;; (set-face-attribute 'org-agenda-date t :font "Iosevka NF")
;; (set-face-attribute 'org-agenda-current-time t :font "Iosevka NF")
;; (set-face-attribute 'org-agenda-date-weekend t :font "Iosevka NF")
;; (set-face-attribute 'org-agenda-column-dateline t :font "Iosevka NF")
;; (set-face-attribute 'org-agenda-structure t :font "Iosevka NF")

[-- Attachment #3: 20221022203919-fizyka1.pdf --]
[-- Type: application/pdf, Size: 62427 bytes --]

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

* Re: How to set latex preview font to regular instead of italics?
  2022-11-06 17:54 ` Mati
@ 2022-11-06 19:04   ` Mati
  0 siblings, 0 replies; 4+ messages in thread
From: Mati @ 2022-11-06 19:04 UTC (permalink / raw)
  To: emacs-orgmode

I ended up with DejaVu Math TeX Gyre. You probably need this font 
installed on your system, but I'm not sure, because I had it installed 
before. Here's code to replace in my config:
>   \\usepackage{mathastext}
>   \\usepackage{unicode-math}
>   \\setmainfont{Liberation Serif}
>   \\setsansfont[Scale=MatchLowercase]{Liberation Sans}
>   \\setmonofont[Scale=MatchLowercase]{Liberation Mono}
>   \\setmathfont{DejaVu Math TeX Gyre}



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

end of thread, other threads:[~2022-11-06 19:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-05 22:17 How to set latex preview font to regular instead of italics? Mati
2022-11-06  4:15 ` Ihor Radchenko
2022-11-06 17:54 ` Mati
2022-11-06 19:04   ` Mati

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).