Newbiemacs Lecture 1
Table of Contents
Introduction
- Newbiemacs는 Emacs를 기반으로 개발한 수학자를 위한 프로그램
- AI가 latex 코드를 생성해 주는 시대에 latex을 배울 필요가 있을까?
- AI로 코드를 생성한 후 그것을 편집하는 것이 중요함
- Newbiemacs는 latex 코드를 원하는 대로 편집하는데 편리한 기능을 제공
History of Newbiemacs
- 2022년 10월부터 Newbiemacs 개발 시작
- 현재 국내외 약 10명이 사용중
Features of Newbiemacs
- pdf와 tex 파일 통합 관리
- 다양한 LaTeX 편집 기능
- 손쉬운 사용자 스니펫 추가
- 간편한 BibTeX 사용
Basic notions
Notation
notation | description |
---|---|
C |
Ctrl key |
M |
Meta key (Alt or Command for Mac) |
RET |
Return key (Enter key) |
M-RET |
hold M and press RET |
Newbiemacs screen
- Click Bee Icon
- Or type
M-<backspace>
Newbiemacs home folder
- Newbiemacs folder:
~/newbiemacs
- Folder Icon in Newbiemacs screen
Help
- Type
?
in Newbiemacs screen.
Organize pdf and tex files
How to find pdf or tex file
- Type
p
ort
in Newbiemacs screen. - Or click PDF or TEX Icon anytime.
Add pdf files
How to add a pdf file from arxiv
Visit the title page of a paper from https://arxiv.org/
- (Skip this in mac) Copy the address.
- Type
a
in Newbiemacs screen.
Exercises
- Add 3 papers from the arxiv.
- Open the 3 papers that you downloaded.
How to add a pdf file of a published paper
- Download a pdf file.
Find the paper in MathSciNet.
- Click
Cite
, and then clickCopy
. - In Newbiemacs screen, type
m
.
Exercises
- Add 3 papers using mathscinet.
- Open the 3 papers that you downloaded.
How to create a new tex file
- Type
n
in Newbiemacs screen. - Enter a file name.
- Choose a template file.
Exercises
- Create 3 tex files.
- Open the 3 tex files that you created.
How to delete, copy, or rename pdf or tex files
- Open current folder: Folder Icon
- Open pdf or tex folder
- Open the Newbiemacs home folder.
- Goto the pdf or tex folder.
- You can delete, copy, or rename files as you normally do.
Exercises
- Download sample-tex-file.
- Copy the sample-tex-file folder under the tex folder.
- Open the tex file in Newbiemacs.
LaTeX Features
How to edit tex files
- Compile:
M-RET b
- View pdf:
M-RET v
- pdf to tex:
- (mac) Command+Shift+mouse click
- (win) double click
Basic keybindings
keybinding | description |
---|---|
C-c , C-v , C-x |
copy, paste, cut |
C-s |
save file |
C-z , C-y |
undo, redo |
C-f |
search |
C-F |
search and replace |
- (During search)
C-s
: next match - (During search)
C-r
: previous match
The dollar key
- $키를 한 번 누르면 inline math mode
- $키를 두 번 누르면 display math mode
- 수식 입력후 $키를 누르면 수식 밖으로 커서가 이동
- 한글 입력 상태인 경우 한영 자동 전환
- 한영 전환:
M-i
수식 전환
M-RET t i
: inline math에서 display math로 변환M-RET t e
: display math에서 \begin{equation} 환경으로 전환M-RET t a
: display math에서 \begin{align} 환경으로 전환
화면의 수식 복사
M-RET p
누르고 복사를 원하는 수식 레이블 입력M-RET P
: environment를 붙여넣기
Insert environments
M-RET e
누르고 원하는 environment 선택M-RET e RET
현재 environment를 변경
Define new macros
M-RET n m
Greek letters
- To insert
\alpha
, type`a
Insert references
M-RET r r
orM-RET r i
M-RET t r
: toggle \usepackage{refcheck}
Add screenshots
- Take a screenshot.
- Type the following in your tex file.
M-RET i f
: insert a figure environmentM-RET i q
: insert image only
Change variables
- Select the region to apply changes.
- Press
M-RET t v
.
Jump to sections
M-RET =
M-RET j s
Jump to anywhere in screen
- Type
M-n
. - Type the first letter of the word you want to move.
- Type the label.
More features
M-RET `
: Go to errorM-RET c
: Copy the current math contentM-RET C
: Copy the current math content with environmentM-RET d
: Delete the current math contentM-RET D
: Delete the current math content with environmentM-RET t =
: Swap LHS and RHS.M-RET t p
: Toggle patheses (..) to \left(..\right).M-RET n s
: New sectionM-RET .
: Select the current environment
BibTeX
What is BibTeX?
- It is a program that manages references.
How to open the main bib file
- In Newbiemacs screen, type
x 5
- You may copy and paste the content of your own bib file to this file.
How to use the main bib file
- In your tex file, type
M-RET B T
This will add the following two lines in your tex file.
\bibliographystyle{abbrv} \bibliography{(path-to-newbiemacs)/newbiemacs/nbm-user-settings/references/ref.bib}
- To insert a citation, type
M-RET r c
How to toggle the bibliography
- In your tex file, type
M-RET B T
- This will toggle the above two lines to the actual bibitems.
- This may be useful if you want to share your tex file with your collaborators without sharing the bib file.
How to add a new bibtex item from MathSciNet
- Copy a bibtex item from MathSciNet or zbMath.
- In a tex file, type
M-RET B n
and follow the instructions.
How to add a new bibtex item from arxiv
- Go to the arxiv page of the article you want to cite.
- Click Export BibTeX Citation on the right box and copy the contents.
- In a tex file, type
M-RET B n
and follow the instructions.
Snippets
What is a snippet?
- It is a code block that you can insert quickly.
How to use snippets
- With keys
- Type the key of the snippet.
- Type
TAB
key. - You may enter contents and type
TAB
to exit the snippet.
- Without keys
M-RET s i
How to see existing snippets
M-RET s t
Exercises
- Use the following snippets:
fr
,bi
lp
,la
su,
,su;
,pr,
,pr;
++
,--
,..
,,,
<<
,<<=
,>>
inv
(in math mode trya inv
andTAB
)iff
xn+
,xn,
- Discover 3 more snippets on your own.
How to create a new snippet
M-RET s q
: create a simple snippetM-RET s n
: create a complicated snippetM-RET s d
: delete a snippetM-RET s f
: visit a snippet file
Exercises
- Create a snippet with key skku and content Sungkyunkwan University
- Create 3 more snippets on your own. (e.g. LHS, RHS, TFAE, etc.)
Snippet syntax
- Example
# -*- mode: snippet -*- # name: frac # key: fr # -- \frac{$1}{$2}
- Example
# -*- mode: snippet -*- # name: x1+...+xn # key: xn+ # -- ${1:x}_1 + \cdots + $1_{${2:n}}
- Example
# -*- mode: snippet -*- # name: display-math # key: dm # -- \[ $0 \]
Exercises
- Create a snippet for the Vandermonde determinant.
- key: vdm
content:
\prod_{1\le i<j\le n}(x_i-x_j)
- Make
n
andx
be modifiable.
Create 3 more snippets on your own. For example,
\lim_{n\to \infty} \det\left( \right) \bigcup_{i=0}^n
Extra
Update Newbiemacs
- Type
U
in Newbiemacs screen.
Torus Game
- Click Torus Icon.
Change themes
M-o N T ?
: helpM-o N T c
: Change theme
Modify template files
- In Newbiemacs screen, type
x 4
- Edit any template tex file you want.
- You may also add your own template files here.
Further study
- Org mode: Organize everything!
- Vim: In Newbiemacs screen
x e
and select vim. - Git: You can collaborate with people using Overleaf.