-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding scripts to automatically update README.md with new version/release number and keep README.tex.md updated
- Loading branch information
1 parent
562d9ca
commit 13217b5
Showing
3 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
replace_patterns() { | ||
local file_path="$1" | ||
|
||
# Copy README.md to README.tex.md | ||
cp README.md "$file_path" | ||
|
||
# Read the contents of README.tex.md | ||
local content=$(<"$file_path") | ||
|
||
# Replace patterns | ||
content=$(echo "$content" | sed -E "s/<img src=\"(.*?)\" align=middle width=194.52263655pt height=46.976899200000005pt\/>/\$\\\\displaystyle\\\\dfrac{\\\\text{price}_{t_i} - \\\\text{price}_{t_0} + \\\\text{dividend}}{\\\\text{price}_{t_0}}\$/") | ||
|
||
content=$(echo "$content" | sed -E "s/<img src=\"(.*?)\" align=middle width=126.07712039999997pt height=48.84266309999997pt\/>/\$\\\\displaystyle\\\\dfrac{\\\\text{price}_{t_i} - \\\\text{price}_{t_{i-1}}}{\\\\text{price}_{t_{i-1}}}\$/") | ||
|
||
content=$(echo "$content" | sed -E "s/<img src=\"(.*?)\" align=middle width=208.3327686pt height=57.53473439999999pt\/>/\$\\\\displaystyle\\\\log\\\\left(1 + \\\\dfrac{\\\\text{price}_{t_i} - \\\\text{price}_{t_{i-1}}}{\\\\text{price}_{t_{i-1}}}\\\\right)\$/") | ||
|
||
# Write the updated contents back to README.tex.md | ||
echo "$content" > "$file_path" | ||
} | ||
|
||
# Specify the file path for README.tex.md | ||
tex_file_path="README.tex.md" | ||
|
||
# Call the function to perform the replacements | ||
replace_patterns "$tex_file_path" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters