作為一款顏值極高慕购、功能豐富并且跨平臺的 Markdown 編輯器洲胖,是一個很好的選擇竣况。然而折騰是沒有止境的,為了追求最佳的視覺感受扇丛,用 Tyopra 自帶的轉(zhuǎn)換為 LaTeX 功能术吗,進行再次細化排版也是個適合完美主義者的選擇。
廢話好多帆精。较屿。直接來干貨吧:
轉(zhuǎn)換后我們會得到一個.latex文件,直接編譯它卓练,就能得到一個初步的PDF文件隘蝎。
目錄
Typora 可以插入目錄,其實轉(zhuǎn)換到 LaTeX 中就是一句
\tableofcontents
然而編譯后會發(fā)現(xiàn)沒有章節(jié)的編號襟企,像這樣:
Screen Shot 2017-04-10 at 1.04.14 PM.png
在 tex 文件中找到這一行
\setcounter{secnumdepth}{0}
將 0 改為 你需要目錄顯示的深度比如 3 層:
\setcounter{secnumdepth}{3}
再次編譯就能看到章節(jié)編號了嘱么。
表格
表格會無視頁面寬度,像這樣:
Screen Shot 2017-04-10 at 1.13.13 PM.png
其實說到底就是個表格的排版問題顽悼,我找了個基本的樣式:每列居中曼振,寬度自適應(yīng)使得表格寬度與頁面寬度一致,結(jié)果是這樣的:
Screen Shot 2017-04-10 at 1.11.23 PM.png
配置方法是在海洋大神的 LaTeX入門中
5.1.3 定寬表格與tabularx
中提到的:Screen Shot 2017-04-10 at 1.15.08 PM.png
Screen Shot 2017-04-10 at 1.21.30 PM.png
將原來 Typora 轉(zhuǎn)化過來的
\begin{longtable}[]{@{}ll@{}}
\toprule
Types of risk &\tabularnewline
\midrule
\endhead
External Unpredictable & Route planning, Natural hazards\tabularnewline
External Predictable & Weather conditions\tabularnewline
Internal Non-technical & Supply, Clothing, Conflict\tabularnewline
Technical & Vehicle damage, GPS device damage, Medical
condition\tabularnewline
Legal & Visa\tabularnewline
\bottomrule
\end{longtable}
這一套東西掐頭去尾蔚龙,改成 tabularx
宏包:
\begin{tabularx}{\textwidth}{cY}
\toprule
Types of risk &\tabularnewline
\midrule
% \endhead
External Unpredictable & Route planning, Natural hazards\tabularnewline
External Predictable & Weather conditions\tabularnewline
Internal Non-technical & Supply, Clothing, Conflict\tabularnewline
Technical & Vehicle damage, GPS device damage, Medical
condition\tabularnewline
Legal & Visa\tabularnewline
\bottomrule
\end{tabularx}
注意之前要預定義命令:
\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
有兩點要注意:
- 注意命令最后的參數(shù)
\begin{tabularx}{\textwidth}{cY}
其中 c
或者 Y
的數(shù)目要根據(jù)表格的列數(shù)來決定冰评。
- 刪去一行
\endhead
沒有深究原因,因為刪掉就編譯通過了木羹。甲雅。歡迎大佬來解說