泪过无痕
泪过无痕
这家伙很懒,什么也没写!

注册于 1年前

回答
7
文章
0
关注者
0

demo地址:https://texocr.netlify.app。 主项目地址:https://github.com/alephpi/Texo。 前端项目地址:https://github.com/alephpi/Texo-web。 (觉得好用的朋友可以点点赞点点star,帮助算法推荐给更多人。) 网站部署在Netlify 上,国内访问可能有卡顿。首次加载会拉一个约80MB的模型,往后就可以完全离线运行了。 本模型就是讲求一个短小精悍,模型参数量只有20M,体积80MB,底模是PP-FormulaNet-S,在UniMERNet-1M训练集上微调得到,同时减去了一切无用的token才能达到这个参数量。目前市面上的LaTeXOCR五花八门,本模型敢宣称是目前参数量最小且不失准确的。正因为小,所以推理速度快,占用内存小,对设备几乎没有任何要求。以Web APP的形式交付也免去了任何python环境配置的繁琐,而且天然多端支持。 2025年了,开源生态早已发展到人人可以获取免费的LaTeX识别工具了,只是一款开箱即用、多端支持的工具迟迟没出现,技术上没有任何难度可言,但迟迟没有人做这件事,可能大家都忙着刷榜单,不太在意新手使用门槛,被我占了先机。本人是LaTeXOCR重度用户,还在Mathpix免费公测期就入坑了,收费后又转战SimpleTex,近来SimpleTex也因为要维持服务器使用成本,逐渐限制免费使用,难以为爱发电,思来想去有了这个项目。力所能及为开源社区贡献一点力量,希望能帮到同样身为STEM/AI学习者做笔记、写文章。

https://mp.weixin.qq.com/s/2o4c5jufnXXbHT-2zBkkiA

https://mp.weixin.qq.com/s/48xQ1j-6wLP2SdylgC3Ijg
https://mp.weixin.qq.com/s/V73gnILqfpScQuqDEYod7A

https://mp.weixin.qq.com/s/3MLQQv0jS2VrvhsSciHb7g
https://mp.weixin.qq.com/s/l0kAPREW2oBERmI_dujfmw
https://mp.weixin.qq.com/s/YPyYolVYr0QlrHcpCIBB_w
https://mp.weixin.qq.com/s/ijXZzba7nPtj_ryoZaFMuA
https://mp.weixin.qq.com/s/kfj6fDPKRFDVe7J5IpUGsg
https://mp.weixin.qq.com/s/yO7OzTo-NJGzsgT14euJjg
https://mp.weixin.qq.com/s/qEVDCvdz5WC0agMA69zgLA
https://mp.weixin.qq.com/s/zJjSxCkCFuHLl1G4M87FUA
https://mp.weixin.qq.com/s/e-gQY344El2yTFx0spIcwA
https://mp.weixin.qq.com/s/fGH7CNXW42Tn-REPb4EGiA
https://mp.weixin.qq.com/s/MgWkMYExWJtGc2A7omswxg
https://mp.weixin.qq.com/s/TNQP8DfNiRiBlsgeHRXVVA
https://mp.weixin.qq.com/s/7LNVFsy9DGslMDqK_O_2Qw
https://mp.weixin.qq.com/s/SiG_z59QHYsGH38GLZnG9g
https://mp.weixin.qq.com/s/im3_ipXP9bhibr9ki_katQ

注意到\tableofcontents命令里面调用如下(texdoc classes)

image.png

因此最简单的办法是临时renewcommand即可(目录的\section*可以整些不一样的样式)

image.png

