Closed ChasingZenith closed 2 years ago
I even find that if I do am more aggressive than the pull request and do
\newcommand{\col}[2]{~~~<span style="color:~~~#1~~~">~~~#2~~~</span>~~~}
and
\newcommand{\arxivcolor}{#b31b1b}
I can use
\color{\arxivcolor}{something}
Cool yes that's better, thanks!
For your information, the !
is just a whitespace controller and here in HTML has no effect (both would have lead to an identical result). There's an explanation here: https://franklinjl.org/syntax/divs-commands/#whitespaces 🙂
Thank you. I do some more tests. I think that the current version is still not that good.
It seems that one relevant case is A\color{red}{B}
.
The current version will give A B
with an unwanted space in the middle.
It seems that in this whitespace-sensitive case, #2
is should be turned into !#2
I would like to change it into
\newcommand{\col}[2]{~~~<span style="color:~~~#1~~~">~~~!#2~~~</span>~~~}
I will make a new pull request now to fix this problem and use the aggressive version mentioned above.
HTML is insensitive to whitespace so this makes no difference :-)
you can test for yourself have a HTML page with <p> A B </p>
or <p>A B</p>
it will give exactly the same thing
https://www.w3schools.com/code/tryit.asp?filename=GUITAADMCV2X
PS: ah ok you mean when mixing markdown and HTML, then yes.
Originally
\col{GD update $x_{t+1} = x_t - \alpha \nabla f(x_t)$
look like thiskatex rendering is blocked.
what I did
I turn
\newcommand{\col}[2]{~~~<span style="color:#1">#2</span>~~~}
into\newcommand{\col}[2]{~~~<span style="color:#1">~~~#2~~~</span>~~~}
Now
This is much more useful and friendly to LaTeX users.
I am not quite sure whether I am doing it right since I don't fully understand the difference between
#1
and!#1
.