Files
emacs/README.org
2022-12-14 14:47:05 +01:00

4.8 KiB

Emacs Configuration

This is an ongoing evolution of Emacs configuration files, inspired by a bunch of online resources.

Installation

Download repo and point the emacs init (and early-init.el) file to this configuration.

Or run one of the following install script commands (using curl, wget or fetch).

sh -c "$(curl -fsSL http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
sh -c "$(wget -O- http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
sh -c "$(fetch -o - http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"

Installation path is ~/.config/emacs. See details and other installed linux packages as requirements inside sripts/install.sh.

Usage

See the emacs command my-help for some key-bindings and further commands and information.

  • Org Templates

    • Article: ?article[TAB] / YASnippet - org-mode - Article Templates - Article
    • Letter: ?letter[TAB] / YASnippet - org-mode - Letter Templates - Letter
  • Org Export

    • To Article HTML (extended version)

      • my-org-article-html-export-to-html / My - Org Export - Article HTML
      • my-org-article-html-export-to-html-notify-async (F5) / My - Org Export - Article HTML async
    • To Article PDF (LaTeX, extended version)

      • my-org-article-latex-export-to-pdf / My - Org Export - Article PDF
      • my-org-article-latex-export-to-pdf-notify-async (F6) / My - Org Export - Article PDF async
    • To Letter (LaTeX)

      • my-org-letter-latex-export-to-pdf (C-c C-e l t)

Packages

General key bindings and functions

  • C-r (query-replace-regexp) replace text
  • C-x RET f (set-buffer-file-coding-system) e.g. set to =utf-8
  • (decode-coding-region) e.g. decode to utf-8 (郭富城Aaron Kwok)
  • (diff-buffer-with-file) show a diff between buffer (current state) and file (saved state)
  • rainbow-mode.el :: https://elpa.gnu.org/packages/rainbow-mode.html rainbow-mode is a minor mode for Emacs which displays strings representing colors with the color they represent as background.

Information

Interlock symlinks and auto-save files. Be aware that symbolic links of the form “.#*” are not auto-save files but interlocks to prevent the simultaneous editing of the same file. See Interlocking in the EmacsManual for details.

Errors

  • failed execution of bibtex2html

    • see bib2htmlxxxxxx.blg for errors, e.g.

      • I couldn't open style file acmu.bst
    • copy/merge the texmf directory into your home directory.
  • when using this in an Org mode buffer: #+HEADER: :fit yes :imagemagick yes :iminoptions -density 300

    • can leads to:

      • convert: attempt to perform an operation not allowed by the security policy `gs' @ error/delegate.c/ExternalDelegateCommand/378.
      • convert: no images defined `DESY_logo_tikz.png' @ error/convert.c/ConvertImageCommand/3282.
    • edit /etc/ImageMagick-7/policy.xml and comment out

      • <policy domain="delegate" rights="none" pattern="gs" />

TODOs

  • Org / global configuration

    • Page formatting

      • Modify HTML styling

        • Printed page layout, white styled figures
  • Figures

    • Gnuplot

      • plot transposed files/tables
  • Tables

    • Wrap Table in div element. For smartphone scrolling.
  • Table of contents

    • \(\LaTeX\); currently headers with no-number property means not included in TOC
    • HTML; currently generated list, like lot and lol, are not included in toc but own headers without numbers are.
  • Equation cancel/strike out with color line

    • hcancel[color]{}
    • Example: \(\hcancel[red]{f_{X_2}(x_2)}}\)
    • Definition:

      • Preamble: #+LATEX_HEADER: \usepackage{cancel}
        #+LATEX_HEADER: \newcommand\hcancel[2][black]{\setbox0=\hbox{$#2$}%
        #+LATEX_HEADER: \rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{1pt}}}}#2} \\
      • hcancel: [\"{\\\\setbox0=\\\\hbox{$#2$}\\\\rlap{\\\\raisebox{.45\\\\ht0}{\\\\textcolor{#1}{\\\\rule{\\\\wd0}{1pt}}}}#2}\",2]

        MathJax.Ajax.config.path[\"Contrib\"] = \"https://cdn.mathjax.org/mathjax/contrib\";
        MathJax.Hub.Register.StartupHook(\"TeX Jax Ready\",function () {
        MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{
          cancel: [\"Extension\",\"cancel\"],
          bcancel: [\"Extension\",\"cancel\"],
          xcancel: [\"Extension\",\"cancel\"],
          cancelto: [\"Extension\",\"cancel\"]
        });
        });