Sphinx - MyST - 日本語 - pdf

日本語のドキュメントをsphinxで難なく作れる時代のようです。 Markdownで書きたいので、MySTを使っています。

extensions = [
    "sphinx.ext.mathjax",
    "sphinx.ext.viewcode",
    "myst_parser",
]

myst_enalbe_extensions = [
    "amsmath",
    "dollarmath",
    "html_admonition",
    "html_image",
    "linkify",
    "replacements",
    "smartquotes",
    "tasklist",
]
myst_dmath_double_inline = True
source_suffix = ".md"
latex_docclass = {}
master_doc = "index"
latex_documents = [
    (
        master_doc,
        "my_filename.tex",
        "タイトル",
        "私の名前",
        "howto",
    ),
]
language = "ja"

language="ja"がuplatexを使うなど上手くやってくれる。

LuaLatexを使う場合はlanguage="ja"は不要だがpreambleに日本語環境を設定する必要がある。

latex_engine = "lualatex"
latex_elements = {
    "preamble": r"""
\usepackage{luatexja}
\usepackage[hiragino-pron,deluxe]{luatexja-preset}
\renewcommand{\kanjifamilydefault}{\gtdefault}
"""
}

howtoでコンパクトなpdfを作りたい場合、よさそうなdocclassが見当たらなかった。一方デフォルトだとhowtoのセクションの番号付けがおかしくなる。空のlatex_docclassを置き、index.mdの最初に次のものを入れることで妥当なものができた。

# dummy

'''{toctree}
---
caption: 目次
maxdepth: 1
---
'''

backtickが書けないので'で代用した。

_OPENMP not activated with setuptools

Environment: M1 mac, conda-forge c-compiler

Currently looking for the reason, but _OPENMP is not activated in C macro when using setuptools to compile, though usual build using cmake does with the same compiler.

My mistake: extra_compile_args was not properly set.

My recent terminal setting

Alacritty

env:
  TERM: xterm-256color

selection:
  save_to_clipboard: true

window:
  dimensions:
    columns: 90
    lines: 24
  padding:
    x: 2
    y: 2

font:
  size: 13
  normal:
    family: 'Iosevka'
    style: Regular

  bold:
    family: 'Iosevka'
    style: Bold

scrolling:
  history: 10000
  multiplier: 3

# Colors (One Dark - https://github.com/atom/atom/tree/master/packages/one-dark-syntax)
colors:
  primary:
    #background: '#282c34'
    background: '#262626'
    foreground: '#abb2bf'
  cursor:
    text:       CellBackground
    cursor:     '#528bff' # syntax-cursor-color
  selection:
    text:       CellForeground
    background: '#3e4451' # syntax-selection-color
  normal:
    black:      '#5c6370' # mono-3
    red:        '#e06c75' # red 1
    green:      '#98c379'
    yellow:     '#e5c07b' # orange 2
    blue:       '#61afef'
    magenta:    '#c678dd'
    cyan:       '#56b6c2'
    white:      '#828997' # mono-2

tmux

set -g prefix C-t
bind -n S-left select-pane -L
bind -n S-down select-pane -D
bind -n S-up select-pane -U
bind -n S-right select-pane -R

set -g status-justify "centre"
set -g status-bg "#262626"
set -g status-fg colour248

set -g window-style 'bg=colour236'
set -g window-active-style 'bg=#262626'

bind e setw synchronize-panes \; display "synchronize-panes #{?pane_synchronized,on,off}"
set -g status-left "#[fg=green]Session: #S"
set -g window-status-current-format "#[fg=green,bg=#262626,bold] #I: #W"
set -g status-position top
set -g mode-style "bg=#3e4451"

# selected options from tmux-sensible
set -g history-limit 50000
set -g display-time 4000
set -g status-interval 5
set -g status-keys emacs

set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
bind -n WheelDownPane select-pane -t= \; send-keys -M

set -g @plugin 'tmux-plugins/tmux-cpu'
set -g status-right '#[fg=green]#h#[default] #{cpu_fg_color} #{cpu_percentage}'

run '~/.tmux/plugins/tpm/tpm'

Vim

GitHub - gosukiwi/vim-atom-dark: A vim theme inspired by Atom's default dark theme

htop

This is to visualize CPU cores' usage. Divide terminal into two panes in tmux vertically and put htop in a small pane at the bottom.

conda-forge

.condarc

auto_activate_base: false
channel_priority: strict
channels:
  - conda-forge

homebrew (macOS Monterey)

brew install wget
brew install tmux
brew install coreutils
brew install gnu-tar
brew install imagemagick
brew install gnuplot
brew install ripgrep
brew install fd
brew install htop
brew install --cask xquartz
brew install --cask visual-studio-code
brew install --cask skim
brew install --cask mactex-no-gui
brew install pygments
brew tap homebrew/cask-fonts
brew install font-ricty-diminished --cask
brew install --cask alacritty
brew install --cask font-iosevka

sshfsはこちらから
GitHub - gromgit/homebrew-fuse: gromgit's FUSE tap

export PATH=/usr/local/bin:$PATH