Loading data/chap02.tex +23 −0 Changes for data/chap02.tex: 23 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -153,3 +153,26 @@ EP.B.8 & 126.74 & 0.003 & 0.017 & 0.005 & 0.083 & 1656 \\ \bottomrule[1.5pt] \end{longtable} \section{源代码环境} 推荐使用 \pkg{listing} 环境嵌入 \pkg{minted}高亮代码。\verb|linenos| 参数控制代码行号显示。引用效果如代码 \ref{lst:sample-code-minted}。 \begin{listing}[!ht] \caption{C++ 代码示例} \label{lst:sample-code-minted} \begin{minted}[xleftmargin=20pt,linenos]{cpp} #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; unsigned short i; int main() { for (i = 0; i <= 5; i++) { // whatever } return 0; } \end{minted} \end{listing} sustech-setup.tex +3 −0 Changes for sustech-setup.tex: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -128,3 +128,6 @@ % 跨页表格,必须在 hyperref 之后使用否则会报错。 \usepackage{longtable} % 源代码高亮 \usepackage{minted} sustechthesis.dtx +4 −1 Changes for sustechthesis.dtx: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -5736,7 +5736,10 @@ Thesis for the degree of \degree@level@en@noun \ of \thu@degree@domain@en% % % \begin{macrocode} \AtEndOfPackageFile*{minted}{ \g@addto@macro\appendix{\renewcommand*{\thelisting}{\thechapter-\arabic{listing}}}% \AtBeginDocument{ \renewcommand*{\thelisting}{\thechapter-\arabic{listing}} }% 不知道为啥下面这行不起作用,改用此种注入。 %\g@addto@macro\appendix{\renewcommand*{\thelisting}{\thechapter-\arabic{listing}}}% \newcommand\thu@set@listing@language{% \ifthu@language@chinese \floatname{listing}{代码}% Loading Loading
data/chap02.tex +23 −0 Changes for data/chap02.tex: 23 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -153,3 +153,26 @@ EP.B.8 & 126.74 & 0.003 & 0.017 & 0.005 & 0.083 & 1656 \\ \bottomrule[1.5pt] \end{longtable} \section{源代码环境} 推荐使用 \pkg{listing} 环境嵌入 \pkg{minted}高亮代码。\verb|linenos| 参数控制代码行号显示。引用效果如代码 \ref{lst:sample-code-minted}。 \begin{listing}[!ht] \caption{C++ 代码示例} \label{lst:sample-code-minted} \begin{minted}[xleftmargin=20pt,linenos]{cpp} #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; unsigned short i; int main() { for (i = 0; i <= 5; i++) { // whatever } return 0; } \end{minted} \end{listing}
sustech-setup.tex +3 −0 Changes for sustech-setup.tex: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -128,3 +128,6 @@ % 跨页表格,必须在 hyperref 之后使用否则会报错。 \usepackage{longtable} % 源代码高亮 \usepackage{minted}
sustechthesis.dtx +4 −1 Changes for sustechthesis.dtx: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -5736,7 +5736,10 @@ Thesis for the degree of \degree@level@en@noun \ of \thu@degree@domain@en% % % \begin{macrocode} \AtEndOfPackageFile*{minted}{ \g@addto@macro\appendix{\renewcommand*{\thelisting}{\thechapter-\arabic{listing}}}% \AtBeginDocument{ \renewcommand*{\thelisting}{\thechapter-\arabic{listing}} }% 不知道为啥下面这行不起作用,改用此种注入。 %\g@addto@macro\appendix{\renewcommand*{\thelisting}{\thechapter-\arabic{listing}}}% \newcommand\thu@set@listing@language{% \ifthu@language@chinese \floatname{listing}{代码}% Loading