Re: How to set latex preview font to regular instead of italics?

2022-11-06 Thread Mati
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}





Re: How to set latex preview font to regular instead of italics?

2022-11-06 Thread Mati
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(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 

How to set latex preview font to regular instead of italics?

2022-11-05 Thread Mati
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?





Can someone give an init.el wherein can start customize it?

2022-11-03 Thread Mati
Look at mine config, but it's dirty too so copy-pasting it is not a good 
idea. Here are things that can be copied from it:


- straight and use-package configuration

- orderless

- vertico

- doom-modeline

- three first lines with font, but you must install those two fonts if 
you want to use them


- variables at the beginning

- generally, whole beginning without maxima path and also you must 
correct some pathes


- dashboard, circadian, all-the-icons

- org-roam setup is harder so you can use my config but you need to read 
docs or watch tutorials first


- olivetti - must-have

- marginalia, all-the-icons completion, savehist

- that use-package emacs that I don't understand but was recommended 
with some minibuffer completion package or I don't remember


- I have strange meow setup with insert mode as default so you can 
experience sometimes both modes enabled with it (then you need to 
disable unwanted one, happens rarely) and my custom layout in layout map


- emojify

- minions for nice cog on modeline to set modes

- org-modern

- valign - great package for org tables

- some latex config I must clear and first of all learn latex :P



(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 1000)
;; Restore after startup
(add-hook 'after-init-hook
  (lambda ()
(setq gc-cons-threshold 100)
(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)
  ("23: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 

Re: [O] Maxima code blocks does not work in windows revisited

2022-11-03 Thread Mati




As Max pointed out, the latest main branch of Org should already handle
Windows cmd properly without any extra patches. Did you try it? May I
know the output of M-x org-version?


9.5.5-g5bc674, I just pulled it, rebuilt and works properly (without plots)




How to set monospace font face for org-agenda calendar?

2022-11-02 Thread Mati
Hi. I tried to assign monospace font to calendar in org-agenda but it 
looks it uses default face. How I can set it then?





Re: [O] Maxima code blocks does not work in windows revisited

2022-11-02 Thread Mati
Ok, I tried this patch, but now when I try to eval maxima code it 
outputs similar broken table:


| incorrect | syntax: | c | is | not | an | infix | operator |
| ^    |    |   |   | |    |  | |

Plots have no output as before.

To clarify, previous patch worked except plots. And of course I applied 
patch to fresh org repo downloaded with straight.el





Re: [O] Maxima code blocks does not work in windows revisited

2022-11-01 Thread Mati

I am testing maxima-mode now (not in org) and it works, but is broken
on windows. Looks like there are many more problems with syntax.

I am interested to know what is broken in maxima-mode. Please
explain with examples.

Best,
Leo


There is problem with handling ghostscript. Ghostscript gui opens three 
times, one time with commands help, and error is displayed in 
minibuffer: "Your version Ghostscript does not appear to support the 
image type -sDEVICE=png16m. The command "gs -h" lists the available 
devices." when it does support it. maybe if I could use setup file it 
would work, but it gives error: Wrong type argument: stringp, nil. I 
also had to correct miktex path in this function, but without 
modification this error occurs too


Overall, configuration on windows is a pain. manually installing 
packages in miktex and ghostscript (not that bad, but I had to dig to 
find that's neccesary), wondering what code actually should be put in 
init.el, finding and moving files from maxima installation to site-lisp, 
adding installation pathes to path environment variable because 
setup-imaxima-imath.el is not working...


Plots produce output but it's not inline in emacs buffer, but gnuplot 
window.


My current path to miktex binary is: 
C:\Users\user\AppData\Local\Programs\MiKTeX\miktex\bin\x64


My init.el config for maxima:


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

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

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

;;(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






Re: [O] Maxima code blocks does not work in windows revisited

2022-11-01 Thread Mati

On 01.11.2022 09:04, Ihor Radchenko wrote:


Do you mean that you changed the code at line 82 inside
org-babel-execute:maxima to

  (let* ((cmdline (or (cdr (assoc :cmdline params)) ""))
  (in-file (org-babel-temp-file "maxima-" ".max"))
(cmd (format "%s --very-quiet -r \"batchload(\\\"%s\\\")$\" %s"
 org-babel-maxima-command in-file cmdline)))

??

(for reference, this email is a followup of
https://orgmode.org/list/ca+ikm3wqa33xp4c3pvv+f2a-gn0dbezsdx6vf2crd+37+u6...@mail.gmail.com)


yes, of course only part of it


I am testing maxima-mode now (not in org) and it works, but is broken on 
windows. Looks like there are many more problems with syntax.





[O] Maxima code blocks does not work in windows revisited

2022-11-01 Thread Mati
Ok, I got it working somehow. For others reading this: I had to modify 
~/.emacs.d/straight/repos/org/lisp/ob-maxima.el in emacs(!) so straight 
compiled it to work. you need to replace code at line 82. However, plots 
still doesn't work (code block produced no output) :( pls help.





Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Mati




Try

|--++--|
| this | is | test |
|1 |  2 |3 |
|--++--|

Works, but I must somehow hack it to look normally with valign then. Thanks.



Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Mati
I don't know is this helpful, but on reddit some people mentioned that 
cell-mode is very promising for tables. Maybe it can ease table 
development. I'm not into programming at all so I can't evaluate.





Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Mati

Could you please provide a concrete example on what you want to achieve?


+-+-+ at top and bottom of table creates top and bottom border 
and doesn't break table.





Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Mati
So, you mean that those aren't hlines but cell boundaries? Simplifying, 
I think the problem is lack of table top and bottom border support, no 
matter how it will be created.


On 30.10.2022 08:47, Ihor Radchenko wrote:

I am sorry, but I don't understand.
In the reply to the linked conversation I explained that table.el tables
do not have any notion of hlines.




Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Mati
I saw a similar topic created about hlines. So, it would be rather a 
feature request to add hlines rather than bug. Here is fragment of 
conversation I am talking about for reference:



/I start with /



/| Example | Text | Dates | other |/
/|-+-+--+-|/
/| this | comment | <2022-01-28 vie> | nothing |/


/That is converted to /



/+-+-+--+-+/
/| Example | Text | Dates | other |/
/+-+-+--+-+/
/| this | comment | <2022-01-28 vie> | nothing |/
/+-+-+--+-+/


/And is converted back to /


/| Example | Text | Dates | other |/
/| this | comment | <2022-01-28 vie> | nothing |/


/Couldn't in the last step the hlines be respected?/

That would not make sense.
AFAIK, table.el has no notion of hlines. The +---+ separators in
table.el tables mark cell boundaries, not hlines.


Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-27 Thread Mati

Please provide more details on what you have tried.

M-x table-insert 5 columns 5 rows 15 cell width 1 height

Then enter something in first cell. press tab to go to next cell, but 
then message appears with C-c ’ (copy-pasted it from messages buffer) 
shortcut. I can edit table after pressing C-c ', in orgsrc mode, with 
very limited functionality and it just doesn't work well, table doesn't 
shrink after deleting text etc.


Also, I noticed that horizontal table lines (|-+-|) are not 
properly recognized too and instead of inserting new cells below line, 
they are inserted above when moving by . The funny part is that 
this works in emacs with my configuration loaded (valign-mode and 
variable pitch font might matter) so it works well when it could be 
expected to break, and is broken in pure emacs (but only horizontal 
lines, top and bottom border still breaks table even with valign). Of 
course with emacs -q I test on monospace font.



with point at the top left cell, after C-c ', I can  across cells
in the edit buffer.
Yes, in orgsrc mode (after clicking this shortcut, C-c ') it's possible, 
but it should work in org, also as I previously mentioned, orgsrc table 
editing is limited and doesn't work properly.


On 27.10.2022 05:36, Ihor Radchenko wrote:

ELECTRUM BIKES  writes:


Hi. Tables created in org-mode by inserting manually | works fine, but
if I use table-insert I can't manipulate table, I get "use C-c `"
notification in minibuffer when I click  to move to next cell.

"C-c '", not C-c `.


If I click C-c `, I get "not a table" response. In such tables I can
only insert text but not use shortcuts and they're generally broken. I
tried it on emacs -q and it looks it's not my configuration fault,
same behavior.

Please provide more details on what you have tried.

I tried


 +--+--++
 |  |  ||
 |  |  ||
 +--+--++
 |  |  |Text editing inside the table   |
 |  |  |cell produces reasonably|
 |  |  |expected results.-!-|
 +--+--++
 |  |  ||
 |  |  ||
 +--+--++

with point at the top left cell, after C-c ', I can  across cells
in the edit buffer.


Also, there seems to be problem with handling top and bottom borders,
if I insert
(for example, 3 column table) +-+-+ at the top or bottom of a working table,
it breaks to exactly same state as command-inserted tables, so probably
top and bottom border handling breaks tables (command created tables
does have this borders).

Sorry, I do not understand what you are referring two. Detailed steps
explaining what text you inserted and what key bindings you pressed
would help a lot.