pyeasyphd 0.4.42__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyeasyphd/.python-version +1 -0
- pyeasyphd/Main.sublime-menu +43 -0
- pyeasyphd/__init__.py +5 -0
- pyeasyphd/data/templates/csl/apa-no-ampersand.csl +2183 -0
- pyeasyphd/data/templates/csl/apa.csl +2133 -0
- pyeasyphd/data/templates/csl/ieee.csl +512 -0
- pyeasyphd/data/templates/tex/Article.tex +38 -0
- pyeasyphd/data/templates/tex/Article_Header.tex +29 -0
- pyeasyphd/data/templates/tex/Article_Tail.tex +3 -0
- pyeasyphd/data/templates/tex/Beamer_Header.tex +79 -0
- pyeasyphd/data/templates/tex/Beamer_Tail.tex +14 -0
- pyeasyphd/data/templates/tex/Style.tex +240 -0
- pyeasyphd/data/templates/tex/TEVC_Header.tex +52 -0
- pyeasyphd/data/templates/tex/TEVC_Tail.tex +4 -0
- pyeasyphd/data/templates/tex/eisvogel.tex +1064 -0
- pyeasyphd/data/templates/tex/math.tex +201 -0
- pyeasyphd/data/templates/tex/math_commands.tex +677 -0
- pyeasyphd/data/templates/tex/nextaimathmacros.sty +681 -0
- pyeasyphd/main/__init__.py +6 -0
- pyeasyphd/main/basic_input.py +101 -0
- pyeasyphd/main/pandoc_md_to.py +380 -0
- pyeasyphd/main/python_run_md.py +320 -0
- pyeasyphd/main/python_run_tex.py +200 -0
- pyeasyphd/pyeasyphd.py +86 -0
- pyeasyphd/pyeasyphd.sublime-settings +100 -0
- pyeasyphd/pyeasyphd.sublime-syntax +5 -0
- pyeasyphd/scripts/__init__.py +34 -0
- pyeasyphd/scripts/_base.py +65 -0
- pyeasyphd/scripts/run_article_md.py +101 -0
- pyeasyphd/scripts/run_article_tex.py +94 -0
- pyeasyphd/scripts/run_beamer_tex.py +84 -0
- pyeasyphd/scripts/run_compare.py +71 -0
- pyeasyphd/scripts/run_format.py +62 -0
- pyeasyphd/scripts/run_generate.py +211 -0
- pyeasyphd/scripts/run_replace.py +34 -0
- pyeasyphd/scripts/run_search.py +251 -0
- pyeasyphd/tools/__init__.py +12 -0
- pyeasyphd/tools/generate/generate_from_bibs.py +181 -0
- pyeasyphd/tools/generate/generate_html.py +166 -0
- pyeasyphd/tools/generate/generate_library.py +203 -0
- pyeasyphd/tools/generate/generate_links.py +400 -0
- pyeasyphd/tools/py_run_bib_md_tex.py +398 -0
- pyeasyphd/tools/search/data.py +282 -0
- pyeasyphd/tools/search/search_base.py +146 -0
- pyeasyphd/tools/search/search_core.py +400 -0
- pyeasyphd/tools/search/search_keywords.py +229 -0
- pyeasyphd/tools/search/search_writers.py +350 -0
- pyeasyphd/tools/search/utils.py +190 -0
- pyeasyphd/utils/utils.py +99 -0
- pyeasyphd-0.4.42.dist-info/METADATA +33 -0
- pyeasyphd-0.4.42.dist-info/RECORD +53 -0
- pyeasyphd-0.4.42.dist-info/WHEEL +4 -0
- pyeasyphd-0.4.42.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
// pyeasyphd/main/pandoc_md_to.py
|
|
3
|
+
// for pandoc
|
|
4
|
+
"csl_name": "apa-no-ampersand",
|
|
5
|
+
// the number of columns in md files
|
|
6
|
+
"columns_in_md": 120,
|
|
7
|
+
// display one line reference note
|
|
8
|
+
"display_one_line_reference_note": false,
|
|
9
|
+
// "fullcite", "cite"
|
|
10
|
+
"cite_flag_in_tex": "cite",
|
|
11
|
+
// true, false
|
|
12
|
+
"add_url_for_basic_dict": true,
|
|
13
|
+
// true, false
|
|
14
|
+
"add_anchor_for_basic_dict": false,
|
|
15
|
+
// true, false
|
|
16
|
+
"add_anchor_for_beauty_dict": false,
|
|
17
|
+
// true, false
|
|
18
|
+
"add_anchor_for_complex_dict": false,
|
|
19
|
+
// "\n" or "\n\n"
|
|
20
|
+
"details_to_bib_separator": "\n",
|
|
21
|
+
|
|
22
|
+
// for md file
|
|
23
|
+
// pyeasyphd/main/python_run_md.py
|
|
24
|
+
// default is ""
|
|
25
|
+
"final_output_main_md_name": "",
|
|
26
|
+
// true, false
|
|
27
|
+
"delete_temp_generate_md": true,
|
|
28
|
+
// add reference to markdown files
|
|
29
|
+
"add_reference_in_md": true,
|
|
30
|
+
// add bib to markdown files
|
|
31
|
+
"add_bib_in_md": false,
|
|
32
|
+
// true, false
|
|
33
|
+
"replace_cite_to_fullcite_in_md": false,
|
|
34
|
+
// basic, beauty, complex
|
|
35
|
+
"replace_by_basic_beauty_complex_in_md": "beauty",
|
|
36
|
+
// basic, beauty, complex
|
|
37
|
+
"display_basic_beauty_complex_references_in_md": "beauty",
|
|
38
|
+
// true, false
|
|
39
|
+
"add_anchor_in_md": false,
|
|
40
|
+
// "\n" or "\n\n"
|
|
41
|
+
// "details_to_bib_separator": "\n",
|
|
42
|
+
|
|
43
|
+
// for tex file
|
|
44
|
+
// pyeasyphd/main/python_run_tex.py
|
|
45
|
+
// handly preamble
|
|
46
|
+
"handly_preamble": false,
|
|
47
|
+
|
|
48
|
+
// default is ""
|
|
49
|
+
"final_output_main_tex_name": "",
|
|
50
|
+
// true, false
|
|
51
|
+
"run_latex": false,
|
|
52
|
+
// "pdflatex", "xelatex"
|
|
53
|
+
"pdflatex_xelatex": "xelatex",
|
|
54
|
+
// true, false
|
|
55
|
+
"delete_run_latex_cache": true,
|
|
56
|
+
"latex_clean_file_types": [
|
|
57
|
+
".aux", ".bbl", ".bcf", ".blg", ".fdb_latexmk", ".fls", ".log", ".out", ".run.xml", ".synctex.gz", ".gz",
|
|
58
|
+
".nav", ".snm", ".toc", ".xdv"
|
|
59
|
+
],
|
|
60
|
+
// true, false
|
|
61
|
+
"replace_duplicate_output_tex_file": false,
|
|
62
|
+
|
|
63
|
+
// pyeasyphd/tools/python_run_latex_md.py
|
|
64
|
+
// Path to bibliographic data, can be either a directory path or a specific file path
|
|
65
|
+
"bib_path_or_file": "",
|
|
66
|
+
|
|
67
|
+
// Path to the figures directory (must be a directory path, not a file)
|
|
68
|
+
"includegraphics_figs_directory": "",
|
|
69
|
+
// ture, false
|
|
70
|
+
"shutil_includegraphics_figs": true,
|
|
71
|
+
// ture, false
|
|
72
|
+
"includegraphics_figs_in_relative_path": true,
|
|
73
|
+
// figure postfixes
|
|
74
|
+
"includegraphics_figs_postfixes": ["eps", "jpg", "png", "svg", "psd", "raw", "jpeg", "pdf"],
|
|
75
|
+
|
|
76
|
+
// Path to the texes directory (must be a directory path, not a file)
|
|
77
|
+
"input_texs_directory": "",
|
|
78
|
+
// true, false
|
|
79
|
+
"shutil_input_texs": true,
|
|
80
|
+
// ture, false
|
|
81
|
+
"input_texs_in_relative_path": true,
|
|
82
|
+
// tex postfixes
|
|
83
|
+
"input_texs_postfixes": ["tex", "latex"],
|
|
84
|
+
|
|
85
|
+
// for fig, bib, tex, and md
|
|
86
|
+
"fig_folder_name": "figs", // "" or "fig" or "figs" or "main"
|
|
87
|
+
"bib_folder_name": "bibs", // "" or "bib" or "bibs" or "main"
|
|
88
|
+
"md_folder_name": "mds", // "" or "md" or "mds" or "main"
|
|
89
|
+
"tex_folder_name": "texs", // "" or "tex" or "texs" or "main"
|
|
90
|
+
|
|
91
|
+
// for delete original md, tex, and bib files in output folder
|
|
92
|
+
"delete_original_md_in_output_folder": false,
|
|
93
|
+
"delete_original_tex_in_output_folder": false,
|
|
94
|
+
"delete_original_bib_in_output_folder": false,
|
|
95
|
+
|
|
96
|
+
// true, false
|
|
97
|
+
"generate_html": false,
|
|
98
|
+
// true, false
|
|
99
|
+
"generate_tex": true,
|
|
100
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"run_article_md_daily_notes",
|
|
3
|
+
"run_article_tex_submit",
|
|
4
|
+
"run_beamer_tex_weekly_reports",
|
|
5
|
+
"run_search_for_screen",
|
|
6
|
+
"run_search_for_files",
|
|
7
|
+
"run_compare_after_search",
|
|
8
|
+
"run_generate_c_yearly",
|
|
9
|
+
"run_generate_j_e_weekly",
|
|
10
|
+
"run_generate_j_weekly",
|
|
11
|
+
"run_generate_j_monthly",
|
|
12
|
+
"run_generate_j_yearly",
|
|
13
|
+
# from pybibtexer
|
|
14
|
+
"run_compare_bib_with_local",
|
|
15
|
+
"run_compare_bib_with_zotero",
|
|
16
|
+
"run_format_bib_to_save_by_entry_type",
|
|
17
|
+
"run_format_bib_to_abbr_zotero_save",
|
|
18
|
+
"run_replace_to_standard_cite_keys",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
from .run_article_md import run_article_md_daily_notes
|
|
22
|
+
from .run_article_tex import run_article_tex_submit
|
|
23
|
+
from .run_beamer_tex import run_beamer_tex_weekly_reports
|
|
24
|
+
from .run_compare import run_compare_bib_with_local, run_compare_bib_with_zotero
|
|
25
|
+
from .run_format import run_format_bib_to_abbr_zotero_save, run_format_bib_to_save_by_entry_type
|
|
26
|
+
from .run_generate import (
|
|
27
|
+
run_generate_c_yearly,
|
|
28
|
+
run_generate_j_e_weekly,
|
|
29
|
+
run_generate_j_monthly,
|
|
30
|
+
run_generate_j_weekly,
|
|
31
|
+
run_generate_j_yearly,
|
|
32
|
+
)
|
|
33
|
+
from .run_replace import run_replace_to_standard_cite_keys
|
|
34
|
+
from .run_search import run_compare_after_search, run_search_for_files, run_search_for_screen
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def expand_path(path: str) -> str:
|
|
6
|
+
"""Expand user home directory and environment variables in path."""
|
|
7
|
+
return os.path.expandvars(os.path.expanduser(path))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def expand_paths(*paths):
|
|
11
|
+
# Expand and normalize file paths
|
|
12
|
+
return [expand_path(path) for path in paths]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def build_base_options(
|
|
16
|
+
include_publisher_list: list[str],
|
|
17
|
+
include_abbr_list: list[str],
|
|
18
|
+
exclude_publisher_list: list[str],
|
|
19
|
+
exclude_abbr_list: list[str],
|
|
20
|
+
path_conf_j_jsons: str,
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
"""Build options dictionary with common configuration.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
include_publisher_list: list of publishers to include
|
|
26
|
+
include_abbr_list: list of conference/journal abbreviations to include
|
|
27
|
+
exclude_publisher_list: list of publishers to exclude
|
|
28
|
+
exclude_abbr_list: list of conference/journal abbreviations to exclude
|
|
29
|
+
path_conf_j_jsons: Base path for conferences/journals JSON files
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
Dictionary containing configured options
|
|
33
|
+
"""
|
|
34
|
+
path_conf_j_jsons = expand_path(path_conf_j_jsons)
|
|
35
|
+
return {
|
|
36
|
+
"include_publisher_list": include_publisher_list,
|
|
37
|
+
"include_abbr_list": include_abbr_list,
|
|
38
|
+
"exclude_publisher_list": exclude_publisher_list,
|
|
39
|
+
"exclude_abbr_list": exclude_abbr_list,
|
|
40
|
+
"full_json_c": os.path.join(path_conf_j_jsons, "conferences.json"),
|
|
41
|
+
"full_json_j": os.path.join(path_conf_j_jsons, "journals.json"),
|
|
42
|
+
"full_json_k": os.path.join(path_conf_j_jsons, "keywords.json"),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def build_search_options(
|
|
47
|
+
print_on_screen: bool, search_year_list: list[str], keywords_type: str, keywords_list_list: list[list[str]]
|
|
48
|
+
) -> dict[str, Any]:
|
|
49
|
+
"""Build search options dictionary with common configuration.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
print_on_screen: Whether to display results on screen
|
|
53
|
+
search_year_list: list of years to filter search results
|
|
54
|
+
keywords_type: Category name for search keywords
|
|
55
|
+
keywords_list_list: Nested list of search keywords
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
Dictionary containing configured search options
|
|
59
|
+
"""
|
|
60
|
+
return {
|
|
61
|
+
"print_on_screen": print_on_screen,
|
|
62
|
+
"search_year_list": search_year_list,
|
|
63
|
+
"keywords_dict": {keywords_type: keywords_list_list},
|
|
64
|
+
"keywords_type_list": [keywords_type],
|
|
65
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from pyeasyphd.tools import PyRunBibMdTex
|
|
4
|
+
|
|
5
|
+
from ._base import expand_path
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def run_article_md_daily_notes(
|
|
9
|
+
path_input_file: str,
|
|
10
|
+
input_file_names: list[str],
|
|
11
|
+
path_output_file: str,
|
|
12
|
+
bib_path_or_file: str,
|
|
13
|
+
path_conf_j_jsons: str,
|
|
14
|
+
options: dict,
|
|
15
|
+
) -> None:
|
|
16
|
+
"""Run article markdown daily notes processing pipeline.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
path_input_file (str): Path to input files directory
|
|
20
|
+
input_file_names (list[str]): list of input file names
|
|
21
|
+
path_output_file (str): Path to output directory
|
|
22
|
+
bib_path_or_file (str): Path to bibliography file or directory
|
|
23
|
+
path_conf_j_jsons (str): Path to conferences and journals JSON files directory
|
|
24
|
+
options (dict): Additional options to override default settings
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
None
|
|
28
|
+
"""
|
|
29
|
+
path_input_file = expand_path(path_input_file)
|
|
30
|
+
path_output_file = expand_path(path_output_file)
|
|
31
|
+
|
|
32
|
+
# Initialize default options with detailed descriptions
|
|
33
|
+
_options = {
|
|
34
|
+
"full_json_c": expand_path(os.path.join(path_conf_j_jsons, "conferences.json")),
|
|
35
|
+
"full_json_j": expand_path(os.path.join(path_conf_j_jsons, "journals.json")),
|
|
36
|
+
# figure options
|
|
37
|
+
"includegraphics_figs_directory": "",
|
|
38
|
+
"shutil_includegraphics_figs": False,
|
|
39
|
+
"includegraphics_figs_in_relative_path": True,
|
|
40
|
+
"figure_folder_name": "figs", # "" or "figs" or "main"
|
|
41
|
+
# bib options
|
|
42
|
+
"is_standardize_bib": False, # default is True
|
|
43
|
+
"function_common_again": False, # default is True
|
|
44
|
+
"abbr_index_article_for_abbr": 1, # 0, 1, 2
|
|
45
|
+
"abbr_index_inproceedings_for_abbr": 2, # 0, 1, 2
|
|
46
|
+
"add_link_to_fields_for_abbr": ["title"], # None, or ["title", "journal", "booktitle"]
|
|
47
|
+
"maximum_authors_for_abbr": 0, # 0, 1, 2, ...
|
|
48
|
+
"add_index_to_entries": False,
|
|
49
|
+
"bib_name_for_abbr": "abbr.bib",
|
|
50
|
+
"bib_name_for_zotero": "zotero.bib",
|
|
51
|
+
"bib_name_for_save": "save.bib",
|
|
52
|
+
"bib_folder_name": "bibs", # "" or "bib" or "bibs" or "main"
|
|
53
|
+
"delete_original_bib_in_output_folder": True, # default is False
|
|
54
|
+
"bib_path_or_file": expand_path(bib_path_or_file),
|
|
55
|
+
# tex options
|
|
56
|
+
"handly_preamble": False,
|
|
57
|
+
"final_output_main_tex_name": "main.tex",
|
|
58
|
+
"run_latex": False,
|
|
59
|
+
"delete_run_latex_cache": False,
|
|
60
|
+
"input_texs_directory": "",
|
|
61
|
+
"shutil_input_texs": False, # True or False
|
|
62
|
+
"input_texs_in_relative_path": True,
|
|
63
|
+
"tex_folder_name": "texs", # "" or "tex" or "texs" or "main"
|
|
64
|
+
"delete_original_tex_in_output_folder": True, # default is False
|
|
65
|
+
"generate_tex": False,
|
|
66
|
+
# md options
|
|
67
|
+
# ["www", "google", "connected", "scite"]
|
|
68
|
+
"display_www_google_connected_scite": ["google", "connected"], # python_writers.py
|
|
69
|
+
"join_flag_in_http": " | ", # default is " | " or " |\n"
|
|
70
|
+
"add_url_for_basic_dict": False, # default is True
|
|
71
|
+
"add_anchor_for_basic_dict": True, # default is False
|
|
72
|
+
"add_anchor_for_beauty_dict": False, # default is False
|
|
73
|
+
"add_anchor_for_complex_dict": False, # default is False
|
|
74
|
+
"details_to_bib_separator": "\n\n", # defulat is "\n"
|
|
75
|
+
"final_output_main_md_name": "main.md",
|
|
76
|
+
"delete_temp_generate_md": True,
|
|
77
|
+
"add_reference_in_md": True,
|
|
78
|
+
"add_bib_in_md": False,
|
|
79
|
+
"replace_cite_to_fullcite_in_md": True,
|
|
80
|
+
"replace_by_basic_beauty_complex_in_md": "beauty", # default is "basic"
|
|
81
|
+
"display_basic_beauty_complex_references_in_md": "basic", # default is "beauty"
|
|
82
|
+
"add_anchor_in_md": True, # default is False
|
|
83
|
+
"md_folder_name": "mds", # "" or "md" or "main"
|
|
84
|
+
"delete_original_md_in_output_folder": True, # default is False
|
|
85
|
+
# html options
|
|
86
|
+
"generate_html": False,
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# Update with user-provided options
|
|
90
|
+
_options.update(options)
|
|
91
|
+
|
|
92
|
+
# Create full file paths from input file names
|
|
93
|
+
file_list = [os.path.join(path_input_file, f) for f in input_file_names]
|
|
94
|
+
|
|
95
|
+
# Generate output filenames based on input directory name (platform-independent)
|
|
96
|
+
dir_name = os.path.basename(os.path.dirname(file_list[0]))
|
|
97
|
+
_options.update({"final_output_main_tex_name": f"{dir_name}.tex", "final_output_main_md_name": f"{dir_name}.md"})
|
|
98
|
+
|
|
99
|
+
PyRunBibMdTex(path_output_file, ".md", "paper", _options).run_files(file_list, "", "current")
|
|
100
|
+
|
|
101
|
+
return None
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from pyadvtools import GitAutoCommitter
|
|
4
|
+
|
|
5
|
+
from pyeasyphd.tools import PyRunBibMdTex
|
|
6
|
+
|
|
7
|
+
from ._base import expand_path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def run_article_tex_submit(
|
|
11
|
+
path_input_file: str,
|
|
12
|
+
input_file_names: list[str],
|
|
13
|
+
path_output_file: str,
|
|
14
|
+
bib_path_or_file: str,
|
|
15
|
+
path_conf_j_jsons: str,
|
|
16
|
+
options: dict,
|
|
17
|
+
auto_git: bool = False,
|
|
18
|
+
remote: str = "origin",
|
|
19
|
+
branch: str = "master",
|
|
20
|
+
) -> None:
|
|
21
|
+
"""Process academic article files (TeX, and bibliography) with automated Git version control.
|
|
22
|
+
|
|
23
|
+
This function handles the conversion and processing of academic article files including TeX documents, and
|
|
24
|
+
bibliography management with automatic Git commit and push capabilities.
|
|
25
|
+
|
|
26
|
+
Note: The raw figures and TeX source files must be located in the data/raw subdirectory of the input path.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
path_input_file (str): Path to input files directory
|
|
30
|
+
input_file_names (list[str]): list of input file names
|
|
31
|
+
path_output_file (str): Path to output directory
|
|
32
|
+
bib_path_or_file (str): Path to bibliography file or directory
|
|
33
|
+
path_conf_j_jsons (str): Path to conferences and journals JSON files directory
|
|
34
|
+
options (dict): Additional options to override default settings
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
None
|
|
38
|
+
"""
|
|
39
|
+
path_input_file = expand_path(path_input_file)
|
|
40
|
+
path_output_file = expand_path(path_output_file)
|
|
41
|
+
|
|
42
|
+
# Initialize default options with detailed descriptions
|
|
43
|
+
_options = {
|
|
44
|
+
"full_json_c": expand_path(os.path.join(path_conf_j_jsons, "conferences.json")),
|
|
45
|
+
"full_json_j": expand_path(os.path.join(path_conf_j_jsons, "journals.json")),
|
|
46
|
+
# figure options
|
|
47
|
+
"includegraphics_figs_directory": "",
|
|
48
|
+
"shutil_includegraphics_figs": True,
|
|
49
|
+
"includegraphics_figs_in_relative_path": False, # default is True
|
|
50
|
+
"figure_folder_name": "figs", # "" or "figs" or "main"
|
|
51
|
+
# bib options
|
|
52
|
+
"is_standardize_bib": False, # default is True
|
|
53
|
+
"function_common_again": False, # default is True
|
|
54
|
+
"abbr_index_article_for_abbr": 1, # 0, 1, 2
|
|
55
|
+
"abbr_index_inproceedings_for_abbr": 0, # 0, 1, 2
|
|
56
|
+
"add_link_to_fields_for_abbr": None, # None, or ["title", "journal", "booktitle"]
|
|
57
|
+
"maximum_authors_for_abbr": 0, # 0, 1, 2, ...
|
|
58
|
+
"add_index_to_entries": False,
|
|
59
|
+
"bib_name_for_abbr": "abbr.bib",
|
|
60
|
+
"bib_name_for_zotero": "zotero.bib",
|
|
61
|
+
"bib_name_for_save": "save.bib",
|
|
62
|
+
"bib_folder_name": "bibs", # "" or "bib" or "bibs" or "main"
|
|
63
|
+
"delete_original_bib_in_output_folder": False,
|
|
64
|
+
"bib_path_or_file": expand_path(bib_path_or_file),
|
|
65
|
+
# tex options
|
|
66
|
+
"handly_preamble": True,
|
|
67
|
+
"final_output_main_tex_name": "main.tex",
|
|
68
|
+
"run_latex": False,
|
|
69
|
+
"delete_run_latex_cache": False,
|
|
70
|
+
"replace_duplicate_output_tex_file": True, # default is False
|
|
71
|
+
"input_texs_directory": "",
|
|
72
|
+
"shutil_input_texs": True,
|
|
73
|
+
"input_texs_in_relative_path": False, # default is True
|
|
74
|
+
"tex_folder_name": "texs", # "" or "tex" or "texs" or "main"
|
|
75
|
+
"delete_original_tex_in_output_folder": True,
|
|
76
|
+
"generate_tex": True,
|
|
77
|
+
# html options
|
|
78
|
+
"generate_html": False,
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# Update with user-provided options
|
|
82
|
+
_options.update(options)
|
|
83
|
+
|
|
84
|
+
# Create full file paths from input file names
|
|
85
|
+
file_list = [os.path.join(path_input_file, f) for f in input_file_names]
|
|
86
|
+
|
|
87
|
+
PyRunBibMdTex(path_output_file, ".tex", "paper", _options).run_files(file_list, "", "current")
|
|
88
|
+
|
|
89
|
+
if auto_git:
|
|
90
|
+
committer = GitAutoCommitter(path_output_file)
|
|
91
|
+
committer.auto_commit()
|
|
92
|
+
committer.auto_push(remote=remote, branch=branch)
|
|
93
|
+
|
|
94
|
+
return None
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from pyeasyphd.tools import PyRunBibMdTex
|
|
4
|
+
|
|
5
|
+
from ._base import expand_path
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def run_beamer_tex_weekly_reports(
|
|
9
|
+
path_input_file: str,
|
|
10
|
+
input_file_names: list[str],
|
|
11
|
+
path_output_file: str,
|
|
12
|
+
bib_path_or_file: str,
|
|
13
|
+
path_conf_j_jsons: str,
|
|
14
|
+
options: dict,
|
|
15
|
+
) -> None:
|
|
16
|
+
"""Process academic article files (TeX, and bibliography) with automated Git version control.
|
|
17
|
+
|
|
18
|
+
This function handles the conversion and processing of academic article files including TeX documents, and
|
|
19
|
+
bibliography management with automatic Git commit and push capabilities.
|
|
20
|
+
|
|
21
|
+
Note: The raw figures and TeX source files must be located in the data/raw subdirectory of the input path.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
path_input_file (str): Path to input files directory
|
|
25
|
+
input_file_names (list[str]): list of input file names
|
|
26
|
+
path_output_file (str): Path to output directory
|
|
27
|
+
bib_path_or_file (str): Path to bibliography file or directory
|
|
28
|
+
path_conf_j_jsons (str): Path to conferences and journals JSON files directory
|
|
29
|
+
options (dict): Additional options to override default settings
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
None
|
|
33
|
+
"""
|
|
34
|
+
path_input_file = expand_path(path_input_file)
|
|
35
|
+
path_output_file = expand_path(path_output_file)
|
|
36
|
+
|
|
37
|
+
# Initialize default options with detailed descriptions
|
|
38
|
+
_options = {
|
|
39
|
+
"full_json_c": expand_path(os.path.join(path_conf_j_jsons, "conferences.json")),
|
|
40
|
+
"full_json_j": expand_path(os.path.join(path_conf_j_jsons, "journals.json")),
|
|
41
|
+
# figure options
|
|
42
|
+
"includegraphics_figs_directory": "",
|
|
43
|
+
"shutil_includegraphics_figs": True,
|
|
44
|
+
"includegraphics_figs_in_relative_path": False, # default is True
|
|
45
|
+
"figure_folder_name": "figs", # "" or "figs" or "main"
|
|
46
|
+
# bib options
|
|
47
|
+
"is_standardize_bib": False, # default is True
|
|
48
|
+
"function_common_again": False, # default is True
|
|
49
|
+
"abbr_index_article_for_abbr": 1, # 0, 1, 2
|
|
50
|
+
"abbr_index_inproceedings_for_abbr": 0, # 0, 1, 2
|
|
51
|
+
"add_link_to_fields_for_abbr": None, # None, or ["title", "journal", "booktitle"]
|
|
52
|
+
"maximum_authors_for_abbr": 0, # 0, 1, 2, ...
|
|
53
|
+
"add_index_to_entries": False,
|
|
54
|
+
"bib_name_for_abbr": "abbr.bib",
|
|
55
|
+
"bib_name_for_zotero": "zotero.bib",
|
|
56
|
+
"bib_name_for_save": "save.bib",
|
|
57
|
+
"bib_folder_name": "bibs", # "" or "bib" or "bibs" or "main"
|
|
58
|
+
"delete_original_bib_in_output_folder": False,
|
|
59
|
+
"bib_path_or_file": expand_path(bib_path_or_file),
|
|
60
|
+
# tex options
|
|
61
|
+
"handly_preamble": True,
|
|
62
|
+
"final_output_main_tex_name": "main.tex",
|
|
63
|
+
"run_latex": False,
|
|
64
|
+
"delete_run_latex_cache": False,
|
|
65
|
+
"replace_duplicate_output_tex_file": False, # default is False
|
|
66
|
+
"input_texs_directory": "",
|
|
67
|
+
"shutil_input_texs": False, # default is True
|
|
68
|
+
"input_texs_in_relative_path": False, # default is True
|
|
69
|
+
"tex_folder_name": "texs", # "" or "tex" or "texs" or "main"
|
|
70
|
+
"delete_original_tex_in_output_folder": True, # default is False
|
|
71
|
+
"generate_tex": True,
|
|
72
|
+
# html options
|
|
73
|
+
"generate_html": False,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# Update with user-provided options
|
|
77
|
+
_options.update(options)
|
|
78
|
+
|
|
79
|
+
# Create full file paths from input file names
|
|
80
|
+
file_list = [os.path.join(path_input_file, f) for f in input_file_names]
|
|
81
|
+
|
|
82
|
+
PyRunBibMdTex(path_output_file, ".tex", "beamer", _options).run_files(file_list, "", "current")
|
|
83
|
+
|
|
84
|
+
return None
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from pybibtexer.tools import compare_bibs_with_local, compare_bibs_with_zotero
|
|
2
|
+
|
|
3
|
+
from ._base import build_base_options, expand_paths
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def run_compare_bib_with_local(
|
|
7
|
+
options: dict,
|
|
8
|
+
need_compare_bib: str,
|
|
9
|
+
path_output: str,
|
|
10
|
+
path_spidered_bibs: str,
|
|
11
|
+
path_spidering_bibs: str,
|
|
12
|
+
path_conf_j_jsons: str,
|
|
13
|
+
) -> None:
|
|
14
|
+
"""Compare a target bibliography file with local bibliography collections and generate comparison results.
|
|
15
|
+
|
|
16
|
+
This function performs a comprehensive comparison between a specified bibliography file and
|
|
17
|
+
existing local bibliography collections. Results are saved to the specified output directory.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
options: Configuration dictionary for comparison behavior settings
|
|
21
|
+
compare_each_entry_with_all_local_bibs: Whether to compare each entry with all local bib files
|
|
22
|
+
need_compare_bib: Path to the target bibliography file that needs to be compared
|
|
23
|
+
path_output: Output directory path where comparison results will be saved
|
|
24
|
+
path_spidered_bibs: Directory path containing pre-collected/spidered bibliography files
|
|
25
|
+
path_spidering_bibs: Directory path containing actively spidered bibliography files
|
|
26
|
+
path_conf_j_jsons: Path to conference/journal configuration JSON files
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
None: Results are written to files in the specified output directory
|
|
30
|
+
"""
|
|
31
|
+
# Expand and normalize file paths
|
|
32
|
+
need_compare_bib, path_output, path_spidered_bibs, path_spidering_bibs = expand_paths(
|
|
33
|
+
need_compare_bib, path_output, path_spidered_bibs, path_spidering_bibs
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Update options
|
|
37
|
+
options_ = build_base_options([], [], ["arXiv"], [], path_conf_j_jsons)
|
|
38
|
+
options_["include_early_access"] = True
|
|
39
|
+
options_.update(options)
|
|
40
|
+
|
|
41
|
+
# Compare
|
|
42
|
+
compare_bibs_with_local(need_compare_bib, path_spidered_bibs, path_spidering_bibs, path_output, options_)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def run_compare_bib_with_zotero(
|
|
46
|
+
options: dict, need_compare_bib: str, zotero_bib: str, path_output: str, path_conf_j_jsons: str
|
|
47
|
+
) -> None:
|
|
48
|
+
"""Compare a target bibliography file with Zotero bibliography data and generate comparison results.
|
|
49
|
+
|
|
50
|
+
This function performs comparison between a specified bibliography file and Zotero bibliography data,
|
|
51
|
+
identifying matches, differences, and potential conflicts between the two sources.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
options: Configuration dictionary for comparison behavior settings
|
|
55
|
+
need_compare_bib: Path to the target bibliography file that needs to be compared
|
|
56
|
+
zotero_bib: Path to the Zotero bibliography file or export data
|
|
57
|
+
path_output: Output directory path where comparison results will be saved
|
|
58
|
+
path_conf_j_jsons: Path to conference/journal configuration JSON files
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
None: Results are written to files in the specified output directory
|
|
62
|
+
"""
|
|
63
|
+
# Expand and normalize file paths
|
|
64
|
+
need_compare_bib, zotero_bib, path_output = expand_paths(need_compare_bib, zotero_bib, path_output)
|
|
65
|
+
|
|
66
|
+
# Update options
|
|
67
|
+
options_ = build_base_options([], [], ["arXiv"], [], path_conf_j_jsons)
|
|
68
|
+
options_.update(options)
|
|
69
|
+
|
|
70
|
+
# Compare
|
|
71
|
+
compare_bibs_with_zotero(zotero_bib, need_compare_bib, path_output, options_)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from pybibtexer.tools import format_bib_to_abbr_zotero_save_modes, format_bib_to_save_mode_by_entry_type
|
|
4
|
+
|
|
5
|
+
from ._base import build_base_options, expand_paths
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def run_format_bib_to_save_by_entry_type(
|
|
9
|
+
options: dict, need_format_bib: str, path_output: str, path_conf_j_jsons: str
|
|
10
|
+
) -> None:
|
|
11
|
+
"""Format a bibliography file by organizing entries according to their entry types and save the results.
|
|
12
|
+
|
|
13
|
+
This function processes a bibliography file and reorganizes the entries based on their
|
|
14
|
+
bibliographic entry types (e.g., article, conference, book, etc.), creating separate
|
|
15
|
+
organized output files for better management and categorization.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
options: Configuration dictionary for formatting behavior settings
|
|
19
|
+
need_format_bib: Path to the bibliography file that needs to be formatted
|
|
20
|
+
path_output: Output directory path where formatted bibliography files will be saved
|
|
21
|
+
path_conf_j_jsons: Path to conference/journal configuration JSON files
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
None: Formatted bibliography files are saved to the specified output directory
|
|
25
|
+
"""
|
|
26
|
+
# Expand and normalize file paths
|
|
27
|
+
need_format_bib, path_output = expand_paths(need_format_bib, path_output)
|
|
28
|
+
|
|
29
|
+
# Update options
|
|
30
|
+
options_ = build_base_options([], [], [], [], path_conf_j_jsons)
|
|
31
|
+
options_.update(options)
|
|
32
|
+
|
|
33
|
+
format_bib_to_save_mode_by_entry_type(Path(need_format_bib).stem, path_output, need_format_bib, options=options_)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def run_format_bib_to_abbr_zotero_save(
|
|
37
|
+
options: dict, need_format_bib: str, path_output: str, path_conf_j_jsons: str
|
|
38
|
+
) -> None:
|
|
39
|
+
"""Format a bibliography file into three different modes: abbreviated, Zotero-compatible, and cleaned source.
|
|
40
|
+
|
|
41
|
+
This function processes a bibliography file and generates three formatted versions:
|
|
42
|
+
1. Abbreviated version: Journal/conference names are abbreviated according to standard rules
|
|
43
|
+
2. Zotero-compatible version: Formatted specifically for Zotero reference management software
|
|
44
|
+
3. Source preservation version: Maintains original content with consistent formatting and organization
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
options: Configuration dictionary for formatting behavior settings
|
|
48
|
+
need_format_bib: Path to the bibliography file that needs to be formatted
|
|
49
|
+
path_output: Output directory path where the three formatted bibliography files will be saved
|
|
50
|
+
path_conf_j_jsons: Path to conference/journal configuration JSON files for abbreviation rules
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
None: Three formatted bibliography files are saved to the specified output directory
|
|
54
|
+
"""
|
|
55
|
+
# Expand and normalize file paths
|
|
56
|
+
need_format_bib, path_output = expand_paths(need_format_bib, path_output)
|
|
57
|
+
|
|
58
|
+
# Update options
|
|
59
|
+
options_ = build_base_options([], [], [], [], path_conf_j_jsons)
|
|
60
|
+
options_.update(options)
|
|
61
|
+
|
|
62
|
+
format_bib_to_abbr_zotero_save_modes(need_format_bib, path_output, options=options_)
|