美文网首页
Compile with Command (Support Ch

Compile with Command (Support Ch

作者: liminhao | 来源:发表于2019-01-13 15:57 被阅读0次

    This file describes some steps that compiling Latex and generating pdf with command.

    latex + dvipdfmx

    First, we should open Windows command with inputing cmd. Then, type the following instructions step by step.

    > notepad main.tex
    result: open new file with notepad.
    
    % Type these sentences into this file.
    > \documentclass{article}
      \begin{document}
      Hello \LaTeX.
      \end{document}
    % Save and close this file.
    
    > latex main.tex
    > dvipdfmx main.dvi
    > main.pdf
    

    Now, we finish compiling Latex and generating pdf file.

    xelatex

    xelatex supports utf-8, which meanings that you can write with Chinese. Try the following instructions.

    > notepad main.tex
    result: open new file with notepad.
    
    % Type these sentences into this file.
    > \documentclass{article}
      \begin{document}
      Hello \LaTeX.
      \end{document}
    % Save and close this file.
    
    > xelatex main.tex
    > main.pdf
    
    • Now we introduce how to write and compile with Chinese.
    % Open a new file refer to above mentioned.
    % Type these these sentences.
    
    > \documentclass{article}
    > \usepackage{ctex}
    > \begin{document}
    > 你好 \LaTeX.
    > \end{document}
    
    % Note that save this file with utf-8 encoding.
    
    > xelatex
    > main.tex
    

    The following shows result.


    demo.jpg

    相关文章

      网友评论

          本文标题:Compile with Command (Support Ch

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