20220930 morning
This commit is contained in:
parent
6f6da57cd1
commit
8d65b7025f
|
|
@ -21,14 +21,14 @@
|
|||
"\n",
|
||||
"\"\"\"---设置关键字, 同一field下不同选项为or关系, 同一字典中不同字段间为and关系, 不同字典间为or关系, _not表示列表中的关键字都不含, 同一字典中的数字用来供应同一字段不同的条件之间的and---\"\"\"\n",
|
||||
"keywords_dict_table = [\n",
|
||||
" {\"tags\":[\"第五单元\"],\"content\":[\"mathrm{i}\",\"复数\",\"虚数\"]}\n",
|
||||
" {\"tags\":[\"第六单元\"],\"objs\":[\"K0602\"]}\n",
|
||||
"]\n",
|
||||
"\"\"\"---关键字设置完毕---\"\"\"\n",
|
||||
"# 示例: keywords_dict_table = [\n",
|
||||
"# {\"tags\": [\"第三单元\"], \"content1\": [r\"[\\d]\\alpha\",\"2x\"], \"content2\": [\"sin\"], \"content3\": [\"cos\"],\"content4\": [\"cot\"], \"content5\": [\"tan\"]},\n",
|
||||
"# ]\n",
|
||||
"\"\"\"---设置输出文件名---\"\"\"\n",
|
||||
"filename = \"临时文件/关键字筛选题号.txt\"\n",
|
||||
"filename = \"临时文件/K0602.txt\"\n",
|
||||
"\"\"\"---文件名设置完毕---\"\"\"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.9.7 ('base')",
|
||||
"display_name": "Python 3.8.8 ('base')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
|
@ -99,12 +99,12 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.9.7"
|
||||
"version": "3.8.8"
|
||||
},
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "e4cce46d6be9934fbd27f9ca0432556941ea5bdf741d4f4d64c6cd7f8dfa8fba"
|
||||
"hash": "d311ffef239beb3b8f3764271728f3972d7b090c974f8e972fcdeedf230299ac"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,49 @@
|
|||
\documentclass[10pt,a4paper]{article}
|
||||
\usepackage[UTF8,fontset = windows]{ctex}
|
||||
\setCJKmainfont[BoldFont=黑体,ItalicFont=楷体]{华文中宋}
|
||||
\usepackage{amssymb,amsmath,amsfonts,amsthm,mathrsfs,dsfont,graphicx}
|
||||
\usepackage{ifthen,indentfirst,enumerate,color,titletoc}
|
||||
\usepackage{tikz}
|
||||
\usepackage{multicol}
|
||||
\usepackage{makecell}
|
||||
\usepackage{longtable}
|
||||
\usepackage{diagbox}
|
||||
\usetikzlibrary{arrows,calc,intersections,patterns,decorations.pathreplacing,3d,angles,quotes,positioning,shapes.geometric}
|
||||
\usepackage[bf,small,indentafter,pagestyles]{titlesec}
|
||||
\usepackage[top=1in, bottom=1in,left=0.8in,right=0.8in]{geometry}
|
||||
\renewcommand{\baselinestretch}{1.65}
|
||||
\newtheorem{defi}{定义~}
|
||||
\newtheorem{eg}{例~}
|
||||
\newtheorem{ex}{~}
|
||||
\newtheorem{rem}{注~}
|
||||
\newtheorem{thm}{定理~}
|
||||
\newtheorem{coro}{推论~}
|
||||
\newtheorem{axiom}{公理~}
|
||||
\newtheorem{prop}{性质~}
|
||||
\newcommand{\blank}[1]{\underline{\hbox to #1pt{}}}
|
||||
\newcommand{\bracket}[1]{(\hbox to #1pt{})}
|
||||
\newcommand{\onech}[4]{\par\begin{tabular}{p{.9\textwidth}}
|
||||
A.~#1\\
|
||||
B.~#2\\
|
||||
C.~#3\\
|
||||
D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\twoch}[4]{\par\begin{tabular}{p{.46\textwidth}p{.46\textwidth}}
|
||||
A.~#1& B.~#2\\
|
||||
C.~#3& D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\vartwoch}[4]{\par\begin{tabular}{p{.46\textwidth}p{.46\textwidth}}
|
||||
(1)~#1& (2)~#2\\
|
||||
(3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\fourch}[4]{\par\begin{tabular}{p{.23\textwidth}p{.23\textwidth}p{.23\textwidth}p{.23\textwidth}}
|
||||
A.~#1 &B.~#2& C.~#3& D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\varfourch}[4]{\par\begin{tabular}{p{.23\textwidth}p{.23\textwidth}p{.23\textwidth}p{.23\textwidth}}
|
||||
(1)~#1 &(2)~#2& (3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
\begin{document}
|
||||
|
||||
待替换
|
||||
|
||||
\end{document}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os,re,json\n",
|
||||
"with open(r\"../题库0.3/problems.json\",\"r\",encoding = \"utf8\") as f:\n",
|
||||
" jsondata = f.read()\n",
|
||||
"pro_dict = json.loads(jsondata)\n",
|
||||
"id = input(\"输入题目id:\")\n",
|
||||
"id = id.zfill(6)\n",
|
||||
"content = pro_dict[id][\"content\"]\n",
|
||||
"\n",
|
||||
"with open(r\"模板文件/题目编辑.tex\",\"r\",encoding = \"utf8\") as f:\n",
|
||||
" template_data = f.read()\n",
|
||||
"\n",
|
||||
"output_data = template_data.replace(\"待替换\",content)\n",
|
||||
"with open(r\"临时文件/toedit.tex\",\"w\",encoding = \"utf8\") as f:\n",
|
||||
" f.write(output_data)\n",
|
||||
"\n",
|
||||
"os.system(\"code 临时文件/toedit.tex\")\n",
|
||||
"cont = input(\"继续请按回车\")\n",
|
||||
"with open(r\"临时文件/toedit.tex\",\"r\",encoding = \"utf8\") as f:\n",
|
||||
" edited_data = f.read()\n",
|
||||
"new_content = re.findall(r\"\\\\begin{document}([\\s\\S]*?)\\\\end{document}\",edited_data)[0].strip()\n",
|
||||
"pro_dict[id][\"content\"] = new_content\n",
|
||||
"\n",
|
||||
"jsondata_new=json.dumps(pro_dict,indent = 4,ensure_ascii=False)\n",
|
||||
"with open(r\"../题库0.3/problems.json\",\"w\",encoding = \"utf8\") as f:\n",
|
||||
" f.write(jsondata_new)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.8.8 ('base')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.8"
|
||||
},
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "d311ffef239beb3b8f3764271728f3972d7b090c974f8e972fcdeedf230299ac"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
Reference in New Issue