Learn how to use latex typographical text output to PDF (1)

Source: Internet
Author: User

I learned to use latex to write my resume.

In the Ubuntu environment, I first download the required software and run the Baidu command.

First create a. Tex, write

1 \ documentclass {Article} 2 \ usepackage {CJK} 3 \ begin {document} 4 \ begin {CJK} {utf8} {gbsn} 5 is really a dumb! 6 \ end {CJK} 7 \ end {document}

Then execute pdflatex A. Tex so that there will be PDF output, and you can directly use evince a.pdf.

Powerful functions

Question about output code

You need to use a package, listings. The code below is actually simple.

1 \ documentclass {Article} 2 \ usepackage {listings} % insert Code 3 \ usepackage {xcolor} % code Highlight 4 \ begin {document} 5 \ lstset {6 numbers = left, 7 numberstyle = \ tiny, 8 keywordstyle = \ color {blue! 70}, commentstyle = \ color {red! 50! Green! 50! Blue! 50}, 9 frame = shadowbox, 10 rulesepcolor = \ color {red! 20! Green! 20! Blue! 20} 11} 12 \ section {code:} 13 14 \ begin {lstlisting} [Language = {[ANSI] c}] 15 # include <stdio. h> 16 int main (INT argc, char ** argv) 17 {18 19 printf ("Hello world! \ N "); 20 21 return 0; 22} 23 \ end {lstlisting} 24 \ section {The progarming test ==}25 26 This Is My program test about latex. so cool, isn' t it? 27 \ end {document}

This is the effect, hey.

You can add tabsize = 2 to the lstset to determine the indentation of the tab key, which makes the code more comfortable.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.