各种帮助网站

CTEX在线文档 http://www.ctex.org/OnlineDocuments

 

代码框架

 1 \documentclass[a4paper,12pt]{article}
 2 \usepackage[top=2.54cm, bottom=2.54cm, left=3.18cm, right=3.18cm]{geometry}
 3 \usepackage{ctex}
 4 \usepackage[colorlinks,bookmarksnumbered=true,bookmarksopen=true,CJKbookmarks=true,linkcolor=red,anchorcolor=black,citecolor=black]{hyperref}
 5 \usepackage{amsthm}
 6 \usepackage{graphicx}
 7 \usepackage{amsmath}
 8 \usepackage{ccmap}
 9 \usepackage{listings}
10 \usepackage{color}
11 \usepackage{bbding}
12 \usepackage{url}
13 \usepackage{movie15}
14 \usepackage{booktabs,longtable}
15 \usepackage{mdwlist}
16 \usepackage{subfigure}
17 \usepackage{pifont}
18 \usepackage{titlesec}
19 \usepackage[labelsep=space]{caption}
20 \usepackage{multirow,paralist}
21 \usepackage[title,titletoc]{appendix}
22 \usepackage[svgnames,x11names]{xcolor}
23 \usepackage[titles,subfigure]{tocloft}
24 
25   \def\CU@definezihao#1#2#3{
26   \def#1{\fontsize{#2}{#3}\selectfont}}
27 
28 \CU@definezihao{\zihaochu}{42}{50}
29 \CU@definezihao{\zihaoxiaochu}{36}{44}
30 \CU@definezihao{\zihaoyi}{28}{34}
31 \CU@definezihao{\zihaoer}{22}{26}
32 \CU@definezihao{\zihaoxiaoer}{18}{22}
33 \CU@definezihao{\zihaosan}{15.7}{19}
34 \CU@definezihao{\zihaosi}{14}{17}
35 \CU@definezihao{\zihaoxiaosi}{12}{14}
36 \CU@definezihao{\zihaowu}{10.5}{12}
37 \CU@definezihao{\zihaoxiaowu}{9}{11}
38 \CU@definezihao{\zihaoliu}{7.875}{9}
39 \CU@definezihao{\zihaoqi}{5.25}{6}
40 
41 \titleformat{\section}{\zihaosi\bfseries}{$\S\;$\thesection}{1em}{}
42 \titleformat{\subsection}{\zihaoxiaosi\bfseries}{\thesubsection}{1em}{}
43 \titleformat{\subsubsection}{\zihaoxiaosi\bfseries}{\thesubsubsection}{1em}{}
44 
45 \renewcommand{\figurename}{\zihaowu{Figure}}
46 
47 \makeatletter
48   \newcommand\figcaption{\def\@captype{figure}\caption}
49   \newcommand\tabcaption{\def\@captype{table}\caption}
50 \makeatother
51 
52 \usepackage{listings}
53 \lstset{tabsize=4, %
54   frame=single, %把代码用带有阴影的框圈起来
55   keywordstyle=\color[rgb]{0,0,1},
56   commentstyle=\color[rgb]{0.133,0.545,0.133},
57   stringstyle=\color[rgb]{0.627,0.126,0.941},
58   %commentstyle=\color{red!50!green!50!blue!50},% 浅灰色的注释
59   rulesepcolor=\color{red!20!green!20!blue!20},% 代码块边框为淡青色
60   %keywordstyle=\color{blue!90}\bfseries, %代码关键字的颜色为蓝色,粗体
61   showstringspaces=false,% 不显示代码字符串中间的空格标记
62   stringstyle=\ttfamily, % 代码字符串的特殊格式
63   keepspaces=true, %
64   breakindent=22pt, %
65   numbers=left,%左侧显示行号
66   stepnumber=1,%
67   numberstyle=\footnotesize, %行号字体用小号
68   basicstyle=\footnotesize, %
69   showspaces=false, %
70   flexiblecolumns=true, %
71   breaklines=true, % 对过长的代码自动换行
72   breakautoindent=true,%
73   breakindent=4em, %
74   escapebegin=\begin{CJK*}{GBK}{hei},escapeend=\end{CJK*},
75   aboveskip=1em, %代码块边框
76   %% added by http://bbs.ctex.org/viewthread.php?tid=53451
77   fontadjust,
78   captionpos=t,
79   framextopmargin=2pt,framexbottommargin=2pt,abovecaptionskip=-3pt,belowcaptionskip=3pt,
80   xleftmargin=4em,xrightmargin=4em, % 设定listing左右的空白
81   texcl=true,
82   % 设定中文冲突,断行,列模式,数学环境输入,listing数字的样式
83   extendedchars=false,columns=flexible,mathescape=true
84   % numbersep=-1em
85 }
86 \pagestyle{headings}
87 \begin{document}
88 \title{题目}
89 \author{作者}
90 \maketitle
91 \tableofcontents
92 \end{document}
View Code

相关文章:

  • 2021-04-10
  • 2021-09-18
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-01-16
猜你喜欢
  • 2022-03-04
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2021-11-22
相关资源
相似解决方案