| 
 | 1 | +---  | 
 | 2 | +title: 'About LaTeX, Modes, and Mathtext'  | 
 | 3 | +excerpt: 'This blog is a textual reference to help document what I learned about LaTeX and the mechanics of its implementation.'  | 
 | 4 | +coverImage: 'http://localhost:3000/website/assets/blog/latex_1/cover.png'  | 
 | 5 | +date: '2023-08-12T15:21:32.163Z'  | 
 | 6 | +author:  | 
 | 7 | +  name: devrd  | 
 | 8 | +  picture: '/assets/blog/authors/myAvatar.png'  | 
 | 9 | +ogImage:  | 
 | 10 | +  url: 'http://localhost:3000/website/assets/blog/latex_1/cover.png'  | 
 | 11 | +---  | 
 | 12 | + | 
 | 13 | +## **LaTeX: Yes, the one used in _typesetting_ [Part - I]**  | 
 | 14 | + | 
 | 15 | +A significant usage of LaTeX is its ability to handle complex mathematical expressions and keep user-friendliness in mind, primarily combining the simplest of formulas to build a more intricate one. We will discuss how LaTeX typesets math formulas and mathematical fonts.   | 
 | 16 | + | 
 | 17 | +TeX can tap into 6 modes: the Vertical Mode, Internal Vertical Mode, Horizontal Mode, Restricted Horizontal Mode, Math Mode, and Display Math Mode. We will come across this along the way of discussing math  | 
 | 18 | + | 
 | 19 | +In math mode, (fun fact $$ is used as math brackets because typesetting math is supposedly expensive) TeX creates math lists that are composed of the following types of things:  | 
 | 20 | +* An atom   | 
 | 21 | +* A horizontal or a vertical material (check) (\hbox, \vadjust{kern1pt})  | 
 | 22 | +* A glob of Glue (\hskip, \mskip)  | 
 | 23 | +* Kern (\kern)  | 
 | 24 | +* A style change (\displaystyle, \scriptstyle)  | 
 | 25 | +* Generalized fraction (\above, \over)  | 
 | 26 | +* Boundary (\left, \right)  | 
 | 27 | +* A four-way choice (\mathchoice)  | 
 | 28 | + | 
 | 29 | + | 
 | 30 | +The most important items are called atoms, and they have three parts: a nucleus, a  | 
 | 31 | +superscript, and a subscript. In TeX, atoms can be one of 13 different types, Ord (ordinary like ‘x’), Op (large operator like summation in the figure below), Bin (binary operator ‘+’), Rel (relational operator ‘=’), Open ‘(’, Close ‘)’, Punctuation, Inner (12), Over (a), Under (a), Accented (à), Radical (√2), \Vcent (Vbox to be centered).  | 
 | 32 | + | 
 | 33 | + | 
 | 34 | +#### **Boxes, dimensions, and glue**   | 
 | 35 | + | 
 | 36 | +<div style="display: flex;">  | 
 | 37 | +  <p>  | 
 | 38 | +   Boxes are two-dimensional rectangles with mainly 3 associated measurements, height, width, and depth. Basically, everything gets constructed nimbly by gluing these rectangles together. The TeX boxes come with a baseline which is also the reference point in aligning the characters used in the text. These dimensions vary across different fonts. Some of the symbols, however, extend beyond these measurements in special cases like using an italic font or a big operator. We can also use black boxes (◼) in TeX which are used to create horizontal or vertical lines, notably known as ‘\hrule’ or ‘\vrule’.  | 
 | 39 | + | 
 | 40 | +  </p>  | 
 | 41 | +  <img src="http://localhost:3000/website/assets/blog/latex_1/baseline.png" width="250" height="250"/>  | 
 | 42 | +</div>  | 
 | 43 | + | 
 | 44 | +<div style="display: flex;">  | 
 | 45 | +  <img src="http://localhost:3000/website/assets/blog/latex_1/baseline_eg.png" width="300" height="250"/>  | 
 | 46 | +  <p>  | 
 | 47 | +------ Placeholder text:------The TeX boxes come with a baseline which is also the reference point in aligning the characters used in the text. These dimensions vary across different fonts. Some of the symbols, however, extend beyond these measurements in special cases like using an italic font or a big operator. We can also use black boxes (◼) in TeX which are used to create horizontal or vertical lines, notably known as ‘\hrule’ or ‘\vrule’.  | 
 | 48 | +  </p>  | 
 | 49 | +</div>  | 
 | 50 | + | 
 | 51 | +When typesetting any formula, we wrap the appropriate characters in a box derived from its font dimensions using the ‘\hbox’ command, and eventually the individual horizontal boxes are wrapped in a ‘\vbox’ command to create a vertical box. In TeX’s view, two lines of text would look like this:  | 
 | 52 | + | 
 | 53 | +<div style="text-align: center">  | 
 | 54 | +  <img src="http://localhost:3000/website/assets/blog/latex_1/boxes.png" width="750" height="250"/>  | 
 | 55 | +</div>  | 
 | 56 | + | 
 | 57 | +Like every crafting project, TeX also uses glue to paste these boxes together. In simpler terms, words and lines are glued together to maintain cleanliness and alignment. Glue also comes with its own attributes which are construed as its own space, the ability to stretch, and the ability to shrink. To determine the thickness of the glue, TeX has its own formula to set the stretchability and shrinkability. (Commands used to set glue: \vskip, \hskip, \vfill, \hfill)  | 
0 commit comments