Correct font for subroutines in Latex

Today I learned that Latex supports many different typefaces: https://www.overleaf.com/learn/latex/font_typefaces and http://www.personal.ceu.hu/tex/typeface.htm I’ve seen papers like this one (https://arxiv.org/pdf/2006.15704.pdf) uses a different font for subroutines (like function names or APIs). One example is from their reference to the “CrossEntropyLoss” function: Now, I try by myself different typefaces and see which one it uses: I think …

“file pdftex.def” not found on Mac OS

After installing MacTex, I still encountered “File pdftex.def not found” error when compiling a tex file in TexMaker/TexShop. Here is the way to solve it: Download from pdfetx-def package from https://www.ctan.org/pkg/pdftex-def Unzip Copy the unzipped folder to the texlive installation directory. Below is what I used:  sudo cp -R graphics-def /usr/local/texlive/2016/texmf-dist/  

How to to write multi-lined subscript in latex?

In latex, what is the best way to write multi-lined formula in subscript? Use `\atop`! For example, \begin{align*} P(M_n=1) =\sigma(&w_s(\sum\limits_{j_r \in T_{nr}}\vec{U_{j_r}} \cdot \vec{C_{j_r}} – \sum\limits_{j_b \in T_{nb}}\vec{U_{j_b}} \cdot \vec{C_{j_b}} ) + \\ &w_b(\sum\limits_{j_{r_1}, j_{r_2} \in T_{nr} \atop j_{r_1} \neq j_{r_2} }\left\Vert\vec{C_{j_{r_1}}} – \vec{C_{j_{r_2}}}\right\Vert^2 – \sum\limits_{j_{b_1}, j_{b_2} \in T_{nb} \atop j_{b_1} \neq j_{b_2} }\left\Vert\vec{C_{j_{b_1}}} – …

How to write multi-lined formula?

In latex, what is the best way to write multi-lined formula? Actually, the `begin/end{align*}` block supports `\\\` in it. For example, \begin{align*} P(M_n=1) =\sigma(&w_s(\sum\limits_{j_r \in T_{nr}}\vec{U_{j_r}} \cdot \vec{C_{j_r}} – \sum\limits_{j_b \in T_{nb}}\vec{U_{j_b}} \cdot \vec{C_{j_b}} ) + \\ &w_b(\sum\limits_{j_{r_1}, j_{r_2} \in T_{nr} \atop j_{r_1} \neq j_{r_2} }\left\Vert\vec{C_{j_{r_1}}} – \vec{C_{j_{r_2}}}\right\Vert^2 – \sum\limits_{j_{b_1}, j_{b_2} \in T_{nb} \atop j_{b_1} …

Install Latex distribution, editor and packages on Ubuntu

1. Install TexLive. This is the latex environment. https://www.tug.org/texlive/quickinstall.html We recommend to use .install-tl script to install TexLive. TexLive is usually installed at “/usr/local/texlive/year/bin/x86_64-linux/….” Although you can install vanilla TexLive via sudo apt-get install texlive, we often observe it misses advanced accessories such as fonts.   2. Install Texmaker http://www.xm1math.net/texmaker/ *** Note: On Ubuntu, Texmaker can …