- 2023-05-02 - Since a few days ago
\colorbox
and\fcolorbox
are broken and Github did't talk about if it's a temporary thing or if it will not be added back.- 2024-01-04 - Since it has not being added back I deduce that it will never be so I removed all mentions to it on the rest of the gist.
- 2023-09-29 - Tex seems to not work on h1 to h6 anymore (markdown
#
's)- 2024-01-04 - Now it works again, I'll keep the message for a while to remember that it may change again in the future
As you can se with the above message(s) Tex may not be very stable and may not be an option to you as of the dates expressed above. You can also check other tex problems here.
*You can use Tex to produce colors, but the real objective of it is to write math so it is more of a workaround that works good enough.
gist
and on the actual markdown of README's on github or the markdown of issues, etc.
- Warnings & Notes
-
Learn Tex basic syntax
$\to$ Text in Tex
$\to$ Font Styles
$\to$ Colors
$\diamond$ Color examples table
$\to$ Font Sizes -
Tex limitations
$\to$ It isn't selectable
$\to$ Causes text overflow
$\to$ Don't work inside link tags
$\to$ Are not yet added to the mobile app markdown
$\to$ Some words don't work on it - Useful links
To do the warning and note on the github markdown
is that way:
__Warning__
__Note__
Warning Note
On the gist
markdown you need to use the Tex syntax this way:
$\color{#D29922}\textsf{\Large\⚠\kern{0.2cm}\normalsize Warning}$
$\color{#58A6FF}\textsf{\Large\ⓘ\kern{0.2cm}\normalsize Note}$
To learn the syntax of Tex
you can look at the Katex
docs, you can also check the sorted docs.
Katex
are not exacly Tex
, but their docs are very well made and easy to understand, also most features of one are in the other. And the syntax is the same.
To start writting with Tex syntax you need to use $
at the start and end of the text. $foo$
.
$foo$
If you want to centralize you can put 2 $
. $$foo$$
is a centralized text.
$$foo$$
I prefer to write text in tex using the \text{foo}
but you have other ways to do it as you can see bellow.
$lorem ipsum dolor sit amet$
$\text lorem ipsum dolor sit amet$
$\text{lorem ipsum dolor sit amet}$
$lorem\ ipsum\ dolor\ sit\ amet$
$\text lorem\ ipsum\ dolor\ sit\ amet$
To change the font style you need to add suffixes to the \text
.
suffix | syntax | command | result |
---|---|---|---|
none |
\text |
$\text{lorem ipsum}$ |
|
\rm |
\textrm |
$\textrm{lorem ipsum}$ |
|
\sf |
\textsf |
$\textsf{lorem ipsum}$ |
|
\bf |
\textbf |
$\textbf{lorem ipsum}$ |
|
\up |
\textup |
$\textup{lorem ipsum}$ |
|
\tt |
\texttt |
$\texttt{lorem ipsum}$ |
|
\it |
\textit |
$\textit{lorem ipsum}$ |
To use colors you can use \color
or \textcolor
.
command | result |
---|---|
$\color{red}{\textsf{lorem ipsum}}$ |
|
$\color{#f00}{\textsf{lorem ipsum}}$ |
|
$\color{rgb(255,0,0)}{\textsf{lorem ipsum}}$ |
|
$\color{rgba(255,0,0, 0.4)}{\textsf{lorem ipsum}}$ |
|
$\color{hsl(0,100%,50%)}{\textsf{lorem ipsum}}$ |
|
$\color{hsla(0,100%,50%, 0.4)}{\textsf{lorem ipsum}}$ |
|
$\textcolor{red}{\textsf{lorem ipsum}}$ |
command | result |
---|---|
$\Huge{\textsf{lorem ipsum}}$ |
|
$\huge{\textsf{lorem ipsum}}$ |
|
$\LARGE{\textsf{lorem ipsum}}$ |
|
$\Large{\textsf{lorem ipsum}}$ |
|
$\large{\textsf{lorem ipsum}}$ |
|
$\normalsize{\textsf{lorem ipsum}}$ |
|
$\small{\textsf{lorem ipsum}}$ |
|
$\scriptsize{\textsf{lorem ipsum}}$ |
|
$\tiny{\textsf{lorem ipsum}}$ |
The problem with writting using tex is that tex texts are not searchable (not indexed) nor selectable as you can see with the text above witten with Tex. (You can copy the Tex Commands
with the right button of the mouse, but it isn't as good as it could be.)
You should't write too many characters per line (at least as of today (2023-04-02)) or it'll overflow creating an horizontal scroll as you can see opening the details below.
Example of Tex breaking creating a horizontal bar
AS you can see, $Tex breaks inside links$ too. (using []()
here)
Tex is still out of the mobile app markdown (2023-04-02)
As of today this is the list of known words that don't work inside tex:
-
select
- $select$ -$\textsf{s.elect}$ -
begin
- $begin$ -$\textsf{b.egin}$
I tested a few SQL related words and select
is the only that I found that broke Tex, dunno if the reason for it to not work is not SQL related.
Not entirely accurate but this colorbox change basically changed my stuff that essentially looked something like this before, before GitHub broke colorbox for whatever crazy reason, with the colorbox now manually changed to just color and fbox, so not exactly how it used to appear but close to it, so it went from looking somewhat like this:
To now looking like this...:
Like why...? I just don't understand this, my only way to use colour and make certain projects look better, to me personally anyway, and they just break the only thing we have to circumvent this non-colour bollocks.... Just why...