美文网首页LaTeX科研写作LaTex
Use Atom to Write Your LaTeX Art

Use Atom to Write Your LaTeX Art

作者: Chunkit_Lau | 来源:发表于2018-10-15 01:06 被阅读8次

I used to use Sublime text 3 to type LaTeX, but in this summer I change it into Atom, a editor developed by Github.

TeX Environment

Like usual, we need to download the TeX package. You can use <a href="https://www.tug.org/texlive/">TeXLive</a>, <a href="http://www.tug.org/mactex/">MacTeX</a>. As I have mentioned before, MacTeX is the Mac version of TeXLive.

“We recommend using the native MacTEX installer instead of the TEXLive installer on Mac OS X, because the native installer makes a few Mac-specific adjustments, in particular to allow easily switching between the various TEX distributions for Mac OS X”
from: http://www.tug.org/mactex/

This is the basic environment.

Atom Environment

Just install the support package:LaTeX and pdf-view, these package can help you compile the LaTeX files and
generate the pdf files.

You can install these package by two ways:

  1. command line mode:
    apm install language-latex

  2. GUI
    If you prefer installation via GUI, you can go to Atom > Settings > Install, search the name in Packages tab and install it.

Screenshot 2018-10-15 at 00.19.00.png

Remember, if you want to compile Chinese LaTeX in atom. DO NOT CHOOSE pdflatex! Please use xelatex!
Just like this pic:

Screenshot 2018-10-15 at 00.19.10.png

Screenshot 2018-10-15 at 00.19.28.png

Also, you can download a package called language-latex this package can help you syntax highlighting and snippets for LaTeX in atom.

Screenshot 2018-10-15 at 00.38.02.png
%!TEX program = xelatex
\documentclass[11pt]{article}
\usepackage{ctex}
\author {Terence Lau}
\title {LaTeX Files}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{color}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{listings} %插入代码
\usepackage{xcolor} %代码高亮
\lstset{language=r,
  basicstyle=\ttfamily,
  keywordstyle=\color{blue},
  commentstyle=\color{darkgreen},
  stringstyle=\color{red}}
\begin{document}
\maketitle
\date
  \section{LaTeX Files}
   This is the R code:
  \\
  \begin{lstlisting}[language ={R}]
  x <- c(52.0,66.0,44.5,37.7,73.5,37.5,56.7,35.6)
  y <- c(2.35,4.95,3.10,2.50,5.11,3.10,2.90,1.75)
  \end{lstlisting}
  \begin{align*}
     \frac{1}{2} + \frac{1}{2} &= 1 \\
     \frac{2}{4} &= \frac{1}{2}
\end{document}

This is the test code, copy it in atom and press: control + shift + b you can compile the .tex file:

Screenshot 2018-10-15 at 00.56.48.png

If you edit the files, just double click the command + S and you can see the new pdf.

I hope this article can help you. If you have any question or comments, please pull the issue or email me: terencelau#terencelau.xyz (change # to @)

相关文章

网友评论

  • f7ef252f444f:你好,我安装所需的插件后,点击control+shift+b,目录下没有生成pdf文件,怎么回事呢?
    Chunkit_Lau:@葛小熙 的确是写错了,应该是 `control + option + b` 我现在修改,而 `control + shift + b` 应该是在 Sublime 上的操作;谢谢指出错误 🙏
    f7ef252f444f:我查了其他资料,发现control+option+b可以哟,小哥哥是不是写错啦这里

本文标题:Use Atom to Write Your LaTeX Art

本文链接:https://www.haomeiwen.com/subject/znjxzftx.html