Latex grammar highlight Plugin for Atom
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
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