实验一实验报告

This commit is contained in:
2025-10-10 20:07:22 +08:00
parent b3fce2616a
commit 3b88de0b20
17 changed files with 1318 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
@echo off
:: 解决中文乱码(将注释单独成行,避免紧跟命令)
chcp 65001 > nul
:: 启用延迟扩展(确保变量正确解析)
setlocal enabledelayedexpansion
:: 检查必要文件
if not exist "*.md" (
echo 错误:当前目录没有.md文件
pause
exit /b 1
)
if not exist "default-template.latex" (
echo 错误找不到default-template.latex
pause
exit /b 1
)
:: 转换当前目录下所有.md文件
for %%f in (*.md) do (
echo 开始转换:%%f
set "filename=%%~nf"
:: 移除 -V geometry解决选项冲突后面解释
pandoc "%%f" --template=default-template.latex --pdf-engine=xelatex --resource-path=. -o "!filename!.pdf"
if %errorlevel% equ 0 (
echo 转换成功:!filename!.pdf
) else (
echo 转换失败:%%f
)
echo ----------------------
)
endlocal
echo 所有文件处理完毕!
pause