# $\LaTeX$ & Vim <!-- Put the link to this slide here so people can follow --> Richard Lai ---- ## Outline 1. $\LaTeX$ 2. Vim 3. .vimrc 4. practice 5. reference --- ## $\LaTeX$ Just a software system for typesetting documents ---- ### What is $\LaTeX$ + A typesetting system based on $\TeX$ + Easy to type formulas or equations in mathematics, physics ---- ### Why $\LaTeX$ ? ![meme1](https://hackmd.io/_uploads/Skb4guW4Jl.jpg =60%x) Microsoft word is shxt, really. ---- ### [Overleaf](https://www.overleaf.com/) + the collaborative, online LaTeX editor that anyone can use. + Pay for better experience (faster compilation, AI...etc) ![overleaf-logo-primary](https://hackmd.io/_uploads/ry-8MubEkl.jpg =70%x) ---- ## Syntax (?) ```tex= \commandname[]{} ``` ---- ![image](https://hackmd.io/_uploads/HJYOb9MV1e.png =95%x) ---- ```tex= \documentclass{article} % class of document \usepackage{graphicx} % Required for inserting images \title{tutorial of latex} \author{richardlaiis} \date{December 2024} \begin{document} % required \maketitle % title, author and date \section{Introduction} \end{document} % required ``` ---- ```tex= \usepackage{packge_name} % import a package ``` ---- ### How to type traditional chinese? ```tex= \usepackage{xeCJK} \setCJKmainfont{Noto Serif CJK SC} % 思源宋體 % Noto Sans CJK SC is 思源黑體 ``` ---- ### Basic typesetting ```tex= \section{Applicaion} \subsection{software} \subsection{hardware} \subsubsection{HDL (Hardware Descriptive Language)} \section{Conclusion} ``` ![image](https://hackmd.io/_uploads/ryUKh3M4kg.png =70%x) ---- ### margin & line space ```tex= \usepackage[margin=2cm, a4paper]{geometry} \usepackage{setspace} \doublespacing % onehalfspacing, ``` ---- ### insert a image ```tex= \usepackage{graphicx} \usepackage{hyperref} \usepackage{float} \begin{figure}[H] \centering \includegraphics[width=1.0\linewidth]{Image/Image.png} \begin{center} \href{https://www.youtube.com/watch?v=dQw4w9WgXcQ}{Click this} \end{center} \end{figure ``` ![image](https://hackmd.io/_uploads/BJOtChM4Jg.png =25%x) ---- ### Lists ```tex= \begin{itemize} \item apple \item mac book \item hell yeah \end{itemize} \begin{enumerate} \item first step \item second step \item last step :))))) \end{enumerate} ``` ![image](https://hackmd.io/_uploads/rkNkl6fN1x.png =30%x) ---- ### table ```tex= \begin{center} \begin{tabular}{ |c|c|c| } \hline cell1 & cell2 & cell3 \\ cell4 & cell5 & cell6 \\ cell7 & cell8 & cell9 \\ \hline \end{tabular} \end{center} ``` ![image](https://hackmd.io/_uploads/SkCAe6MEJe.png =35%x) [~~Table generator~~](https://www.tablesgenerator.com/) ---- ### [My template](https://github.com/richardlaiis/overleaf-code/) Use at your own risk. ---- ### [math](https://github.com/richardlaiis/overleaf-code/blob/main/math_command.md) - inline ![image](https://hackmd.io/_uploads/S1yh76f4ke.png =75%x) ![image](https://hackmd.io/_uploads/ryppX6zVyg.png =75%x) ---- ### math - display ```tex= test: \[\int^b_a \frac{f'(x)}{f(x)}dx=\ln{|f(x)|}+C,\ C\in R\] ``` ![image](https://hackmd.io/_uploads/Byk7rpMVkl.png =70%x) ---- ### More to learn + add headers/footers + citation + more complex equation + "draw" a graph --- ## Vim Highly customizable text editor ---- ![9e8dd2f9-reddit-programming-forum-celebrates-exiting-vim-questions-10th-anniversary](https://hackmd.io/_uploads/rJ5VyOW41l.png =60%x) Is it really that hard? ---- ### Philosiphy + No mouse, only keyboard ---- ### Basic enter vim, go to your WSL, type <code style="color: cyan">vim</code> and enter: ![image](https://hackmd.io/_uploads/r15GwpGEJg.png =60%x) ---- ### Mode ![image](https://hackmd.io/_uploads/BysdwaMEkx.png =70%x) + insert mode: Type text in this mode + normal mode: Type commands + visual mode: Select some texts ---- ### Then, how to ~~exit vim~~ type commands? ![image](https://hackmd.io/_uploads/rJKFO6zEyl.png =70%x) First, enter the normal mode (press ESC) ---- ### How to type commands + <code style="color: cyan">:w</code> : 存檔 + <code style="color: cyan">:q</code> : 離開 + <code style="color: cyan">:q!</code> : 未存檔強制離開 + <code style="color: cyan">:wq</code> : 存檔並離開 ---- ### Movement + Using direction keys are too slow! (Maybe) + Try using hjkl + h for left, l for right, j for down, k for up ---- ### Edit All tasks are done in **normal mode:** + <code style="color: cyan">dd</code> : 剪下 cursor 在的那一行 + <code style="color: cyan">p</code> : paste + <code style="color: cyan">yy</code> : 複製 cursor 在的那一行 + <code style="color: cyan">u</code> : Undo one step ---- ### built-in resources + Just type `vimtutor` in your terminal ![image](https://hackmd.io/_uploads/B1agiTMV1e.png =70%x) --- ## .vimrc vim script ---- ![why-vim-curve](https://hackmd.io/_uploads/rJCybObNJg.png =60%x) ---- ### Time limit exceed :( [my vim configuration](https://github.com/richardlaiis/overleaf-code/blob/main/math_command.md) --- ## Practice ---- ### Game + https://vim-racer.com/ + https://vimsnake.com/ (Snake game but vim ver.) + https://texnique.xyz/ --- ## Reference + https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes + https://blog.techbridge.cc/2020/04/06/how-to-use-vim-as-an-editor-tutorial/
{"slideOptions":"{\"transition\":\"fade\"}","title":"LaTeX & vim","breaks":true,"description":"View the slide with \"Slide Mode\".","contributors":"[{\"id\":\"3f5fe014-25a3-4be4-85ce-7a56506829be\",\"add\":5254,\"del\":2283}]"}
    258 views