A list of useful resources for LaTex users
LaTex provides a powerful and efficient way of writing a scientific document. However, the initial hurdle for beginners is quite tall with manual coding required for mathematical expressions, tables, graphs, and references. Even for the experts, writing out the codes for mathematical expressions with a professional look and generating tables at the publication standard can often be time-consuming and challenging.
There are a number of free and online resources which make the tasks a lot easier and more efficient. This post is to introduce to the beginners and experienced LaTex writers a range of available resources, which will make their scientific writing more productive and enjoyable. And all of them are free for personal use. They are as follows:
Overleaf
Mathpix
Mathcha
LaTex table generators
Excel2LaTex
Word-LaTex convertibility
Embed.fun
"matrix2latex" function in R
Google Scholar
It is on-line LaTex editor where you can write and store your own documents and share them with your collaborators. The features include
nothing to install: all of the packages are already installed;
a large number of free templates available;
an option to write in Rich Text Format;
real-time chatting and track-change features for collaboration; and
detailed documentation for help and instructions for LaTex.
The above is an example project in Overleaf that offers basic instructions, which is a great starting point for beginners. If you require further instructions, see the following medium posts: Post 1; Post 2.
2. Mathpix
If you find coding for mathematical expressions cumbersome, this will make your life a lot easier. You can snip and copy any readable formulae (even a hand-written one), and paste them into your main latex file.
Here is one such a challenging equation:
It will be a tedious work to write a code for this. However, using Mathpix, the code can be obtained almost instantly by snipping the above, and it can be copied and pasted into your main latex file as below:
$$
15=\frac{-e^{i \pi} \sqrt{3^2+4^2}}{\operatorname{sech}^2
\left(\lim _{x \rightarrow \infty} J_0(x)\right)}
\left[\sum_{k=0}^{\infty}
\frac{1}{2^k}-\vec{\nabla} \times(\vec{\nabla} \psi)+
\int_{-\infty}^{\infty} \delta(y) d y\right]
$$
Mathpix can also snip a table in the same way: Please see here for more functions of Mathpix.
3. Mathcha
Similar to Mathpix, but instead of snipping an equation, you can write one very quickly using its editor.
I have written a formula in its editor as above and highlight it to copy and paste to LaTex editor:
$\displaystyle x\ =\ \frac{-b\ \pm \sqrt{b^{2} -4ac}}{2a} \ $
You can also generate a table and transform it into a LaTex code.
Highlight the table and right-click, then you can copy the following code as below:
\begin{table}[!h]
\centering
\begin{tabular}{|p{0.33\textwidth}|p{0.33\textwidth}|p{0.33\textwidth}|}
\hline
\begin{center}
A
\end{center}
& \begin{center}
B
\end{center}
& \begin{center}
C
\end{center}
\\
\hline
\begin{center}
1
\end{center}
& \begin{center}
2
\end{center}
& \begin{center}
3
\end{center}
\\
\hline
\begin{center}
4
\end{center}
& \begin{center}
5
\end{center}
& \begin{center}
6
\end{center}
\\
\hline
\end{tabular}
\end{table}
Another convenient feature is writing an ordered list. As below, you can write a list in the editor like you do in Word, and the code can be generated and copied into a latex file.
\begin{enumerate}
\item I love it
\item really
\begin{enumerate}
\item Many thanks
\item See you later
\end{enumerate}
\item OK
\end{enumerate}
Other functionalities include the graphing a mathematical function and drawing. For example:
4. LaTex table generators
If you Google the above title as a keyword, then you will see a number of online table generators such as this one:
You can write the entries into the cells of the table, and click “Generate” button to produce the code. You can simply copy and paste the above code into your LaTex editor.
5. Excel2LaTex
If you have a table constructed in Excel, then you can generate LaTex code using the Excel Add-in Excel2LaTex, which is freely available from CTAN. Once installed into Excel (see instructions), you will find it under the “Add-ins” tab, with an option to convert the table into a latex code.
Construct a table in Excel and highlight the table area, and “Convert Table to LaTex” from the pulldown menu to generate the code as above, which can be copied and pasted into the LaTex editor.
6. Word-LaTex Convertibility
If you are familiar with the equation editor in Microsoft Word, you can write an expression in Word and convert it into a LaTex code. You can also do the reverse: enter a LaTex code into the Word equation editor and generate the expressions.
From the pull-down menu of the editor, click “Linear” to convert your existing Word expression to the LaTex code. The LaTex code can be converted into a Word form by clicking “Professional”.
7. Embed.fun
You can embed a mathematical expression into your webpage or blog post by using the editor of this site. Input the LaTex code as below, and publish the results to get a HTML code. This code can be embedded into a webpage and math expressions will appear.
8. "matrix2latex" function in R
The R package “matlib” provides a function to convert a matrix in R into a latex code. For example,
> library(matlib)
> m=matrix(rnorm(12),nrow = 3)
> matrix2latex(m)
\left[
\begin{array}{rrrr}
1.25 & 0.75 & 0.48 & -0.56 \\
0.29 & -1.07 & 0.01 & 1.07 \\
0.34 & -1.22 & -0.43 & 0.50 \\
\end{array}
\right]
9. Citation details from Google Scholar
The citation details can be obtained from Google Scholar. Search an article you want, and the click “Cite” icon at the bottom of the article record. Then, you will see a pop-up window with different citation options.
Click “BibTeX”, then you will see the record in BibTeX format. The record given below should be stored in a text file with bib extension in the same directory as your main tex file. The paper can be cited using the command such as “\cite{kim2022moving}” in your main tex file.
@article{kim2022moving,
title={Moving to a world beyond p-value< 0.05: a guide for business researchers},
author={Kim, Jae H},
journal={Review of Managerial Science},
volume={16},
number={8},
pages={2467--2493},
year={2022},
publisher={Springer}
}
In this post, I have presented a number of free on-line resources for efficient writing of a scientific document using LaTex. If anyone has additional resources, please feel free to share them in the comment. I will update this list. Happy writing!
Comments