zoukankan      html  css  js  c++  java
  • TeX代码模板(持续更新中)

    各种帮助网站

    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   defCU@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 	itleformat{section}{zihaosifseries}{$S;$	hesection}{1em}{}
    42 	itleformat{subsection}{zihaoxiaosifseries}{	hesubsection}{1em}{}
    43 	itleformat{subsubsection}{zihaoxiaosifseries}{	hesubsubsection}{1em}{}
    44 
    45 
    enewcommand{figurename}{zihaowu{Figure}}
    46 
    47 makeatletter
    48   
    ewcommandfigcaption{def@captype{figure}caption}
    49   
    ewcommand	abcaption{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}fseries, %代码关键字的颜色为蓝色,粗体
    61   showstringspaces=false,% 不显示代码字符串中间的空格标记
    62   stringstyle=	tfamily, % 代码字符串的特殊格式
    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=egin{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 egin{document}
    88 	itle{题目}
    89 author{作者}
    90 maketitle
    91 	ableofcontents
    92 end{document}
    View Code

    插入图片

    无浮动

     1 %导言区加以下内容
     2 makeatletter 
     3   
    ewcommandfigcaption{def@captype{figure}caption} 
     4   
    ewcommand	abcaption{def@captype{table}caption} 
     5 makeatother
     6 %导言区结束
     7 
     8 \[intextsep]
     9   egin{minipage}{	extwidth}
    10     centering
    11     includegraphics[width=xxx pt]{文件名}%
    12     figcaption{显示的图片名}
    13     label{图片标记}
    14   end{minipage}
    15 \[intextsep]
    View Code

    浮动

    1 egin{figure}
    2   centering
    3   % 需要 usepackage{graphicx}
    4   includegraphics[width=xxx pt]{文件名}\
    5   caption{图片名}label{标记}
    6 end{figure}
    View Code

     

    插入表格

     可以使用Excel的宏“Excel2LaTeX”将Excel表格转换为TeX表格

     

    设置字体

     1 
    ewcommand{chuhao}{fontsize{42pt}{aselineskip}selectfont}
     2 
    ewcommand{xiaochuhao}{fontsize{36pt}{aselineskip}selectfont}
     3 
    ewcommand{yihao}{fontsize{28pt}{aselineskip}selectfont}
     4 
    ewcommand{erhao}{fontsize{21pt}{aselineskip}selectfont}
     5 
    ewcommand{xiaoerhao}{fontsize{18pt}{aselineskip}selectfont}
     6 
    ewcommand{sanhao}{fontsize{15.75pt}{aselineskip}selectfont}
     7 
    ewcommand{sihao}{fontsize{14pt}{aselineskip}selectfont}
     8 
    ewcommand{xiaosihao}{fontsize{12pt}{aselineskip}selectfont}
     9 
    ewcommand{wuhao}{fontsize{10.5pt}{aselineskip}selectfont}
    10 
    ewcommand{xiaowuhao}{fontsize{9pt}{aselineskip}selectfont}
    11 
    ewcommand{liuhao}{fontsize{7.875pt}{aselineskip}selectfont}
    12 
    ewcommand{qihao}{fontsize{5.25pt}{aselineskip}selectfont}
    View Code
    使用示例:
    1 egin{xiaosihao}
    2 在这里写字
    3 end{xiaosihao}
    4 
    5 xiaosihao{在这里写字}
    View Code

     

    常用

    带大括号的公式

    1 % 需要 usepackage{cases}%必须放amsmath下面,否则会冲突
    2 $$
    3 dp(i,j)=
    4 egin{cases}
    5 dp(i-1,j-1)+1, & a[i] = b[j]\
    6 max{dp(i-1,j),dp(i,j-1)}, & a[i] 
    eq b[j]
    7 end{cases}
    8 $$
    View Code
  • 相关阅读:
    获取ArcMap窗口句柄,通过WinAPI获取工作空间中点击要素的系统桌面坐标实现窗体跟随
    ArcGis Go to XY功能代码C#
    Python入门第二篇:基础语法
    python入门第一篇:python语言简介
    Robotium结果的收集和失败重跑
    adb问题整理
    adb pull 与 push
    Monkey测试的参数
    Linux主要命令
    命令行启动应用的几种常见类型
  • 原文地址:https://www.cnblogs.com/xysmlx/p/3258740.html
Copyright © 2011-2022 走看看