You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,7 +10,7 @@ Renders LaTeX for Github Readmes
10
10
----------------------------------------
11
11
12
12
`readme2tex` is a Python script that "texifies" your readme. It takes in Github Markdown and
13
-
replaces anything enclosed between dollar signs with rendered <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/c068b57af6b6fa949824f73dcb828783.svg?invert_in_darkmode"align=middlewidth=42.058005ptheight=22.40667pt/>.
13
+
replaces anything enclosed between dollar signs with rendered <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/c068b57af6b6fa949824f73dcb828783.svg?invert_in_darkmode"align=middlewidth=42.058004999999994ptheight=22.40667000000001pt/>.
14
14
15
15
In addition, unlike the other Github TeX renderers, `readme2tex` ensures that inline mathematical expressions
16
16
are properly aligned with the rest of the text to avoid giving a "jumpy" look to the document.
@@ -56,7 +56,7 @@ of what you can do in `readme2tex`.
The code that was used to render this equation is just
62
62
@@ -68,20 +68,20 @@ The code that was used to render this equation is just
68
68
69
69
Here's an inline equation.
70
70
71
-
> It is well known that if <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/162f63774d8a882cc15ae1301cfd8ac0.svg?invert_in_darkmode"align=middlewidth=119.011695ptheight=26.70624pt/>, then <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/584fa2612b78129d140fb208e9d76ae9.svg?invert_in_darkmode"align=middlewidth=112.358235ptheight=33.20526pt/>.
71
+
> It is well known that if <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/162f63774d8a882cc15ae1301cfd8ac0.svg?invert_in_darkmode"align=middlewidth=119.01169499999999ptheight=26.70624000000001pt/>, then <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/584fa2612b78129d140fb208e9d76ae9.svg?invert_in_darkmode"align=middlewidth=112.358235ptheight=33.20525999999999pt/>.
72
72
73
73
The code that was used to render this is:
74
74
75
75
It is well known that if $ax^2 + bx + c = 0$, then $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
76
76
77
77
Notice that the equations line up with the baseline of the text, even when the height of these two images are different.
78
78
79
-
Sometimes, you might run into equations that are bottom-heavy, like <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/4cb4ead947a07837121937c807973436.svg?invert_in_darkmode"align=middlewidth=47.63913ptheight=37.03227pt/>. Here, `readme2tex`
79
+
Sometimes, you might run into equations that are bottom-heavy, like <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/4cb4ead947a07837121937c807973436.svg?invert_in_darkmode"align=middlewidth=47.639129999999994ptheight=37.03226999999998pt/>. Here, `readme2tex`
80
80
can compute the correct offset to align this equation to the baseline of your paragraph of text as well.
81
81
82
82
#### Tikz (Courtesy of http://www.texample.net/)
83
83
84
-
Did you notice the picture at the top of this page? That was also generated by <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/c068b57af6b6fa949824f73dcb828783.svg?invert_in_darkmode"align=middlewidth=42.058005ptheight=22.40667pt/>. `readme2tex` is capable of
84
+
Did you notice the picture at the top of this page? That was also generated by <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/c068b57af6b6fa949824f73dcb828783.svg?invert_in_darkmode"align=middlewidth=42.058004999999994ptheight=22.40667000000001pt/>. `readme2tex` is capable of
@@ -126,18 +126,17 @@ In addition, you can specify other arguments to `render.py`, such as:
126
126
127
127
*`--readme READOTHER.md` The raw readme to process. Defaults to `READOTHER.md`.
128
128
*`--output README.md` The processed readme.md file. Defaults to `README_GH.md`.
129
-
*`--usepackage tikz` Addition packages to use during <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/c068b57af6b6fa949824f73dcb828783.svg?invert_in_darkmode"align=middlewidth=42.058005ptheight=22.40667pt/> compilation. You can specify this multiple times.
129
+
*`--usepackage tikz` Addition packages to use during <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/c068b57af6b6fa949824f73dcb828783.svg?invert_in_darkmode"align=middlewidth=42.058004999999994ptheight=22.40667000000001pt/> compilation. You can specify this multiple times.
130
130
*`--svgdir svgs/` The directory to store the output svgs. The default is `svgs/`
131
131
*`--branch master`*Experimental* Which branch to store the svgs into, the default is just master.
132
132
*`--username username` Your github username. This is optional, and `render.py` will try to infer this for you.
133
133
*`--project project` The current github project. This is also optional.
134
134
*`--nocdn` Ticking this will use relative paths for the output images. Defaults to False.
135
135
*`--htmlize` Ticking this will output a `md.html` file so you can preview what the output looks like. Defaults to False.
136
136
*`--valign` Ticking this will use the `valign` trick (detailed below) instead. See the caveats section for tradeoffs.
137
-
*`--rerender` Ticking this will force a recompilation of all <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/c068b57af6b6fa949824f73dcb828783.svg?invert_in_darkmode"align=middlewidth=42.058005ptheight=22.40667pt/> equations even if they are already cached.
137
+
*`--rerender` Ticking this will force a recompilation of all <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/c068b57af6b6fa949824f73dcb828783.svg?invert_in_darkmode"align=middlewidth=42.058004999999994ptheight=22.40667000000001pt/> equations even if they are already cached.
138
138
*`--bustcache` Ticking this will ensure that Github renews its image cache. Github may sometimes take up to an hour for changed images to reappear. This is usually not necessary unless you've made stylistic changes.
139
139
*`--add-git-hook` Ticking this will generate a post-commit hook for git that runs readme2tex with the rest of the specified arguments after each `git commit`.
140
-
*`--generate-script script.sh` Generates the above script, but at `script.sh`.
141
140
142
141
My usual workflow is to create a secondary branch just for the compiled svgs. You can accomplish this via
143
142
@@ -167,7 +166,7 @@ is the exact middle of the image. For IE and Edge however, the center is about 5
167
166
above the exact center. Since this looks great for non-IE browsers, and reasonably good on Edge, this is the default
168
167
rendering method. The trick here is to pad either the top or the bottom of the image with extra spaces until the
169
168
baseline of the equation is at the center. For most equations, this works great. However, if you have a tall equation,
170
-
like <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/bdd0f9b91b7fff7fe5a2b1b7684a96ef.svg?invert_in_darkmode"align=middlewidth=56.166495ptheight=71.68986pt/>, you'll notice that there might be a lot
169
+
like <imgsrc="https://rawgit.com/leegao/readme2tex/svgs/svgs/bdd0f9b91b7fff7fe5a2b1b7684a96ef.svg?invert_in_darkmode"align=middlewidth=56.166495ptheight=71.68985999999998pt/>, you'll notice that there might be a lot
171
170
of slack vertical spacing between these lines. If this is a deal-breaker for you, you can always try the `--valign True`
172
171
mode. For most inline equations, this is usually a non-issue.
Copy file name to clipboardExpand all lines: READOTHER.md
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -261,7 +261,6 @@ In addition, you can specify other arguments to `render.py`, such as:
261
261
*`--rerender` Ticking this will force a recompilation of all $\text{\LaTeX}$ equations even if they are already cached.
262
262
*`--bustcache` Ticking this will ensure that Github renews its image cache. Github may sometimes take up to an hour for changed images to reappear. This is usually not necessary unless you've made stylistic changes.
263
263
*`--add-git-hook` Ticking this will generate a post-commit hook for git that runs readme2tex with the rest of the specified arguments after each `git commit`.
264
-
*`--generate-script script.sh` Generates the above script, but at `script.sh`.
265
264
266
265
My usual workflow is to create a secondary branch just for the compiled svgs. You can accomplish this via
0 commit comments