Converted Files cause LaTeX to behave oddly.

Using the command Upload all shared notes, to load everything into github with the following configuration (attached), LaTeX tends to act oddly. First, Github seems it will parse equations surrounded by $$ fine, but will be aligned to the left instead of front and center like it should. Second, Github seems to NOT parse equations surrounded by $$ when using \begin{align} and \end{align} within it to align a multi-line equation. This is shown on the two screenshots that follow, one that shows the preview and one that shows the code. I don't exactly know if it's a problem of a wrong setting, or if it's a setting that needs to be added to accommodate the way Github seems to do markdown. Thank you for any responses!
12 Replies
Mara
Mara2mo ago
Nor related with Publisher nor Obsidian, sorry
qm
qmOP2mo ago
I mean, obviously its not Enveloppe that's specifically causing the problem, it's github. But the plugin was developed to get around the way github's markdown parses stuff and change it in the process right? I was wondering if there was a way to use the plugin to possibly add those line gaps automatically, because adding them in Obsidian makes the whole thing look double spaced (ugly). I tried using the Text replacer for this, to see if I could get it to make:
blah blah
$$
\begin{align}
\end{align}
$$
blah blah
$$
\begin{align}
\end{align}
$$
into
blah blah

$$

\begin{align}
\end{align}

$$
blah blah

$$

\begin{align}
\end{align}

$$
AKA, adding a line gap before and after it (since it's the same set of symbols on the top and bottom). But alas, the text box for it is only 1 line instead of multiple. Apologies if I'm out of line with pushing the issue further, Enveloppe is the only thing I can find right now that (for the most part) converts ObsidianMD to GithubMD without a lot of pain. okay im dumb, regex does let me do this (for the most part) now it's just debugging my complete lack of regex knowledge oh hey same problem... #How to replace text with newline?
qm
qmOP2mo ago
maybe that's why its not working?
No description
No description
qm
qmOP2mo ago
oh wait, i forgot to rever it back to before testing nonetheless, it does the same thing even with \r before the \n okay well, i dont know enough regex to understand your work around you mentioned in the other thread, but i wont ping you, assuming it's about 2am for you rn. hope i can get some clarification in the morning/when you are free! thank you again!
Mara
Mara2mo ago
Did you try the regex on regex101?
qm
qmOP2mo ago
I did, the output should be right, but it dont do nun
Mara
Mara2mo ago
Did you set ECMAScript? By any chance can you send me as text the regex? I can look Btw, chatgpt is pretty good for regex
qm
qmOP2mo ago
set ECMAScript? idk what that is 😭
qm
qmOP2mo ago
uhm... sure. i can even send you the md file if you'd like- here:
<h3>Ions</h3>
The atoms in a stable compound have a <u>noble gas</u> election configuration.
Ionic compounds are assumed to be in the solid state unless otherwise noted.
When <u>two nonmetals</u> react to form a <u>covalent bond</u>, they <u>share</u> elections in a way that completes the valence election configuration of both atoms.
When a nonmetal and a main group metal react to form a binary ionic compound, the ions form so that the <u>nonmetal</u> achieves the electron configuration of the <u>next noble gas atom</u>, and the <u>valence orbitals</u> of <u>the metal are emptied</u>.
- Nonmetals will gain $e^-$
- Metals will lose $e^-$

What ionic compound will form between calcium and oxygen?
- Let's consider their election configurations:
$$
\begin{align}
Ca: [AR]\;4s^2 \hspace{25pt} Ca^{2+}:[AR] \\
O: [He]\;2s^22p^4 \hspace{25pt} O^{2-}:[HE]\;2s^22p^6
\end{align}
$$
- What would the chemical equation of election transfer be?
$$Ca + O \rightarrow Ca^{2+}+O^{2-}$$
- What is the ionic compound formula?
$$Ca^{2+}\;O^{2-} \rightarrow CaO$$

Groups 1A, 2A and 3A cation charge:
- Positive charge equal to their group number except for $H$.
Groups 5A, 6A, and 7A anion charge:
- Negative charge equal to $8$ - Group #.
There are some exceptions though:
- Tin: $Sn^{2+}$ and $Sn^{4+}$
- Lead: $Pb^{2+}$ and $Pb^{4+}$
- Bismuth: $B^{3+}$ and $B^{5+}$
- Thallium: $Tl^{+}$ and $Tl^{3+}$
<h3>Ions</h3>
The atoms in a stable compound have a <u>noble gas</u> election configuration.
Ionic compounds are assumed to be in the solid state unless otherwise noted.
When <u>two nonmetals</u> react to form a <u>covalent bond</u>, they <u>share</u> elections in a way that completes the valence election configuration of both atoms.
When a nonmetal and a main group metal react to form a binary ionic compound, the ions form so that the <u>nonmetal</u> achieves the electron configuration of the <u>next noble gas atom</u>, and the <u>valence orbitals</u> of <u>the metal are emptied</u>.
- Nonmetals will gain $e^-$
- Metals will lose $e^-$

What ionic compound will form between calcium and oxygen?
- Let's consider their election configurations:
$$
\begin{align}
Ca: [AR]\;4s^2 \hspace{25pt} Ca^{2+}:[AR] \\
O: [He]\;2s^22p^4 \hspace{25pt} O^{2-}:[HE]\;2s^22p^6
\end{align}
$$
- What would the chemical equation of election transfer be?
$$Ca + O \rightarrow Ca^{2+}+O^{2-}$$
- What is the ionic compound formula?
$$Ca^{2+}\;O^{2-} \rightarrow CaO$$

Groups 1A, 2A and 3A cation charge:
- Positive charge equal to their group number except for $H$.
Groups 5A, 6A, and 7A anion charge:
- Negative charge equal to $8$ - Group #.
There are some exceptions though:
- Tin: $Sn^{2+}$ and $Sn^{4+}$
- Lead: $Pb^{2+}$ and $Pb^{4+}$
- Bismuth: $B^{3+}$ and $B^{5+}$
- Thallium: $Tl^{+}$ and $Tl^{3+}$
qm
qmOP2mo ago
oh crap, i think that one pinged you, i did NOT mean to do that, im sorry 😭 i tried chatgpt for a new set of regex, it gave me: look for: (?<!\n)\$\$(.*?)\$\$(?!\n) return: \n$$\1$$\n so instead of looking for specifically the $$ with the \begin{align} after it (on the next line) and \end{align} before it, it would just look for any set of $$, ingore anything between them, and so long as they didnt have a linebreak before or after, it would give one 🤔 though... maybe it should be an "if they have a line break already, still mark it as okay" to let it go. either way, i was unsuccessful getting that to work. i've found getting obsidianmd to github is way more stupidly complex that i originally thought. even the way it handles linebreaks and bullet points and such. i've kinda started looking into Quartz to host a static site on github pages with the exact (almost) same parser that obsidian uses, or at least handle the display of markdown files the same way
Mara
Mara2mo ago
Yeah, GFM can be a bit complex... That's why I use quartz xD

Did you find this page helpful?