Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

refactor: remove latex delimiters option from API and documentation

myhloli58bd959fc545
diff --git a/docs/en/usage/quick_usage.md b/docs/en/usage/quick_usage.md
index 9601bb07..ebedd259 100644
--- a/docs/en/usage/quick_usage.md
+++ b/docs/en/usage/quick_usage.md
@@ -118,7 +118,7 @@ llm_aided:
## Extending MinerU Functionality with Configuration Files
-MinerU works out of the box and reads current settings from `$MINERU_HOME/config.yaml`; set `MINERU_CONFIG` to use another file. Legacy `mineru.json` CLI settings are no longer supported. Gradio's LaTeX delimiters are selected with `--latex-delimiters-type`.
+MinerU works out of the box and reads current settings from `$MINERU_HOME/config.yaml`; set `MINERU_CONFIG` to use another file. Legacy `mineru.json` CLI settings are no longer supported.
Model storage and source settings use the `model` section:
diff --git a/docs/next/cli/mineru-kit-webui.md b/docs/next/cli/mineru-kit-webui.md
index 87235ca2..ec80f116 100644
--- a/docs/next/cli/mineru-kit-webui.md
+++ b/docs/next/cli/mineru-kit-webui.md
@@ -66,7 +66,6 @@ mineru-kit webui \
| `--api-server-disable-image-analysis` | 自动启动 server 时关闭图片分析。 |
| `--enable-example` | 显示当前工作目录 `examples/` 中的示例文件。 |
| `--enable-api` | 暴露 Gradio 转换事件 API。 |
-| `--latex-delimiters-type` | Markdown 预览公式分隔符:`a`、`b` 或 `all`。 |
Gradio 不接受 `--api-server-no-flash`、`--no-flash`、`--api-server-no-advanced`、`--no-advanced`;传入会报错。独立 API 启动命令仍保留 `--no-flash` 和 `--no-advanced`。
diff --git a/docs/zh/usage/quick_usage.md b/docs/zh/usage/quick_usage.md
index 374c8429..b6803452 100644
--- a/docs/zh/usage/quick_usage.md
+++ b/docs/zh/usage/quick_usage.md
@@ -118,7 +118,7 @@ llm_aided:
## 基于配置文件扩展 MinerU 功能
-MinerU 可开箱即用,并从 `$MINERU_HOME/config.yaml` 读取当前配置;可通过 `MINERU_CONFIG` 指定其他配置文件。旧 `mineru.json` CLI 配置不再支持,Gradio 的 LaTeX 分隔符通过 `--latex-delimiters-type` 选择。
+MinerU 可开箱即用,并从 `$MINERU_HOME/config.yaml` 读取当前配置;可通过 `MINERU_CONFIG` 指定其他配置文件。旧 `mineru.json` CLI 配置不再支持。
模型目录和模型源使用 `model` 配置段:
diff --git a/mineru/kit/commands/webui.py b/mineru/kit/commands/webui.py
index 92431c76..5fd0fdd9 100644
--- a/mineru/kit/commands/webui.py
+++ b/mineru/kit/commands/webui.py
@@ -5,7 +5,6 @@ from __future__ import annotations
import importlib.util
import os
from importlib.metadata import version
-from typing import Literal
import typer
from packaging.specifiers import SpecifierSet
@@ -73,9 +72,6 @@ def webui_cmd(
),
enable_example: bool = typer.Option(True, "--enable-example/--no-enable-example", help=t("Show local examples")),
enable_api: bool = typer.Option(True, "--enable-api/--no-enable-api", help=t("Expose the Gradio event API")),
- latex_delimiters_type: Literal["a", "b", "all"] = typer.Option(
- "all", "--latex-delimiters-type", help=t("LaTeX delimiters used by the Markdown preview")
- ),
api_server_tier: str = typer.Option(
"standard", "--api-server-tier", "--tier", help=t("Managed API server capability tier")
),
@@ -113,7 +109,6 @@ def webui_cmd(
max_pages=max_pages,
enable_example=enable_example,
enable_api=enable_api,
- latex_delimiters_type=latex_delimiters_type,
api_server_tier=normalized_tier,
api_server_concurrency=api_server_concurrency,
api_server_disable_image_analysis=api_server_disable_image_analysis,
diff --git a/mineru/kit/gradio/app.py b/mineru/kit/gradio/app.py
index 3c25546b..d337f78a 100644
--- a/mineru/kit/gradio/app.py
+++ b/mineru/kit/gradio/app.py
@@ -10,7 +10,7 @@ import time
from contextlib import aclosing
from pathlib import Path
from collections.abc import Callable
-from typing import Any, Literal
+from typing import Any
from urllib.parse import quote
from ...errors import MineruError
@@ -69,14 +69,6 @@ _DOWNLOAD_ICON_PATHS: dict[str, str] = {
"pdf": "M14 3H5v18h14V8l-5-5v5h5M8 17c3-4 5-8 4-8-2 0-1 7 4 7 3 0-5-3-8 1-1 2 1 1 2 0",
}
_DEFAULT_TIER = "standard"
-_LATEX_DELIMITERS_A = [
- {"left": "$$", "right": "$$", "display": True},
- {"left": "$", "right": "$", "display": False},
-]
-_LATEX_DELIMITERS_B = [
- {"left": "\\(", "right": "\\)", "display": False},
- {"left": "\\[", "right": "\\]", "display": True},
-]
_DOWNLOAD_ICON_HTML = f"""
<button type="button" class="mineru-kit-download-icon" title="Download results" aria-label="Download results"
data-mineru-i18n-key="download_results" data-mineru-i18n-attr="title aria-label"
@@ -319,15 +311,6 @@ def _download_updates(gr: Any, *, interactive: bool, run_id: str = "") -> tuple[
return (run_id, *(gr.update(value=label, interactive=interactive) for _format_name, label in _DOWNLOAD_FORMATS))
-def _latex_delimiters(delimiters_type: Literal["a", "b", "all"]) -> list[dict[str, Any]]:
- """按 CLI 选择返回 Gradio Markdown 组件使用的公式分隔符。"""
- if delimiters_type == "a":
- return list(_LATEX_DELIMITERS_A)
- if delimiters_type == "b":
- return list(_LATEX_DELIMITERS_B)
- return [*(_LATEX_DELIMITERS_A), *(_LATEX_DELIMITERS_B)]
-
-
def build_gradio_app(
client: V1ArtifactClient | GradioArtifactClient,
capabilities: V1ServerCapabilities,
@@ -335,7 +318,6 @@ def build_gradio_app(
output_root: Path,
enable_example: bool = True,
enable_api: bool = True,
- latex_delimiters_type: Literal["a", "b", "all"] = "all",
max_pages: int | None = None,
) -> Any:
"""构建不启动监听端口的 Gradio Blocks 应用,便于单元测试和外部托管。"""
@@ -1033,7 +1015,6 @@ def launch_gradio(
output_dir: str,
enable_example: bool,
enable_api: bool,
- latex_delimiters_type: Literal["a", "b", "all"],
api_server_tier: str,
api_server_concurrency: int,
api_server_disable_image_analysis: bool,
@@ -1079,7 +1060,6 @@ def launch_gradio(
output_root=output_root,
enable_example=enable_example,
enable_api=enable_api,
- latex_delimiters_type=latex_delimiters_type,
max_pages=max_pages,
)
demo.launch(
diff --git a/mineru/utils/translations.py b/mineru/utils/translations.py
index 4006e848..529c90ff 100644
--- a/mineru/utils/translations.py
+++ b/mineru/utils/translations.py
@@ -471,7 +471,6 @@ ZH_MESSAGES: dict[str, str] = {
"Maximum pages per non-Flash PDF conversion; omitted: unlimited": "非 Flash PDF 单次转换的最大页数;省略时不限制",
"Show local examples": "显示本地示例",
"Expose the Gradio event API": "开放 Gradio 事件 API",
- "LaTeX delimiters used by the Markdown preview": "Markdown 预览使用的 LaTeX 定界符",
"Managed API server capability tier": "托管 API server 的能力档位",
"Managed server job concurrency": "托管服务的任务并发数",
"Disable managed server image analysis": "禁用托管服务的图像分析",
diff --git a/tests/unittest/test_kit_gradio_page_range.py b/tests/unittest/test_kit_gradio_page_range.py
index 496934f0..78742af8 100644
--- a/tests/unittest/test_kit_gradio_page_range.py
+++ b/tests/unittest/test_kit_gradio_page_range.py
@@ -85,7 +85,6 @@ def test_launch_forwards_limit_and_versioned_assets(monkeypatch: pytest.MonkeyPa
output_dir=str(tmp_path),
enable_example=False,
enable_api=True,
- latex_delimiters_type="all",
api_server_tier="standard",
api_server_concurrency=1,
api_server_disable_image_analysis=False,
@@ -133,7 +132,6 @@ def test_launch_forwards_managed_options_and_stops_server(monkeypatch: pytest.Mo
output_dir=str(tmp_path),
enable_example=False,
enable_api=True,
- latex_delimiters_type="all",
api_server_tier="standard",
api_server_concurrency=2,
api_server_disable_image_analysis=False,
@@ -210,7 +208,6 @@ def test_launch_remote_flash_fallback_and_cleanup(
"output_dir": str(tmp_path),
"enable_example": False,
"enable_api": True,
- "latex_delimiters_type": "all",
"api_server_tier": "standard",
"api_server_concurrency": 2,
"api_server_disable_image_analysis": True,