\documentclass[]{ctexart}
\ctexset{section/format+=\raggedright}
\begin{document}
{
\RenewDocumentCommand{\section}{som}
{\bigskip\centering\bfseries#3\par\bigskip}
\tableofcontents
}
\section{111}
\section{222}
\section{333}
\end{document}

multitoc兼容:

image.png

\documentclass[]{ctexart}
\usepackage[toc]{multitoc}
\ctexset{section/format+=\raggedright}
\begin{document}
{
\RenewDocumentCommand{\section}{som}
{\bigskip\centering\bfseries#3\par\bigskip}
\tableofcontents
}
\section{111}
\section{222}
\section{333}
\end{document}

这个问题里面,设置了若干标点特性。请注意“设为无效”的优先级顺序。
https://www.latexstudio.net/index/details/index/mid/4462.html
但是仍有两行(标红色)搞不定

我先捡个软柿子捏:[H]的意思是:就在这里!有这个说明你间接导入了float宏包,意思是,不管latex的换页算法,就在此处放入浮动体。这个选项一般用于给Word用惯了的老师交论文……

v2
封装了一下
image.png

\documentclass{ctexart}
\usepackage{expl3}

\ExplSyntaxOn

% 声明全局变量
\tl_new:N \g_info_tl
\tl_new:N \g_title_tl
\tl_new:N \g_mixd_tl

\seq_new:N \g_infos_seq
\seq_gclear:N \g_infos_seq

\cs_new:Nn \concat_mixd:
{
    % \tl_set:Nx \g_mixd_tl {asd \tl_use:N \g_info_tl dfg \tl_use:N \g_title_tl ghj}
    \tl_set:Nx \g_mixd_tl { \tl_use:N \g_info_tl \tl_use:N \g_title_tl }
    % 调试:g_mixd_tl:【\g_mixd_tl】
}

\cs_new:Nn \addseq_mixd:
{
    \seq_put_right:Nx \g_infos_seq { \tl_use:N \g_mixd_tl }
}

\begin{document}

% 给两个令牌列表赋值
\tl_gset:Nn \g_info_tl {123}
\tl_gset:Nn \g_title_tl {456}
% 调用命令将拼接结果添加到序列中
\concat_mixd:
\addseq_mixd:

\par
% 输出序列内容
\seq_use:Nn \g_infos_seq {\par}

% 另起一段
\par

% 给两个令牌列表赋值
\tl_gset:Nn \g_info_tl {abc}
\tl_gset:Nn \g_title_tl {def}
% 调用命令将拼接结果添加到序列中
\concat_mixd:
\addseq_mixd:

\par
% 显示序列的内容
\seq_use:Nn \g_infos_seq {\par}


% 给两个令牌列表赋值
\tl_gset:Nn \g_info_tl {感谢 Sagittarius Rover}
\tl_gset:Nn \g_title_tl {\={a}}
% 调用命令将拼接结果添加到序列中
\concat_mixd:
\addseq_mixd:

\par
% 显示序列的内容
\seq_use:Nn \g_infos_seq {\par}
\end{document}
\ExplSyntaxOff

v1
已解决:
image.png

\documentclass{ctexart}
\usepackage{expl3}

\ExplSyntaxOn

% 声明全局变量
\tl_new:N \g_info_tl
\tl_new:N \g_title_tl
\tl_new:N \g_mixd_tl

\seq_new:N \g_infos_seq
\seq_gclear:N \g_infos_seq

% 自定义命令,将拼接结果添加到序列中
\cs_new:Npn \concat_and_add_to_seq:
 {
   % 拼接 \g_info_tl 和 \g_title_tl 的内容
   \tl_set:Nx \g_mixd_tl { \tl_use:N \g_info_tl \tl_use:N \g_title_tl }

   g_mixd_tl:【\g_mixd_tl】
   % 将拼接结果添加到序列中
   \seq_put_right:Nx \g_infos_seq { \tl_use:N \g_mixd_tl }
 }


\begin{document}

% 给两个令牌列表赋值
\tl_gset:Nn \g_info_tl {123}
\tl_gset:Nn \g_title_tl {456}
% 调用命令将拼接结果添加到序列中
\concat_and_add_to_seq:

\par
% 输出序列内容
\seq_use:Nn \g_infos_seq {\par}

% 另起一段
\par

% 给两个令牌列表赋值
\tl_gset:Nn \g_info_tl {abc}
\tl_gset:Nn \g_title_tl {def}
% 调用命令将拼接结果添加到序列中
\concat_and_add_to_seq:

\par
% 显示序列的内容
\seq_use:Nn \g_infos_seq {\par}


% 给两个令牌列表赋值
\tl_gset:Nn \g_info_tl {感谢 Sagittarius Rover}
\tl_gset:Nn \g_title_tl {\={a}
\'{a}
\v{a}
\`{a}
\={o}
\'{o}
\v{o}
\`{o}
\={e}
\'{e}
\v{e}
\`{e}
\={i}
\'{i}
\v{i}
\`{i}}
% 调用命令将拼接结果添加到序列中
\concat_and_add_to_seq:

\par
% 显示序列的内容
\seq_use:Nn \g_infos_seq {\par}
\end{document}
\ExplSyntaxOff

发布
问题