Latex grammar highlight Plugin for Atom
Install Tex Live
|
Make sure to delete the old version of tex live to avoid the conflict and confusion. If you forget where are they or the name of the package you installed, you can use the following command to find them:
|
texlive-latex-base: /usr/bin/pdflatex texlive-base: /usr/bin/tlmgr
Then, you can remove them by using the following command:
|
I went to the document and download the install-tl-unx.tar.gz
file. Then, I extract the file and run the install-tl
file. With the default setting, it would end up at: /usr/local/texlive/2025
# Set TeX Live 2025 path export PATH="/usr/local/texlive/2025/bin/x86_64-linux:$PATH" export MANPATH="/usr/local/texlive/2025/texmf-dist/doc/man/man5:$MANPATH" export INFOPATH="/usr/local/texlive/2025/texmf-dist/doc/info:$INFOPATH"
After that, test the installation by checking the version:
|
pdfTeX 3.141592653-2.6-1.40.23 (TeX Live 2025) kpathsea version 6.4.1
Error
INFO - This is Biber 2.20 INFO - Logfile is 'main.blg' INFO - Reading 'main.bcf' ERROR - Error: Found biblatex control file version 3.8, expected version 3.11. This means that your biber (2.20) and biblatex (3.17) versions are incompatible. See compat matrix in biblatex or biber PDF documentation. INFO - ERRORS: 1
The easiest way is delete the files and compile again.
|
Citation (Reference)
For the citation, there are few main types you can use in the latex: biber
and bibtex
. The biber
is the newer one and it is recommended to use. The bibtex
is the older one and it is not recommended to use. The biber
is more powerful and flexible than the bibtex
. The biber
can handle more complex citation styles and it can handle more complex bibliography data. The bibtex
is more simple and it is easier to use. The bibtex
is more suitable for the beginners.
bibtex example:
|
how to compile the bibtex
example:
|
biber example:
|
how to compile the biber
example:
|
Editor
Prerequisation
|
atom
3 latex packages for atom:
- language-latex(latex高亮)
- latex
- pdf-view(可视化显示)
reference: Violet-Guo
© Violet-Guo 2017
按Ctrl+Alt+B
預覽
© Violet-Guo 2017
more editors
https://www.zhihu.com/question/19954023
- Lyx
- TexStudio
- Sublime Text
- Emacs
Online Platform: Overleaf
I found most of my friends are using Overleaf to edit latex online. So, I tired and use it, too. It is good. All codes and methods below are all test under the Overleaf platform.
Main structure of the Latex
here is the structure of the latex projects:
. ├── figures │ └── example_figure.pdf ├── ldr-article.cls ├── main.bib ├── main.pdf ├── main.tex ├── README.md └── Rmarkdown.Rmd
This directory is an example from the overleaf (ldr-template).
- The figures is a directory for storing the figures.
- The
ldr-article.cls
is for storing all configures which likecs
for html. - the
main.bib
is for storing the citations - the
main.tex
is the place for your main contented.
|
Citation
cite: LondonRob
|
In latex, there is at least two ways to cite: cite
and parencite
. The different between two of them are parencite
could automatically add parent symbol, “()”, for you.
Contents in main.bib
file:
@article{Ctrax, title={High-throughput ethomics in large groups of Drosophila}, author={Branson, Kristin and Robie, Alice A and Bender, John and Perona, Pietro and Dickinson, Michael H}, journal={Nature methods}, volume={6}, number={6}, pages={451--457}, year={2009}, publisher={Nature Publishing Group US New York} } @article{CADABRA, title={Automated monitoring and analysis of social behavior in Drosophila}, author={Dankert, Heiko and Wang, Liming and Hoopfer, Eric D and Anderson, David J and Perona, Pietro}, journal={Nature methods}, volume={6}, number={4}, pages={297--303}, year={2009}, publisher={Nature Publishing Group US New York} }
Latex | Rendered in PDF |
---|---|
Citation test:\\ |
Citation test: |
Different styles for citation:
Find the line \RequirePackage[style=
in the file of ldr-article.cls
Style | Approximate Citation Format |
---|---|
alphabetic |
[Bra+09] |
authortitle |
Branson et al., “High-throughput ethomics in large groups of Drosophila” |
authoryear |
Branson et al. 2009 |
authoryear-icomp |
Branson et al. 2009 |
authoryear-comp |
Branson et al. 2009 |
numeric |
[1] |
numeric-comp |
[1] |
reading |
Branson, Kristin, et al. 2009 |
verbose |
Branson, Kristin, et al. “High-throughput ethomics in large groups of Drosophila.” Nature Methods 6.6 (2009): 451-457 |
chem-acs |
(1) |
phys |
[1] |
nejm |
1. |
nature |
1. |
science |
1. |
ieee |
[1] |
Other tricks
- Commenting:
% this is a invisible comment
- Dealing with special characters: In LaTeX, some characters are reserved for special commands. If you need to use these characters as they are, you need to escape them using a backslash (
\
). The special characters are:# $ % ^ & _ { } ~ \
. For example, if you want to write5%
, you need to write it as5\%
in LaTeX. - Inserting images: The graphicx package provides commands to work with images. You can use the
\includegraphics
command to insert an image.\usepackage{graphicx}
\begin{document}
\includegraphics{filename}
\end{document} - Creating tables: The
tabular
environment can be used to create tables\begin{tabular}{|c|c|}
\hline
Header 1 & Header 2 \\
\hline
Row 1, Col 1 & Row 1, Col 2 \\
Row 2, Col 1 & Row 2, Col 2 \\
\hline
\end{tabular} - Dealing with large documents: For large documents like a thesis or a book, you can use
\input{filename}
or\include{filename}
to add contents from another file. This can help keep your project organized. - Math mode: LaTeX is widely used for its superior handling of mathematical equations. You can insert an inline mathematical equation like this:
$E=mc^2$
, or a standalone one like this:\begin{equation}
E=mc^2
\end{equation} - Hyperlinks: With the
hyperref
package, you can add hyperlinks to your document.\usepackage{hyperref}
...
\href{https://www.example.com}{Link text} - Referencing: With LaTeX, you can easily cross-reference figures, tables, sections, etc. For example, when you label a figure using
\label{fig:my_label}
you can reference it with\ref{fig:my_label}
and it will automatically update the figure number.
Remember, the power of LaTeX comes from the various packages available. When you want to do something specific, there is probably a package that can help you achieve it. Check the documentation of the packages to make full use of their features.
Latex grammar highlight Plugin for Atom