\documentclass[addpoints,UTF8]{exam}
\usepackage[fontset=windows]{ctex} % Chinese support
\usepackage{zhnumber} % Chinese number support
\usepackage{amsmath} % Math formula support
\usepackage{listings} % Code support
\usepackage{xcolor} % Color setting support
\usepackage{multicol} % Display contents in multiple columns
\usepackage[T1]{fontenc} % Various fonts support
\usepackage{lmodern} % Enable Latin Modern font
%% Header and Footer
\pagestyle{headandfoot}
\firstpageheadrule
\firstpageheader{27}{第三次小班课\ 第三章习题}{2021.10.19}
\runningheadrule
\runningheader{27}{第三次小班课\ 第三章习题}{2021.10.19}
\firstpagefooter{}{第\thepage\ 页(共\numpages 页)}{}
\runningfooter{}{第\thepage\ 页(共\numpages 页)}{}
%% Score Style
\pointname{ 分}
\pointformat{(\thepoints)}
\totalformat{共\totalpoints 分}
%% Solution Style
% no box for solutions
% \unframedsolutions
\renewcommand{\solutiontitle}{\noindent\textbf{答:}}
%% Label Number Style
\renewcommand{\thequestion}{\zhnum{question}}
\renewcommand{\questionlabel}{\thequestion .}
\renewcommand{\thepartno}{\arabic{partno}}
\renewcommand{\partlabel}{\thepartno .}
\renewcommand{\thesubpart}{\arabic{subpart}}
\renewcommand{\subpartlabel}{(\thesubpart) }
%% Code Style
\lstdefinelanguage
{ass} % add "assembly" language
[x86masm]{Assembler} % based on the "x86masm" dialect
% with these extra keywords:
{
morekeywords={
CDQE,CQO,CMPSQ,CMPXCHG16B,JRCXZ,LODSQ,MOVSXD,
POPFQ,PUSHFQ,SCASQ,STOSQ,IRETQ,RDTSCP,SWAPGS,
rax,rdx,rcx,rbx,rsi,rdi,rsp,rbp,
r8,r8d,r8w,r8b,r9,r9d,r9w,r9b,
r10,r10d,r10w,r10b,r11,r11d,r11w,r11b,
r12,r12d,r12w,r12b,r13,r13d,r13w,r13b,
r14,r14d,r14w,r14b,r15,r15d,r15w,r15b,
movb,movl,movw,movq,
movzbw,movzbl,movzwl,movzbq,movzwq,
movsbw,movsbl,movswl,movsbq,movswq,movslq,
cltq,
addb,addw,addl,addq,
subb,subw,subl,subq,
andb,andw,andl,andq,
orb,orw,orl,orq,
xorb,xorw,xorl,xorq,
imulb,imulw,imull,imulq,
cmpb,cmpw,cmpl,cmpq,
pushq,popq,
callq,retq
},
deletekeywords={
dd
}
}
\lstset{
%% Language setting
language={[ANSI]C},
tabsize=4,
%% Break line
breaklines=true,
prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
%% Numbers
numbers=left,
numberstyle=\tiny,
firstnumber=1,
stepnumber=5,
%% Font
% basicstyle=\fontspec{Consolas},
% basicstyle=\ttfamily,
basicstyle=\fontfamily{pcr}\selectfont,
% keywordstyle=\color{blue!70},
keywordstyle=\color{black}\bfseries, % bold black
commentstyle=\color{red!50!green!50!blue!50},
%% Frame
frame=single, % or shadowbox
% rulesepcolor=\color{red!20!green!20!blue!20}
}
%% Other Settings
\setlength\linefillheight{.5in}
\begin{document}
\begin{questions}
\question
\begin{parts}
\part
\end{parts}
\end{questions}
\end{document}
CS seminar exercise template in latex
最新推荐文章于 2023-09-05 16:36:29 发布