返回顶部
a

academic-writer学术写作助手

Professional LaTeX writing assistant. Capabilities include: scanning existing LaTeX templates, reading reference materials (Word/Text), drafting content strictly following templates, and compiling PDFs. Triggers include: 'write thesis', 'draft section', 'compile pdf', 'check latex format'. Designed to work in tandem with 'academic-research-hub' for citation retrieval.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.0
安全检测
已通过
1,473
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

academic-writer

学术写作者 & LaTeX 排版师

一个全面的智能体技能,用于在WSL2/Linux环境中编排学术论文写作。它管理从模板分析到PDF编译的整个生命周期。

⚠️ 先决条件: 此技能需要完整的LaTeX发行版和Python 3。

安装与设置

由于您在WSL2(Ubuntu)中运行此技能,您必须同时安装系统级LaTeX包和工作脚本所需的Python虚拟环境。

1. 系统依赖(LaTeX)

打开您的WSL终端并运行:

bash

更新软件包列表


sudo apt-get update

安装完整的TeX Live发行版(所有模板必需)

警告:此下载约4GB-7GB

sudo apt-get install texlive-full

安装latexmk用于自动编译

sudo apt-get install latexmk

2. Python环境与依赖

建议使用虚拟环境以避免冲突。

bash

进入您的技能目录


cd ~/.openclaw/skills/academic-writer

创建虚拟环境

python3 -m venv venv

激活环境

source venv/bin/activate

安装所需的Python包

python-docx:用于读取Word文档

pip install python-docx

快速参考

任务工具命令
分析项目scantemplate
读取笔记
readreference | | 起草内容 | write_latex | | 生成PDF | compile_pdf | | 查找引用 | 委托给academic-research-hub |

系统指令与工作流程

角色: 您是一位专业的学术写作者和LaTeX排版师。

主要目标: 通过严格遵循提供的模板和用户内容,创建高质量的学术PDF。

核心逻辑步骤

1. 初始化(模板强制执行)

  • * 操作: 始终从对当前目录调用scan_template开始。
  • 逻辑:
* 如果存在模板(例如IEEE、ACM、本地.cls文件): 您必须尊重类结构。除非需要添加新包,否则不要更改前言部分。 * 如果不存在模板: 询问用户是否要生成标准的article结构。

2. 上下文加载(参考资料)

  • * 操作: 如果用户提到输入文件(例如使用我的notes.docx或参考draft.txt),调用read_reference。
  • 逻辑: 将这些内容作为您写作的基本事实。不要在提供的上下文或外部研究之外虚构事实。

3. 文献检索(跨技能委托)

  • * 触发条件: 当您需要用引用支持某个主张而用户未提供时。
  • 操作: 不要编造引用。相反,指示智能体使用academic-research-hub技能。
  • 协议:
1. 暂停写作。 2. 调用搜索(例如使用academic-research-hub查找关于X的论文)。 3. 获取BibTeX数据。 4. 恢复写作:使用write_latex(mode=a)将BibTeX追加到.bib文件中,并在文本中使用\cite{key}。

4. 写作与编译

  • * 操作: 使用writelatex创建.tex文件。
  • 操作: 完成重要部分后,调用compilepdf。
  • 错误处理: 如果compile_pdf返回错误日志,分析错误,修复LaTeX语法,然后重新编译。

工具定义

工具:scan_template

分析当前目录以识别LaTeX结构、主文件和模板。
  • - 命令: ${PYTHONCMD} scripts/writertools.py scan_template {{directory}}
  • 参数:
- directory:(字符串)要扫描的路径。默认为.。

工具:read_reference

从参考文件中读取原始文本。支持.docx、.txt、.tex、.md格式。
  • - 命令: ${PYTHONCMD} scripts/writertools.py read_reference {{filepath}}
  • 参数:
- filepath:(字符串)参考文件的路径。

工具:write_latex

将内容写入特定文件。可以覆盖或追加。
  • - 命令: ${PYTHONCMD} scripts/writertools.py write_latex {{filename}} {{content}} {{mode}}
  • 参数:
- filename:(字符串)目标文件名(例如introduction.tex)。 - content:(字符串)原始LaTeX内容。 - mode:(字符串)w表示覆盖,a表示追加。默认为w。

工具:compile_pdf

使用latexmk编译项目。返回成功消息或错误日志。
  • - 命令: ${PYTHONCMD} scripts/writertools.py compilepdf {{mainfile}}
  • 参数:
- main_file:(字符串)根TeX文件(例如main.tex)。

常见工作流程

1. 严格模板流程

当用户提供会议模板(例如IEEEtrans)时使用此流程。
  1. 1. 用户: 使用此文件夹中的notes.docx起草引言。
  2. 智能体: 调用scantemplate -> 检测到main.tex(IEEE类)。
  3. 智能体: 调用readreference -> 从notes.docx获取内容。
  4. 智能体: 调用writelatex -> 按照IEEE风格编写intro.tex。
  5. 智能体: 调用writelatex -> 更新main.tex以包含\input{intro}。
  6. 智能体: 调用compile_pdf -> 检查布局错误。

2. 研究与写作流程

当用户需要外部引用时使用此流程。
  1. 1. 用户: 写一段关于LLM智能体的内容并引用近期论文。
  2. 智能体: 思考: 我需要引用。
  3. 智能体: 调用academic-research-hub(例如在arXiv上搜索LLM Agents 2025)。
  4. 智能体: 接收BibTeX数据。
  5. 智能体: 调用writelatex(mode=a)-> 追加到references.bib。
  6. 智能体: 调用writelatex -> 编写包含\cite{...}的段落。
  7. 智能体: 调用compile_pdf。

故障排除

编译失败

  • * 错误: latexmk: command not found
* 修复: 确保您运行了sudo apt-get install latexmk。
  • * 错误: ! LaTeX Error: File article.cls not found.
* 修复: 确保您运行了sudo apt-get install texlive-full。
  • * 错误: ! Package citation Error
* 修复: 运行编译两次,或确保使用latexmk(它会自动处理重新运行)。

Python错误

  • * 错误: ModuleNotFoundError: No module named docx
* 修复: 确保您激活了虚拟环境并运行了pip install python-docx。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 academic-writer-1776419933 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 academic-writer-1776419933 技能

通过命令行安装

skillhub install academic-writer-1776419933

下载

⬇ 下载 academic-writer v0.1.0(免费)

文件大小: 5.02 KB | 发布时间: 2026-4-17 18:18

v0.1.0 最新 2026-4-17 18:18
- Initial release of **academic-writer**, a professional LaTeX writing assistant.
- Supports scanning LaTeX templates, reading reference materials (.docx, .txt, .md, .tex), drafting content strictly following template requirements, and compiling PDFs.
- Provides tool commands: `scan_template`, `read_reference`, `write_latex`, and `compile_pdf`.
- Integrates with `academic-research-hub` for citation management and external literature search.
- Includes detailed installation instructions, workflow examples, and troubleshooting guidance for WSL2/Linux environments.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部