### Format Physical Quantities with siunitx Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Use the \qty command from the siunitx package for well-formatted physical quantities and units. Example shows formatting for speed and gravitational acceleration. ```latex \qty{299792.458}{\km\per\s} ``` ```latex $g=\qty{9.801}{m.s^{-2}}$ ``` -------------------------------- ### Initialize Document Class Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Use the mpltx class to start your LaTeX document, accepting standard article and revtex4-2 parameters. ```latex \documentclass[]{mpltx} ``` -------------------------------- ### Complete Report Example in LaTeX Source: https://context7.com/castlestar14654/pkumpltx/llms.txt A full example of a physics lab report using the mpltx document class. It demonstrates the structure, including title, abstract, sections, tables, figures, and bibliography. ```latex \documentclass[font=notofandol]{mpltx} \begin{document} \title{迈克尔逊干涉仪测量光波波长} \author{李华} \emailphone{lihua@pku.edu.cn}{13800000000} \affiliation{北京大学物理学院\quad 学号: 2100012345} \date{\zhdate{2024/4/10}} \begin{abstract} 本实验使用迈克尔逊干涉仪测量了氦氖激光器的波长。 通过调节可移动反射镜,观察干涉条纹的移动, 测量得到波长为 $\lambda = \qty{632.5(8)}{\nm}$, 与标准值 $\qty{632.8}{\nm}$ 符合良好。 实验验证了光的波动性并掌握了精密长度测量方法。 \end{abstract} \keywords{迈克尔逊干涉仪, 光波波长, 干涉条纹} \maketitle \section{引言} 迈克尔逊干涉仪是光学精密测量的重要仪器... \section{实验原理}\label{sec:theory} 当两束相干光的光程差为波长整数倍时产生明条纹: \begin{equation}\label{eq:interference} 2d = m\lambda \end{equation} 其中 $d$ 为镜面移动距离,$m$ 为条纹移动数目。 \section{实验装置} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{fig/instruments.png} \caption{迈克尔逊干涉仪光路示意图} \label{fig:setup} \end{figure} \section{结果与讨论} \begin{table} \caption{波长测量数据} \label{tab:data} \begin{ruledtabular} \begin{tabular}{cd{2.4}d{3.0}} 组号 & \mc{1}{c}{$d$/mm} & \mc{1}{c}{$m$} \\ \colrule 1 & 0.3164 & 1000 \\ 2 & 0.3162 & 1000 \\ 3 & 0.3167 & 1000 \\ \end{tabular} \end{ruledtabular} \end{table} 由\autoref{eq:interference}和\autoref{tab:data}计算得 $\lambda = \qty{632.5(8)}{\nm}$。 \section{结论} 实验成功测量了氦氖激光波长,结果与标准值一致。 \begin{acknowledgments} 感谢王老师的实验指导。 \end{acknowledgments} \bibliography{bibli} \appendix \section{思考题}\label{app:exercise} \subsection{等倾干涉与等厚干涉的区别?} 答:... \end{document} ``` -------------------------------- ### Configure Font Options Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Examples of setting font options within the document class declaration. ```latex \documentclass[font=windows]{mpltx} ``` ```latex \documentclass{mpltx} ``` -------------------------------- ### Acknowledgments and Appendices Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Use dedicated environments for acknowledgments and appendices. \texttt{\\begin{acknowledgments}} is used for thanks, and \texttt{\\appendix} starts the appendix section where subsequent \texttt{\\section} commands are automatically letter-coded (A, B, C...). ```latex \documentclass[font=default]{mpltx} \begin{document} % ... 正文内容 ... \section{结论} 本实验成功测量了普朗克常数... % 致谢环境 \begin{acknowledgments} 感谢张老师在实验过程中的悉心指导, 感谢李同学在数据处理方面提供的帮助。 \end{acknowledgments} % 参考文献 \bibliography{bibli} % 附录前另起一页 \clearpage % 开始附录 - 之后的 \section 自动编号为 A, B, C... \appendix \section{思考题解答}\label{app:questions} \subsection{为什么要在真空中进行实验?} 答:避免光电子与空气分子碰撞... \section{原始数据记录}\label{app:data} 详细测量数据见\autoref{tab:raw_data}... \end{document} ``` -------------------------------- ### Bibliography Management with BibTeX Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Manage references using BibTeX. The MPLTX class presets the APS \texttt{apsrev4-2} format. Examples show citing single and multiple references. ```latex % ===== 主文档 main.tex ===== \documentclass[font=default]{mpltx} \begin{document} % 引用参考文献 根据文献 \cite{einstein1905},光电效应... 实验方法参考了教材 \cite{jindaishiyan} 第 3 章。 多篇文献可连续引用 \cite{planck1901,millikan1916}。 % 在文档末尾生成参考文献列表 % 参数为 .bib 文件名 (不含扩展名) \bibliography{bibli} \end{document} % ===== 参考文献数据库 bibli.bib ===== @book{jindaishiyan, author = {吴思诚 and 荀坤}, title = {近代物理实验}, edition = {4}, publisher = {高等教育出版社}, address = {北京}, year = {2015} } @article{PhysRevLett.116.061102, title = {Observation of Gravitational Waves from a Binary Black Hole Merger}, author = {Abbott, B. P. and others}, journal = {Phys. Rev. Lett.}, volume = {116}, pages = {061102}, year = {2016}, doi = {10.1103/PhysRevLett.116.061102} } ``` -------------------------------- ### Physics Package Support (Optional) Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Enabling the 'physics' option provides convenient commands for physical symbols and calculus. Note: \qty is renamed to \qtyp to avoid conflicts. ```latex \documentclass[font=default,physics]{mpltx} \begin{document} % 导数符号 \begin{equation} \dv{f}{x}, \quad \dv[2]{f}{x}, \quad \pdv{f}{x}{y} \end{equation} % 自动调整大小的括号 (使用 \qtyp 而非 \qty) \begin{equation} \qtyp(\frac{a}{b}), \quad \qtyp[\frac{a}{b}], \quad \qtyp{\frac{a}{b}} \end{equation} % 狄拉克符号 \begin{equation} \bra{\psi}, \quad \ket{\phi}, \quad \braket{\psi}{\phi}, \quad \expval{H}{\psi} \end{equation} % 矢量微分算符 \begin{equation} \grad{f}, \quad \div{\vb{F}}, \quad \curl{\vb{F}}, \quad \laplacian{f} \end{equation} \end{document} ``` -------------------------------- ### Basic Document Class Invocation Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Use \documentclass{mpltx} for basic usage. Options like font, quanjiao, and physics can be included for specific configurations. ```latex \documentclass{mpltx} ``` ```latex % 指定字体选项 (Windows 用户) \documentclass[font=windows]{mpltx} ``` ```latex % 指定字体选项 (macOS 用户) \documentclass[font=macos]{mpltx} ``` ```latex % 使用 Noto + Fandol 字体组合 (跨平台推荐) \documentclass[font=notofandol]{mpltx} ``` ```latex % 启用全角句号映射 (将 "." 自动替换为 ".") \documentclass[quanjiao]{mpltx} ``` ```latex % 启用 physics 宏包支持 \documentclass[physics]{mpltx} ``` ```latex % 组合多个选项 \documentclass[font=notofandol,quanjiao,physics]{mpltx} ``` -------------------------------- ### Physics Package Support (Optional) Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Enabling the `physics` option allows the use of convenient commands for physical symbols and calculus typesetting. Note: `\qty` is renamed to `\qtyp` to avoid conflicts with siunitx. ```APIDOC ## Physics Package Support (Optional) Enabling the `physics` option allows the use of convenient physical symbol and calculus typesetting commands. Note: `\qty` is renamed to `\qtyp` to avoid conflicts with siunitx. ### Derivative Symbols ```latex \begin{equation} \dv{f}{x}, \quad \dv[2]{f}{x}, \quad \pdv{f}{x}{y} \end{equation} ``` ### Auto-Sized Brackets (using `\qtyp` instead of `\qty`) ```latex \begin{equation} \qtyp(\frac{a}{b}), \quad \qtyp[\frac{a}{b}], \quad \qtyp{\frac{a}{b}} \end{equation} ``` ### Dirac Notation ```latex \begin{equation} \bra{\psi}, \quad \ket{\phi}, \quad \braket{\psi}{\phi}, \quad \expval{H}{\psi} \end{equation} ``` ### Vector Differential Operators ```latex \begin{equation} \grad{f}, \quad \div{\vb{F}}, \quad \curl{\vb{F}}, \quad \laplacian{f} \end{equation} ``` ``` -------------------------------- ### Physics Package Command Renaming Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Demonstrates how the \qty command from the physics package is renamed to \qtyp to avoid conflicts with siunitx. This is done during the import of the physics package. ```latex \qtyp() ``` -------------------------------- ### SI Unit Support with siunitx Source: https://context7.com/castlestar14654/pkumpltx/llms.txt The template preloads the siunitx package for standardized typesetting of physical quantities and units. Use \qty{value}{unit}, \unit{unit}, and \num{value}. ```latex \documentclass[font=default]{mpltx} \begin{document} % \qty{数值}{单位} - 排版带单位的物理量 光速 $c = \qty{299792458}{m/s}$ % 科学计数法 电子电量 $e = \qty{1.602e-19}{C}$ % 复合单位 重力加速度 $g = \qty{9.801}{m.s^{-2}}$ % 使用预定义单位宏 波长 $\lambda = \qty{632.8}{\nm}$ 功率 $P = \qty{100}{\kW}$ 温度 $T = \qty{300}{\K}$ % \unit{} - 单独排版单位 测量精度为 \unit{mm} 量级 % \num{} - 排版数值 测量次数 $n = \num{10000}$ % 不确定度表示 $h = \qty{6.626(15)e-34}{\J\s}$ \end{document} ``` -------------------------------- ### Compile Documents with XeLaTeX and latexmk Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Documents must be saved with UTF-8 encoding. Manual compilation involves multiple \texttt{xelatex} and \texttt{bibtex} runs. \texttt{latexmk} is recommended for automated compilation, with options for continuous compilation and cleanup. ```bash # 源文件必须使用 UTF-8 编码保存 # 方法一: 手动编译 (以 template.tex 为例) # 第一次编译 - 生成基本文档和辅助文件 xelatex template # 处理参考文献 bibtex template # 第二次编译 - 将参考文献写入文档 xelatex template # 第三次编译 - 更新所有交叉引用 xelatex template # 方法二: 使用 latexmk 自动化编译 (推荐) latexmk -xelatex template.tex # 方法三: 持续编译模式 (适合写作时预览) latexmk -xelatex -pvc template.tex # 清理辅助文件 latexmk -c template.tex ``` -------------------------------- ### Physics Package Derivative Command Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Shows the usage of the \dv command from the physics package for denoting derivatives. Requires the physics package to be loaded. ```latex \dv{f}{x} ``` -------------------------------- ### International System of Units (siunitx) Support Source: https://context7.com/castlestar14654/pkumpltx/llms.txt The template preloads the `siunitx` package for standardized typesetting of physical quantities, including values and units. ```APIDOC ## International System of Units Support (siunitx) The template preloads the `siunitx` package, for standardized typesetting of physical quantities' values and units. ### Usage Examples * `\qty{value}{unit}` - Typesets a physical quantity with its unit. Speed of light $c = \qty{299792458}{m/s}$ * Scientific Notation Elementary charge $e = \qty{1.602e-19}{C}$ * Compound Units Gravitational acceleration $g = \qty{9.801}{m.s^{-2}}$ * Using Predefined Unit Macros Wavelength $\lambda = \qty{632.8}{\nm}$ Power $P = \qty{100}{\kW}$ Temperature $T = \qty{300}{\K}$ * `\unit{}` - Typesets a unit on its own. Measurement precision is on the order of \unit{mm} * `\num{}` - Typesets a number. Number of measurements $n = \num{10000}$ * Uncertainty Representation $h = \qty{6.626(15)e-34}{\J\s}$ ``` ``` -------------------------------- ### Compile Document Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Standard compilation sequence for documents using bibtex and xelatex. ```bash xelatex template bibtex template xelatex template xelatex template ``` -------------------------------- ### Table Column Formatting with dcolumn Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Illustrates the use of the dcolumn package for creating table columns that align by the decimal point. This provides an alternative to siunitx's similar functionality. ```latex dcolumn ``` -------------------------------- ### Report Metadata Commands Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Set report title, author, affiliation, date, abstract, and keywords. \maketitle generates the title page. ```latex \documentclass[font=default]{mpltx} \begin{document} % 报告标题 - 应简短明确,切合报告内容 \title{光电效应测普朗克常数} % 作者姓名 - \emailphone 必须紧跟 \author 后面 \author{张三} % 方式一: 同时提供邮箱和电话 \emailphone{zhangsan@pku.edu.cn}{(86)138XXXXXXXX} % 方式二: 仅提供邮箱 (可选的前缀文本) \emailphone[联系方式: ]{zhangsan@pku.edu.cn}{138XXXXXXXX} % 方式三: 只有邮箱时使用 \email \email{zhangsan@pku.edu.cn} % 作者单位和学号 \affiliation{北京大学物理学院\quad 学号: 2100000000} % 实验日期 - 推荐使用 \zhdate 或 \localedate 生成中文日期 \date{\zhdate{2024/3/15}} % 输出: 2024 年 3 月 15 日 % 或使用 babel 提供的命令 \date{\localedate{2024}{3}{15}} % 输出: 2024 年 3 月 15 日 % 摘要 - 200-300 字 \begin{abstract} 本实验通过光电效应测量了普朗克常数。 使用汞灯光源和光电管,测量不同频率光照射下的截止电压。 由截止电压与光频率的线性关系,拟合得到普朗克常数为 $h = (6.58 \pm 0.12) \times 10^{-34}$ J·s, 与公认值误差在 2% 以内。 \end{abstract} % 关键词 - 2-4 个 \keywords{光电效应, 普朗克常数, 截止电压} % 生成标题页 \maketitle ``` -------------------------------- ### Define Email and Phone Number with Footnote Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md The \emailphone command creates a footnote with a pretext, email address (as a link), and phone number. Requires the \emailphone command to be defined. ```latex \emailphone[]{}{} ``` -------------------------------- ### Report Metadata Commands Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Commands for setting the title, author, affiliation, date, and abstract for the experiment report. ```APIDOC ## Report Metadata Commands Set the basic information for the experiment report, such as title, author, affiliation, date, and abstract. ### Example Usage ```latex \documentclass[font=default]{mpltx} \begin{document} % Report Title - Should be concise and relevant to the report content \title{Measurement of Planck's Constant via Photoelectric Effect} % Author Name - \emailphone must follow \author immediately \author{Zhang San} % Method 1: Provide both email and phone \emailphone{zhangsan@pku.edu.cn}{(86)138XXXXXXXX} % Method 2: Provide only email (optional prefix text) \emailphone[Contact Info: ]{zhangsan@pku.edu.cn}{138XXXXXXXX} % Method 3: Use \email when only email is provided \email{zhangsan@pku.edu.cn} % Author Affiliation and Student ID \affiliation{School of Physics, Peking University\quad Student ID: 2100000000} % Experiment Date - Recommended to use \zhdate or \localedate for Chinese dates \date{\zhdate{2024/3/15}} % Outputs: 2024 年 3 月 15 日 % Or use babel's provided command \date{\localedate{2024}{3}{15}} % Outputs: 2024 年 3 月 15 日 % Abstract - 200-300 words \begin{abstract} This experiment measures Planck's constant using the photoelectric effect. Using a mercury lamp as the light source and a phototube, the cutoff voltage for different light frequencies was measured. From the linear relationship between cutoff voltage and light frequency, Planck's constant was fitted as $h = (6.58 \pm 0.12) \times 10^{-34}$ J·s, with an error within 2% of the accepted value. \end{abstract} % Keywords - 2-4 keywords \keywords{Photoelectric Effect, Planck's Constant, Cutoff Voltage} % Generate Title Page \maketitle ``` ``` -------------------------------- ### Document Class Invocation Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Demonstrates the basic and customized ways to invoke the mpltx document class, including font and feature options. ```APIDOC ## Document Class Invocation Use the `mpltx` document class to create experiment reports. This document class inherits from `revtex4-2`, pre-sets the APS Physical Review E preprint format, and supports A4 paper and AMS mathematical symbols. ### Basic Usage - Using Default Configuration ```latex % Basic usage - using default configuration \documentclass{mpltx} ``` ### Specifying Font Options (Windows Users) ```latex % Specifying font options (Windows users) \documentclass[font=windows]{mpltx} ``` ### Specifying Font Options (macOS Users) ```latex % Specifying font options (macOS users) \documentclass[font=macos]{mpltx} ``` ### Using Noto + Fandol Font Combination (Cross-platform Recommended) ```latex % Using Noto + Fandol font combination (cross-platform recommended) \documentclass[font=notofandol]{mpltx} ``` ### Enabling Full-width Period Mapping (Automatically replaces "。" with ".") ```latex % Enabling full-width period mapping (automatically replaces "。" with ".") \documentclass[quanjiao]{mpltx} ``` ### Enabling physics Package Support ```latex % Enabling physics package support \documentclass[physics]{mpltx} ``` ### Combining Multiple Options ```latex % Combining multiple options \documentclass[font=notofandol,quanjiao,physics]{mpltx} ``` ``` -------------------------------- ### Mathematical and Physical Symbol Commands Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Provides shorthand commands for common mathematical and physical symbols, adhering to national standards for upright symbols. ```latex \documentclass[font=default]{mpltx} \begin{document} % \ii - 虚数单位 i (正体) % \jj - 虚数单位 j (正体,电气工程常用) % \ee - 自然对数底 e (正体) % \uppi - 圆周率 π (正体) % 欧拉公式示例 \begin{equation} \ee^{\ii\uppi} + 1 = 0 \end{equation} % 复数阻抗示例 (电气工程) \begin{equation} Z = R + \jj\omega L = |Z|\ee^{\jj\phi} \end{equation} % 高斯积分 \begin{equation} \int_{-\infty}^{+\infty} \ee^{-x^2} \mathrm{d}x = \sqrt{\uppi} \end{equation} \end{document} ``` -------------------------------- ### Mathematics and Physics Symbols Commands Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Provides shorthand commands for common mathematical and physical symbols, adhering to national standards and ISO requirements for upright symbols. ```APIDOC ## Mathematics and Physics Symbols Commands The template provides shorthand commands for common mathematical and physical symbols, conforming to national standards and ISO requirements for upright symbols. ### Commands * `\ii` - Imaginary unit i (upright) * `\jj` - Imaginary unit j (upright, common in electrical engineering) * `\ee` - Base of natural logarithm e (upright) * `\uppi` - Pi (upright) ### Example: Euler's Formula ```latex \begin{equation} \ee^{\ii\uppi} + 1 = 0 \end{equation} ``` ### Example: Complex Impedance (Electrical Engineering) ```latex \begin{equation} Z = R + \jj\omega L = |Z|\ee^{\jj\phi} \end{equation} ``` ### Example: Gaussian Integral ```latex \begin{equation} \int_{-\infty}^{+\infty} \ee^{-x^2} \mathrm{d}x = \sqrt{\uppi} \end{equation} ``` ``` -------------------------------- ### Font Options Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Details on configuring Chinese font schemes, with support for 6 preset configurations to adapt to different operating systems and font environments. ```APIDOC ## Font Options (font) Configure Chinese font schemes. Supports 6 preset configurations, adapting to different operating systems and font environments. ### `font=default` - Using xeCJK Default Configuration (Fandol Font) * The most compatible option, suitable for first-time users. ```latex % font=default - using xeCJK default configuration (Fandol font) % The most compatible option, suitable for first-time users \documentclass[font=default]{mpltx} ``` ### `font=fandol` - Author's Customized Fandol Font Configuration * Serif italics use Fangsong, sans-serif italics use Kaiti. ```latex % font=fandol - author customized Fandol font configuration % Serif italics use Fangsong, sans-serif italics use Kaiti \documentclass[font=fandol]{mpltx} ``` ### `font=noto` - Using Noto CJK SC Series Fonts * Requires installation of Noto Serif CJK SC and Noto Sans CJK SC. * Fangsong and Kaiti use system-provided fonts (Windows/macOS only). ```latex % font=noto - using Noto CJK SC series fonts % Requires installation of Noto Serif CJK SC and Noto Sans CJK SC % Fangsong and Kaiti use system-provided fonts (only Windows/macOS) \documentclass[font=noto]{mpltx} ``` ### `font=notofandol` - Noto Serif/Sans + Fandol Fangsong/Kaiti * Recommended cross-platform solution, but baseline alignment may occur. ```latex % font=notofandol - Noto Serif/Sans + Fandol Fangsong/Kaiti % Cross-platform recommended solution, but baseline alignment may occur \documentclass[font=notofandol]{mpltx} ``` ### `font=windows` - Using Windows System Fonts * HuaWen Song Ti, Deng Xian, HuaWen Fang Song, HuaWen Kai Ti. ```latex % font=windows - using Windows system fonts % HuaWen Song Ti, Deng Xian, HuaWen Fang Song, HuaWen Kai Ti \documentclass[font=windows]{mpltx} ``` ### `font=macos` - Using macOS System Fonts * Song Ti Simplified, Ping Fang, Fang Song, Kai Ti Simplified. ```latex % font=macos - using macOS system fonts % Song Ti Simplified, Ping Fang, Fang Song, Kai Ti Simplified \documentclass[font=macos]{mpltx} ``` ### Customizing Fonts After Using Any Option ```latex % Customizing fonts after using any option \documentclass[font=default]{mpltx} \setCJKmainfont{Source Han Serif SC} \setCJKsansfont{Source Han Sans SC} ``` ``` -------------------------------- ### Create Academic Tables with ruledtabular Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Use the \texttt{ruledtabular} environment for academic-style tables with double horizontal rules. Supports \texttt{d{a.b}} column format for decimal alignment. ```latex \documentclass[font=default]{mpltx} \begin{document} \begin{table} \caption{不同波长下的光电效应测量数据} \label{tab:photoelectric} \begin{ruledtabular} % d{a.b} 格式: 小数点前留 a 位,后留 b 位 % \mc 是 \multicolumn 的简写 \begin{tabular}{cd{3.1}d{1.3}d{1.2}} 序号 & \mc{1}{c}{波长/nm} & \mc{1}{c}{频率/$10^{14}$Hz} & \mc{1}{c}{截止电压/V} \\ \colrule % 中间横线 1 & 365.0 & 8.214 & 1.85 \\ 2 & 404.7 & 7.408 & 1.43 \\ 3 & 435.8 & 6.879 & 1.18 \\ 4 & 546.1 & 5.490 & 0.62 \\ 5 & 577.0 & 5.196 & 0.47 \\ \end{tabular} \end{ruledtabular} \end{table} % 表格脚注会自动放在表尾 \begin{table} \caption{实验参数% \footnote{室温 $T = \qty{25}{\celsius}$}% \footnote{相对湿度 45%}} \label{tab:params} \begin{ruledtabular} \begin{tabular}{lc} 参数 & 数值 \\ \colrule 光电管型号 & GD-4 \\ 光源 & 高压汞灯 \\ \end{tabular} \end{ruledtabular} \end{table} \end{document} ``` -------------------------------- ### Font Configuration Options Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Configure Chinese font schemes with 6 preset options. Use \setCJKmainfont and \setCJKsansfont for custom font definitions. ```latex % font=default - 使用 xeCJK 默认配置 (Fandol 字体) % 最兼容的选项,适合初次使用者 \documentclass[font=default]{mpltx} ``` ```latex % font=fandol - 作者定制的 Fandol 字体配置 % 衬线斜体使用仿宋,无衬线斜体使用楷体 \documentclass[font=fandol]{mpltx} ``` ```latex % font=noto - 使用 Noto CJK SC 系列字体 % 需要安装 Noto Serif CJK SC 和 Noto Sans CJK SC % 仿宋和楷体使用系统自带字体 (仅 Windows/macOS) \documentclass[font=noto]{mpltx} ``` ```latex % font=notofandol - Noto 宋体黑体 + Fandol 仿宋楷体 % 跨平台推荐方案,但可能存在基线不对齐 \documentclass[font=notofandol]{mpltx} ``` ```latex % font=windows - 使用 Windows 系统字体 % 华文宋体、等线、华文仿宋、华文楷体 \documentclass[font=windows]{mpltx} ``` ```latex % font=macos - 使用 macOS 系统字体 % 宋体-简、苹方、仿宋、楷体-简 \documentclass[font=macos]{mpltx} ``` ```latex % 使用任意选项后仍可自定义字体 \documentclass[font=default]{mpltx} \setCJKmainfont{Source Han Serif SC} \setCJKsansfont{Source Han Sans SC} ``` -------------------------------- ### Insert and Reference Figures with graphicx Source: https://context7.com/castlestar14654/pkumpltx/llms.txt Use the \texttt{graphicx} package to insert figures. Supports relative width settings and automatic numbering. Recommended to use vector formats like PDF for data plots. ```latex \documentclass[font=default]{mpltx} \begin{document} % 单图插入 \begin{figure} \centering % 推荐使用相对宽度,适应不同页面 \includegraphics[width=0.8\linewidth]{fig/instruments.png} \caption{光电效应实验装置示意图。 光源发出的光经滤光片选频后照射到光电管阴极, 产生的光电子被阳极收集,通过微电流计测量光电流。} \label{fig:setup} \end{figure} % 数据图 (推荐使用矢量格式 PDF) \begin{figure} \centering \includegraphics[width=0.85\textwidth]{fig/figsample.pdf} \caption{截止电压与光频率的关系。 实线为最小二乘法拟合结果,斜率对应 $h/e$。 误差棒表示测量的标准不确定度。} \label{fig:data} \end{figure} % 引用图片 - \autoref 自动添加 "图" 字 由\autoref{fig:setup}可见,实验装置由光源、滤光片和光电管组成。 \autoref{fig:data}展示了截止电压随频率的变化关系。 \end{document} ``` -------------------------------- ### Math Mode Aliases for j, i, and e Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Defines \jj, \ii, and \ee as \mathrm versions of j, i, and e respectively for use in mathematical mode. ```latex \jj, \ii, \ee ``` -------------------------------- ### Punctuation Option for Full-width Punctuation Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Use the 'quanjiao' option to automatically replace standard Chinese full-width punctuation (like '。') with '.' when inputting '。'. This is useful for adhering to GB/T 15834-1995 standards in scientific documents. ```latex quanjiao ``` -------------------------------- ### Automatic Cross-Referencing with \autoref Source: https://context7.com/castlestar14654/pkumpltx/llms.txt The \texttt{\\autoref} command automatically generates cross-references with type names, localized for Chinese. It supports sections, equations, figures, tables, and appendices. ```latex \documentclass[font=default]{mpltx} \begin{document} \section{理论背景}\label{sec:theory} 光电效应的基本方程为 \begin{equation}\label{eq:photoelectric} h\nu = W + \frac{1}{2}mv_{\max}^2 \end{equation} \subsection{实验方法}\label{ssec:method} % 各种交叉引用示例 根据\autoref{sec:theory}的理论分析... % 输出: 小节 1 由\autoref{eq:photoelectric}可知... % 输出: 式 (1) 实验装置见\autoref{fig:setup}... % 输出: 图 1 测量数据列于\autoref{tab:data}... % 输出: 表 1 % 页码引用 参见\autopageref{tab:data}... % 输出: 第 X 页 \appendix \section{公式推导}\label{app:derivation} ... \end{document} ``` -------------------------------- ### Subfig Package Option Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md When using the subfig package, it's necessary to disable its default caption handling by setting the 'caption=false' option to avoid conflicts with the revtex4-2 base class. ```latex caption=false ``` -------------------------------- ### Alias for multicolumn Source: https://github.com/castlestar14654/pkumpltx/blob/master/README.md Defines \mc as an alias for the \multicolumn command in LaTeX. ```latex \mc ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.