Coding/LaTex

【LaTex】 How to set-up LaTex in Tistory Blog

goliny 2020. 6. 22. 14:22

SET-UP

LaTex is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. Because this blog mainly deals with quantitative analysis, we will inevitably be dealing with mathematical notations and formula.

For mathematical notations, we will use a javascript library called "Mathjax". In order to utilize this library in Tistory environment,a few lines need to be added in the html editor.

 

 

Skin Editor Menu

 

 

 

Then, select thebutton on the right panel.

 

 

 

html Editor Button

 

 

 

We then insert the following code in between the body tags.

 

<body>
  <script type="text/x-mathjax-config"> 
      MathJax.Hub.Config({ 
          tex2jax: { 
              inlineMath: [ ['$','$'], ["\\(","\\)"] ], 
              processEscapes: true 
          } 
      }); 
   </script> 
   <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML'></script>
</body>

The first script tag applies the inline mathematical notations; second script tag calls Mathjax javascript file.

 

APPLICATION

 

 

Code Block

 

Code block can be written as below:

$$
9\times9
$$

 

 

Output

$$
9\times9
$$

 

 

Inline Codes

 

In order to insert the notions in between texts, you can wrap the texts with "$" signs.

Apple $2^{x\times y}$ Banana

 

 

Output

Apple $2^{x\times y}$ Banana