├── ReportTemplate ├── format │ ├── list.tex │ ├── unknown.tex │ ├── float.tex │ ├── fonts.tex │ ├── others.tex │ ├── table.tex │ ├── math.tex │ ├── title.tex │ ├── format.tex │ ├── figure.tex │ ├── layout.tex │ ├── body.tex │ ├── picture.tex │ └── code.tex ├── body │ ├── chapter4.tex │ ├── appendix.tex │ ├── chapter2.tex │ ├── chapter3.tex │ ├── chapter5.tex │ └── chapter1.tex ├── figures │ └── ZJULOGO.jpg ├── commands │ └── commands.tex ├── info │ └── info.tex ├── Template.tex └── cover │ └── cover.tex ├── SampleOutput └── Sample.pdf ├── README.md ├── LICENSE └── .gitignore /ReportTemplate/format/list.tex: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ReportTemplate/format/unknown.tex: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ReportTemplate/format/float.tex: -------------------------------------------------------------------------------- 1 | \usepackage{floatrow} -------------------------------------------------------------------------------- /ReportTemplate/body/chapter4.tex: -------------------------------------------------------------------------------- 1 | \newpage 2 | 3 | \chapter{实验结果分析} -------------------------------------------------------------------------------- /ReportTemplate/body/appendix.tex: -------------------------------------------------------------------------------- 1 | \newpage 2 | \appendix 3 | 4 | 5 | -------------------------------------------------------------------------------- /ReportTemplate/body/chapter2.tex: -------------------------------------------------------------------------------- 1 | \newpage 2 | 3 | \chapter{实验内容和原理} 4 | -------------------------------------------------------------------------------- /ReportTemplate/body/chapter3.tex: -------------------------------------------------------------------------------- 1 | \newpage 2 | 3 | \chapter{实验步骤和结果记录} -------------------------------------------------------------------------------- /ReportTemplate/body/chapter5.tex: -------------------------------------------------------------------------------- 1 | \newpage 2 | 3 | \chapter{讨论与心得} 4 | -------------------------------------------------------------------------------- /SampleOutput/Sample.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNetAdmin/ZjuReportTemplate/HEAD/SampleOutput/Sample.pdf -------------------------------------------------------------------------------- /ReportTemplate/figures/ZJULOGO.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNetAdmin/ZjuReportTemplate/HEAD/ReportTemplate/figures/ZJULOGO.jpg -------------------------------------------------------------------------------- /ReportTemplate/format/fonts.tex: -------------------------------------------------------------------------------- 1 | \usepackage{mathptmx} % times roman, including math (where possible) 2 | \usepackage{mathpazo} % palatino, including math (where possible) 3 | \usepackage{helvet} % helvetica -------------------------------------------------------------------------------- /ReportTemplate/format/others.tex: -------------------------------------------------------------------------------- 1 | % Format: list typesetting 2 | \definecolor{grey}{rgb}{0.3,0.3,0.3} 3 | \definecolor{darkgreen}{rgb}{0,0.3,0} 4 | \definecolor{darkblue}{rgb}{0,0,0.3} 5 | \definecolor{grey}{rgb}{0.95,0.95,0.95} 6 | \definecolor{darkgreen}{rgb}{0.0,0.5078,0.0} -------------------------------------------------------------------------------- /ReportTemplate/commands/commands.tex: -------------------------------------------------------------------------------- 1 | \newcommand{\covertitle}[1]{ 2 | \begin{center} 3 | \zihao{-2} 4 | {\bf \kaishu #1} 5 | \end{center} 6 | } 7 | 8 | \newcommand{\bodytitle}[1]{ 9 | \begin{center} 10 | \zihao{-3} 11 | {\bf \songti #1} 12 | \end{center} 13 | } 14 | -------------------------------------------------------------------------------- /ReportTemplate/format/table.tex: -------------------------------------------------------------------------------- 1 | % Format: Table that occupies multiple pages 2 | \usepackage{longtable} 3 | 4 | % Format: Table title line 5 | \usepackage{diagbox} 6 | 7 | % Format: Table with varible width 8 | \usepackage{tabularx} 9 | 10 | % Format: Color table 11 | \usepackage{colortbl} 12 | % Define colors 13 | \definecolor{grey}{rgb}{0.91,0.91,0.91} 14 | -------------------------------------------------------------------------------- /ReportTemplate/format/math.tex: -------------------------------------------------------------------------------- 1 | % Font: Math fonts 2 | \usepackage{amsfonts} 3 | 4 | % Format: Math theorem 5 | \usepackage{amsthm} 6 | 7 | % Format: Math symbols and formula 8 | \usepackage{amsmath} 9 | 10 | % Symbol: Math symbols 11 | \usepackage{amssymb} 12 | 13 | % Format: float counter 14 | \setcounter{totalnumber}{6} 15 | \setcounter{topnumber}{3} 16 | \setcounter{bottomnumber}{3} -------------------------------------------------------------------------------- /ReportTemplate/info/info.tex: -------------------------------------------------------------------------------- 1 | \newcommand{\coursename}{课程名称} 2 | \newcommand{\studentname}{学生姓名} 3 | \newcommand{\collegename}{所在学院} 4 | \newcommand{\facultyname}{所在系} 5 | \newcommand{\majorname}{所在专业} 6 | \newcommand{\studentid}{学号} 7 | \newcommand{\teachername}{教师} 8 | \newcommand{\exptype}{实验类型} 9 | \newcommand{\expname}{实验名称} 10 | \newcommand{\explocation}{实验地点} 11 | \newcommand{\exptime}{实验时间} 12 | -------------------------------------------------------------------------------- /ReportTemplate/format/title.tex: -------------------------------------------------------------------------------- 1 | % Format: title format 2 | \usepackage{titlesec} 3 | \titleclass{\chapter}{straight} 4 | \titleformat{\chapter}[hang]{\raggedright \bf \songti \zihao{1}}{\thechapter}{1em}{}{} 5 | \titleformat{\section}[hang]{\raggedright \bf \songti \zihao{2}}{\thesection}{1em}{}{} 6 | \titleformat{\subsection}[hang]{\raggedright \bf \songti \zihao{3}}{\thesubsection}{1em}{}{} 7 | \titleformat{\subsubsection}[hang]{\raggedright \bf \songti \zihao{4}}{\thesubsubsection}{1em}{}{} -------------------------------------------------------------------------------- /ReportTemplate/format/format.tex: -------------------------------------------------------------------------------- 1 | % Main packages 2 | \usepackage{color} 3 | \usepackage{calc} 4 | \usepackage{latexsym} 5 | \usepackage[UTF8,nopunct]{ctex} 6 | \usepackage{subfiles} 7 | \usepackage{advdate} 8 | 9 | % Other formats 10 | \input{format/others.tex} 11 | \input{format/fonts.tex} 12 | \input{format/layout.tex} 13 | \input{format/title.tex} 14 | \input{format/table.tex} 15 | \input{format/list.tex} 16 | \input{format/math.tex} 17 | \input{format/picture.tex} 18 | \input{format/body.tex} 19 | \input{format/float.tex} 20 | \input{format/code.tex} 21 | \input{format/unknown.tex} 22 | \input{format/figure.tex} -------------------------------------------------------------------------------- /ReportTemplate/format/figure.tex: -------------------------------------------------------------------------------- 1 | % Format: Float figures 2 | %\usepackage[centerlast]{caption2} 3 | 4 | % Format: \autoref format 5 | \def\equationautorefname{式} 6 | \def\footnoteautorefname{脚注} 7 | \def\itemautorefname{项} 8 | \def\figureautorefname{图} 9 | \def\tableautorefname{表} 10 | \def\partautorefname{篇} 11 | \def\appendixautorefname{附录} 12 | \def\chapterautorefname{章} 13 | \def\sectionautorefname{节} 14 | \def\subsectionautorefname{小小节} 15 | \def\subsubsectionautorefname{subsubsection} 16 | \def\paragraphautorefname{段落} 17 | \def\subparagraphautorefname{子段落} 18 | \def\FancyVerbLineautorefname{行} 19 | \def\theoremautorefname{定理} 20 | \def\listoffigures{代码} 21 | 22 | -------------------------------------------------------------------------------- /ReportTemplate/Template.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,12pt]{report} 2 | 3 | % Format sheet 4 | \input{format/format.tex} 5 | 6 | 7 | 8 | \begin{document} 9 | 10 | % Report info 11 | \input{info/info.tex} 12 | 13 | % Self-defined cmds 14 | \input{commands/commands.tex} 15 | 16 | % Report cover 17 | \input{cover/cover.tex} 18 | 19 | % Make contents 20 | \tableofcontents 21 | \thispagestyle{empty} 22 | \setcounter{page}{0} 23 | 24 | % Main chapters 25 | \input{body/chapter1.tex} 26 | \input{body/chapter2.tex} 27 | \input{body/chapter3.tex} 28 | \input{body/chapter4.tex} 29 | \input{body/chapter5.tex} 30 | 31 | % Appendix 32 | \input{body/appendix.tex} 33 | 34 | \end{document} 35 | -------------------------------------------------------------------------------- /ReportTemplate/format/layout.tex: -------------------------------------------------------------------------------- 1 | % Format: Ident first line 2 | % \usepackage{indentfirst} 3 | 4 | % Format: Include boxes within paragraph 5 | % \usepackage{picinpar} 6 | 7 | % Format: Page layout 8 | % REQUIRE PKG: calc 9 | \setlength{\topmargin}{5pt} 10 | \setlength{\headheight}{5pt} 11 | \setlength{\headsep}{5pt} 12 | \setlength{\footskip}{30pt} 13 | \setlength{\voffset}{-5pt} 14 | \setlength{\hoffset}{16pt} 15 | \setlength{\oddsidemargin}{0pt} 16 | \setlength{\evensidemargin}{\oddsidemargin} 17 | \setlength{\textwidth}{\paperwidth-2\hoffset-2\oddsidemargin-2in+2em} 18 | \setlength{\marginparpush}{0pt} 19 | \setlength{\marginparwidth}{0pt} 20 | \addtolength{\textheight}{4\baselineskip} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZjuReportTemplate 2 | 3 | Latex template for experiment reports in ZJU. 4 | 5 | ## Usage 6 | 7 | 1. Fill in the information sheet in `info/info.tex`. 8 | 2. Place contents of report in `body/*.tex`. 9 | 3. Place code files in `code/`. 10 | 4. Place pictures in `figures/`. 11 | 5. Use PDFLatex/XeLatex to compile. (PS. If you want to add extra space between English and Chinese words, use XeLatex to compile, PDFLatex would not add the space automatically) 12 | 6. If you want to reconfigure the format, rewrite the format sheets in `format/`. The usages are in `format/format.tex`. 13 | 7. The sample output is `SampleOutput/Sample.pdf`. 14 | 15 | ## Tools recommended 16 | 17 | 1. IDE: TexStudio 18 | 2. Tex Engine: Texlive 2017 19 | 20 | 21 | ## License 22 | ![license](https://img.shields.io/github/license/mashape/apistatus.svg) 23 | -------------------------------------------------------------------------------- /ReportTemplate/cover/cover.tex: -------------------------------------------------------------------------------- 1 | 2 | % Remove page No. 3 | \thispagestyle{empty} 4 | 5 | \begin{center} 6 | \includegraphics[width=0.6\textwidth]{ZJULOGO.jpg} 7 | \end{center} 8 | 9 | % Self-defined command: \covertitle 10 | \covertitle{浙江大学实验报告} 11 | 12 | \vskip 2 cm 13 | 14 | \begin{center} 15 | \zihao{4} 16 | \renewcommand{\arraystretch}{2} 17 | \begin{tabular}[]{rp{75mm}<{\centering}} 18 | 课程名称: & \coursename{} \\ \cline{2-2} 19 | 姓\hspace{2em}名: & \studentname{} \\ \cline{2-2} 20 | 学\hspace{2em}院: & \collegename{} \\ \cline{2-2} 21 | 系: & \facultyname{} \\ \cline{2-2} 22 | 专\hspace{2em}业: & \majorname{} \\ \cline{2-2} 23 | 学\hspace{2em}号: & \studentid{} \\ \cline{2-2} 24 | 指导教师: & \teachername{} \\ \cline{2-2} 25 | \end{tabular} 26 | \end{center} 27 | 28 | \vskip 2 cm 29 | 30 | \begin{center} 31 | \AdvanceDate[-1]\today 32 | \end{center} -------------------------------------------------------------------------------- /ReportTemplate/format/body.tex: -------------------------------------------------------------------------------- 1 | 2 | \usepackage[toc,page,title,titletoc,header]{appendix} 3 | 4 | % Format: Allow user to cite the last page 5 | \usepackage{lastpage} 6 | 7 | % Format: Table of contents topic depth 8 | \setcounter{tocdepth}{3} 9 | 10 | % Format: Contents 11 | \usepackage{titletoc} 12 | \titlecontents{section}[0mm] 13 | {\vspace{.2\baselineskip}\bfseries} 14 | {\normalsize{\thecontentslabel}~\hspace{.5em}} {} 15 | {\dotfill\contentspage[{\makebox[0pt][r]{\thecontentspage}}]} 16 | [\vspace{.1\baselineskip}] 17 | % \dottedcontents{section}[1.16cm]{\large}{2.0em}{4pt} 18 | % \dottedcontents{subsection}[2.00cm]{\normalsize}{2.0em}{4pt} 19 | \setcounter{tocdepth}{2} 20 | 21 | % Function: Hyper link reference 22 | \usepackage{hyperref} 23 | % Remove the red outline 24 | \hypersetup{hidelinks,colorlinks} -------------------------------------------------------------------------------- /ReportTemplate/body/chapter1.tex: -------------------------------------------------------------------------------- 1 | \newpage 2 | \bodytitle{浙江大学实验报告} 3 | 4 | \vskip 1 cm 5 | \begin{center} 6 | \begin{tabularx}{\textwidth}{lX<{\centering}lX<{\centering}} 7 | 课程名称: & \coursename & 实验类型: & \exptype \\ \cline{2-2} \cline{4-4} 8 | \end{tabularx} 9 | 10 | \vskip .1 cm 11 | \begin{tabularx}{\textwidth}{lX<{\centering}} 12 | 实验项目名称: & \expname \\ \cline{2-2} 13 | \end{tabularx} 14 | 15 | \vskip .1 cm 16 | \begin{tabularx}{\textwidth}{l>{\hsize=0.6\hsize}X<{\centering}l>{\hsize=1.4\hsize}X<{\centering}lX<{\centering}} 17 | 学生姓名: & \studentname & 专业 & \majorname & 学号: & \studentid \\ \cline{2-2} \cline{4-4} \cline{6-6} 18 | \end{tabularx} 19 | 20 | \vskip .1 cm 21 | \begin{tabularx}{\textwidth}{lX<{\centering}l>{\hsize=1.4\hsize}X<{\centering}l>{\hsize=0.6\hsize}X<{\centering}} 22 | 实验地点: & \explocation & 实验时间: & \exptime & 指导教师: & \teachername \\ \cline{2-2} \cline{4-4} \cline{6-6} 23 | \end{tabularx} 24 | \end{center} 25 | 26 | 27 | \chapter{实验目的和要求} 28 | -------------------------------------------------------------------------------- /ReportTemplate/format/picture.tex: -------------------------------------------------------------------------------- 1 | % Format: Include pictures 2 | \usepackage{graphicx} 3 | \usepackage{graphics} 4 | 5 | % Format: Beautify the figure boxs 6 | \usepackage{fancybox} 7 | 8 | % Format: Insert multiple figures into one figure/table 9 | \usepackage{subfigure} 10 | 11 | % Function: Convert eps to pdf 12 | \usepackage[outdir=./figures/]{epstopdf} 13 | % Only regenerate pdf files when eps file is newer 14 | \epstopdfsetup{update} 15 | 16 | % Format: Disable the figures to float to the top of page 17 | \usepackage{flafter} 18 | 19 | % Symbol: Math symbols with circle 20 | \usepackage{pifont} 21 | 22 | % Path: Main picture path 23 | % Need two pair of {} 24 | \graphicspath{{figures/}} 25 | 26 | % Format: Universal setting 27 | \setkeys{Gin}{width=0.8\textwidth} 28 | 29 | % Format: Distance between figure and caption 30 | \setlength{\abovecaptionskip}{0pt} 31 | \setlength{\belowcaptionskip}{0pt} 32 | 33 | % Format: Subfigures 34 | \usepackage{subfigure} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | Copyright (C) 2017 zxwang42@gmail.com 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | *.fmt 10 | *.fot 11 | *.cb 12 | *.cb2 13 | 14 | ## Intermediate documents: 15 | *.dvi 16 | *-converted-to.* 17 | # these rules might exclude image files for figures etc. 18 | # *.ps 19 | # *.eps 20 | # *.pdf 21 | 22 | ## Generated if empty string is given at "Please type another file name for output:" 23 | # .pdf 24 | 25 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 26 | *.bbl 27 | *.bcf 28 | *.blg 29 | *-blx.aux 30 | *-blx.bib 31 | *.run.xml 32 | 33 | ## Build tool auxiliary files: 34 | *.fdb_latexmk 35 | *.synctex 36 | *.synctex(busy) 37 | *.synctex.gz 38 | *.synctex.gz(busy) 39 | *.pdfsync 40 | 41 | ## Auxiliary and intermediate files from other packages: 42 | # algorithms 43 | *.alg 44 | *.loa 45 | 46 | # achemso 47 | acs-*.bib 48 | 49 | # amsthm 50 | *.thm 51 | 52 | # beamer 53 | *.nav 54 | *.pre 55 | *.snm 56 | *.vrb 57 | 58 | # changes 59 | *.soc 60 | 61 | # cprotect 62 | *.cpt 63 | 64 | # elsarticle (documentclass of Elsevier journals) 65 | *.spl 66 | 67 | # endnotes 68 | *.ent 69 | 70 | # fixme 71 | *.lox 72 | 73 | # feynmf/feynmp 74 | *.mf 75 | *.mp 76 | *.t[1-9] 77 | *.t[1-9][0-9] 78 | *.tfm 79 | 80 | #(r)(e)ledmac/(r)(e)ledpar 81 | *.end 82 | *.?end 83 | *.[1-9] 84 | *.[1-9][0-9] 85 | *.[1-9][0-9][0-9] 86 | *.[1-9]R 87 | *.[1-9][0-9]R 88 | *.[1-9][0-9][0-9]R 89 | *.eledsec[1-9] 90 | *.eledsec[1-9]R 91 | *.eledsec[1-9][0-9] 92 | *.eledsec[1-9][0-9]R 93 | *.eledsec[1-9][0-9][0-9] 94 | *.eledsec[1-9][0-9][0-9]R 95 | 96 | # glossaries 97 | *.acn 98 | *.acr 99 | *.glg 100 | *.glo 101 | *.gls 102 | *.glsdefs 103 | 104 | # gnuplottex 105 | *-gnuplottex-* 106 | 107 | # gregoriotex 108 | *.gaux 109 | *.gtex 110 | 111 | # hyperref 112 | *.brf 113 | 114 | # knitr 115 | *-concordance.tex 116 | # TODO Comment the next line if you want to keep your tikz graphics files 117 | *.tikz 118 | *-tikzDictionary 119 | 120 | # listings 121 | *.lol 122 | 123 | # makeidx 124 | *.idx 125 | *.ilg 126 | *.ind 127 | *.ist 128 | 129 | # minitoc 130 | *.maf 131 | *.mlf 132 | *.mlt 133 | *.mtc[0-9]* 134 | *.slf[0-9]* 135 | *.slt[0-9]* 136 | *.stc[0-9]* 137 | 138 | # minted 139 | _minted* 140 | *.pyg 141 | 142 | # morewrites 143 | *.mw 144 | 145 | # nomencl 146 | *.nlo 147 | 148 | # pax 149 | *.pax 150 | 151 | # sagetex 152 | *.sagetex.sage 153 | *.sagetex.py 154 | *.sagetex.scmd 155 | 156 | # scrwfile 157 | *.wrt 158 | 159 | # sympy 160 | *.sout 161 | *.sympy 162 | sympy-plots-for-*.tex/ 163 | 164 | # pdfcomment 165 | *.upa 166 | *.upb 167 | 168 | # pythontex 169 | *.pytxcode 170 | pythontex-files-*/ 171 | 172 | # thmtools 173 | *.loe 174 | 175 | # TikZ & PGF 176 | *.dpth 177 | *.md5 178 | *.auxlock 179 | 180 | # todonotes 181 | *.tdo 182 | 183 | # easy-todo 184 | *.lod 185 | 186 | # xindy 187 | *.xdy 188 | 189 | # xypic precompiled matrices 190 | *.xyc 191 | 192 | # endfloat 193 | *.ttt 194 | *.fff 195 | 196 | # Latexian 197 | TSWLatexianTemp* 198 | 199 | ## Editors: 200 | # WinEdt 201 | *.bak 202 | *.sav 203 | 204 | # Texpad 205 | .texpadtmp 206 | 207 | # Kile 208 | *.backup 209 | 210 | # KBibTeX 211 | *~[0-9]* 212 | 213 | # auto folder when using emacs and auctex 214 | /auto/* 215 | 216 | # expex forward references with \gathertags 217 | *-tags.tex -------------------------------------------------------------------------------- /ReportTemplate/format/code.tex: -------------------------------------------------------------------------------- 1 | % Format: If-Then structure 2 | \usepackage{ifthen} 3 | 4 | % Format: Code beautify 5 | \usepackage{listings} 6 | 7 | % Old Format: code highlight 8 | % \lstset{xleftmargin=1em,xrightmargin=1em} 9 | % \lstset{ 10 | % framexleftmargin=0.5em, 11 | % framexrightmargin=1em, 12 | % framextopmargin=0em, 13 | % basicstyle=\footnotesize, 14 | % framexbottommargin=1em 15 | % } 16 | % \lstset{ 17 | % backgroundcolor=\color{grey}, 18 | % commentstyle=\color{darkgreen}, 19 | % keywordstyle=\color{blue}, 20 | % % caption=\lstname, 21 | % basicstyle=\ttfamily\footnotesize, 22 | % breaklines=true, 23 | % columns=flexible, 24 | % mathescape=fause, 25 | % % backgroundcolor=\color{backcolour}, 26 | % % commentstyle=\color{codegreen}, 27 | % % keywordstyle=\color{magenta}, 28 | % % numberstyle=\tiny\color{codegray}, 29 | % % stringstyle=\color{codepurple}, 30 | % % basicstyle=\footnotesize, 31 | % % breakatwhitespace=false, 32 | % % breaklines=true, 33 | % % captionpos=b, 34 | % % keepspaces=true, 35 | % % numbers=left, 36 | % % numbersep=5pt, 37 | % % showspaces=false, 38 | % % showstringspaces=false, 39 | % % showtabs=false, 40 | % tabsize=4, 41 | % numbers=left, 42 | % stepnumber=1, 43 | % numberstyle=\small, 44 | % numbersep=1em 45 | % } 46 | % \lstloadlanguages{ 47 | % C, 48 | % C++, 49 | % Java, 50 | % Matlab, 51 | % Python, 52 | % Bash, 53 | % Mathematica 54 | % } 55 | \renewcommand{\lstlistingname}{代码} 56 | \usepackage{caption} 57 | \DeclareCaptionFont{white}{\color{white}} 58 | \DeclareCaptionFormat{listing}{\colorbox[cmyk]{0.43, 0.35, 0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}} 59 | \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize}} 60 | \usepackage{listings} 61 | \lstset{ 62 | basicstyle=\footnotesize\ttfamily, % Standardschrift 63 | %numbers=left, % Ort der Zeilennummern 64 | numberstyle=\tiny, % Stil der Zeilennummern 65 | %stepnumber=2, % Abstand zwischen den Zeilennummern 66 | numbersep=5pt, % Abstand der Nummern zum Text 67 | tabsize=4, % Groesse von Tabs 68 | extendedchars=true, % 69 | breaklines=true, % Zeilen werden Umgebrochen 70 | keywordstyle=\color{red}, 71 | frame=b, 72 | escapeinside=``, 73 | keywordstyle=[1]\textbf, % Stil der Keywords 74 | keywordstyle=[2]\textbf, % 75 | keywordstyle=[3]\textbf, % 76 | keywordstyle=[4]\textbf, %\sqrt{\sqrt{}} 77 | %stringstyle=\color{white}\ttfamily, % Farbe der String 78 | showspaces=false, % Leerzeichen anzeigen ? 79 | showtabs=false, % Tabs anzeigen ? 80 | xleftmargin=17pt, 81 | framexleftmargin=17pt, 82 | framexrightmargin=5pt, 83 | framexbottommargin=4pt, 84 | %backgroundcolor=\color{lightgray}, 85 | commentstyle=\color{green}, % comment color 86 | keywordstyle=\color{blue}, % keyword color 87 | stringstyle=\color{red}, % string color 88 | showstringspaces=false % Leerzeichen in Strings anzeigen ? 89 | } 90 | \lstloadlanguages{% Check Dokumentation for further languages ... 91 | %[Visual]Basic 92 | %Pascal 93 | C, 94 | C++, 95 | Python, 96 | Java 97 | } 98 | 99 | 100 | --------------------------------------------------------------------------------