diff options
author | Karl Berry <karl@freefriends.org> | 2021-12-24 21:45:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-12-24 21:45:27 +0000 |
commit | f2bc2e69ec13338942af8529d34011977ecdc453 (patch) | |
tree | e7baafa1d061e57c3c1e6e26cfba0b819766d45a /Master/texmf-dist/source | |
parent | 044b5d8223fdcb76c0efba3780d65736fb3d4d36 (diff) |
termsim (24dec21)
git-svn-id: svn://tug.org/texlive/trunk@61399 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/termsim/termsim.dtx | 81 |
1 files changed, 37 insertions, 44 deletions
diff --git a/Master/texmf-dist/source/latex/termsim/termsim.dtx b/Master/texmf-dist/source/latex/termsim/termsim.dtx index 856192470a5..dfd80100292 100644 --- a/Master/texmf-dist/source/latex/termsim/termsim.dtx +++ b/Master/texmf-dist/source/latex/termsim/termsim.dtx @@ -11,8 +11,8 @@ Terminal simulation based on tcolorbox and minted/listings The `terminal`(`terminal*`) evironment create a tcolorbox to simulate terminal with the eviroment body and the `\termfile`(`\termfile*`) macro from a source file. -The OS type was selected from win10, mac and ubuntu and -the terminal theme was selected from dark and light with key-value option. +The OS type was selected from win10, mac, or ubuntu and +the terminal theme was selected from dark, light, or with key-value option. All options can be set with `\termset` macro or `terminal`(`terminal*`) eniroment's and `\termfile`(`\termfile*`) macro's option @@ -38,7 +38,7 @@ Contributing `terminal`(`terminal*`)环境根据环境内容创建一个`tcolorbox`盒子用于模拟终端窗口, `\termfile`(`\termfile*`)命令根据载入的文件内容创建一个`tcolorbox`盒子用于模拟终端窗口。 -可以通过`terminal`(`terminal*`)环境或`\termfile`(`\termfile*`)命令的`key-value`选项设置操作系统类型(win10、mac或ubuntu), +可以通过`terminal`(`terminal*`)环境或`\termfile`(`\termfile*`)命令的`key-value`选项设置操作系统类型(win10、mac或ubuntu),并可选择暗色(dark)、亮色(light)或白色(white)颜色主题。 所有选项即可以通过环境或命令选项设置,也可以通过`\termset`命令进行设置。 @@ -52,7 +52,7 @@ Contributing (2). Issues和PR: [issue](https://github.com/registor/termsim/issues) or [pull request](https://github.com/registor/termsim/pulls). 2. gitee仓库: - (1). 仓库地址: [termsim-l3](https://gitee.com/nwafu_nan/termsim) + (1). 仓库地址: [termsim](https://gitee.com/nwafu_nan/termsim) (2). Issues and PR: [issue](https://gitee.com/nwafu_nan/termsim/issues) or [pull request](https://gitee.com/nwafu_nan/termsim/pulls). Copyright and Licence @@ -67,11 +67,7 @@ Copyright and Licence version. This version of this license is in http://www.latex-project.org/lppl/lppl-1-3c.txt and the latest version of this license is in - http://www.latex-project.org/lppl.tx \IfBooleanTF{#1} - { - \bool_set_true:N \l_@@_comment_bool - }{ -t + http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. @@ -161,7 +157,7 @@ t %</internal> %<package>\NeedsTeXFormat{LaTeX2e}[2020/10/01] %<package>\RequirePackage{expl3} -%<+package>\GetIdInfo$Id: termsim.dtx 1.0.0 2021-12-14 08:00:00 +0800 Nan Geng <nangeng@nwafu.edu.cn> $ +%<+package>\GetIdInfo$Id: termsim.dtx 1.1.0 2021-12-24 08:00:00 +0800 Nan Geng <nangeng@nwafu.edu.cn> $ %<package> {Terminal simulation with tcolorbox and minted/listings.} %<package>\ProvidesExplPackage{\ExplFileName} %<package> {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -172,9 +168,6 @@ t \usepackage{xcolor} \usepackage{xcolor-material} \usepackage{termsim} -\renewcommand*\marg[1]{\{\meta{#1}\}} -\renewcommand*\oarg[1]{[\meta{#1}]} -\renewcommand*\parg[1]{(\meta{#1})} \NewDocumentCommand{\init}{+v}{\hspace{\fill}初始值~=~\textcolor{blue}{\bfseries#1}} \DeclareDocumentCommand\opt{m}{\texttt{#1}} \DeclareDocumentCommand\kvopt{mm} @@ -283,7 +276,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termset{os=win10,theme=dark,shstretch=1.0} %\begin{terminal}{窗口标题} %C:\Users\Administrator 的目录 @@ -326,7 +319,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termfile{窗口标题}{test.bat} %\end{minipage} %\end{center} @@ -455,7 +448,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termset{os=win10,theme=dark,shstretch=1.0} %\begin{terminal}{窗口标题} %C:\Users\Administrator 的目录 @@ -485,7 +478,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\begin{terminal*}[os=win10,theme=light][底线注释]{窗口标题} %C:\Users\Administrator 的目录 %2018/07/21 15:39 <DIR> . @@ -509,7 +502,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termset{os=win10,theme=dark} %\termfile{窗口标题}{test.bat} %\end{minipage} @@ -521,7 +514,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termfile*[os=win10,theme=light][底线注释]{窗口标题}{test.bat} %\end{minipage} %\end{center} @@ -543,7 +536,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termset{os=mac,theme=dark} %\begin{terminal}{窗口标题} %xxxxxx@xxxxxx-lap:~$ ls @@ -565,7 +558,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\begin{terminal*}[os=mac,theme=light][底线注释]{窗口标题} %xxxxxx@xxxxxx-lap:~$ ls %Desktop Downloads p2 Public Templates Videos @@ -584,7 +577,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termset{os=mac,theme=dark} %\termfile{窗口标题}{testls} %\end{minipage} @@ -596,7 +589,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termfile*[os=mac,theme=light][底线注释]{窗口标题}{testls} %\end{minipage} %\end{center} @@ -616,8 +609,7 @@ t % remote: Counting objects: 100% (106/106), done. % remote: Compressing objects: 100% (105/105), done. % remote: Total 106 (delta 9), reused 0 (delta 0) -% 接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, -% 完成. +% 接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, 完成. % 处理 delta 中: 100% (9/9), 完成. % 正在检出文件: 100% (75/75), 完成. % xxxxxx@xxxxxx-lap:~/Desktop $ @@ -625,7 +617,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termset{os=ubuntu,theme=dark} %\begin{terminal}{窗口标题} %xxxxxx@xxxxxx-lap:~/Desktop $ @@ -635,8 +627,7 @@ t %remote: Counting objects: 100% (106/106), done. %remote: Compressing objects: 100% (105/105), done. %remote: Total 106 (delta 9), reused 0 (delta 0) -%接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, -%完成. +%接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, 完成. %处理 delta 中: 100% (9/9), 完成. %正在检出文件: 100% (75/75), 完成. %xxxxxx@xxxxxx-lap:~/Desktop $ @@ -654,16 +645,16 @@ t % remote: Counting objects: 100% (106/106), done. % remote: Compressing objects: 100% (105/105), done. % remote: Total 106 (delta 9), reused 0 (delta 0) -% 接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, -% 完成. +% 接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, 完成. % 处理 delta 中: 100% (9/9), 完成. % 正在检出文件: 100% (75/75), 完成. % xxxxxx@xxxxxx-lap:~/Desktop $ % \end{terminal*} % \end{Verbatim} % +%\newpage %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\begin{terminal*}[os=ubuntu,theme=light][底线注释]{窗口标题} %xxxxxx@xxxxxx-lap:~/Desktop $ %git clone git@gitee.com:xxxxxx/xxxxxx @@ -672,8 +663,7 @@ t %remote: Counting objects: 100% (106/106), done. %remote: Compressing objects: 100% (105/105), done. %remote: Total 106 (delta 9), reused 0 (delta 0) -%接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, -%完成. +%接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, 完成. %处理 delta 中: 100% (9/9), 完成. %正在检出文件: 100% (75/75), 完成. %xxxxxx@xxxxxx-lap:~/Desktop $ @@ -690,7 +680,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termset{os=ubuntu,theme=dark} %\termfile{窗口标题}{testsh} %\end{minipage} @@ -702,7 +692,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termfile*[os=ubuntu,theme=light][底线注释]{窗口标题}{testsh} %\end{minipage} %\end{center} @@ -721,8 +711,7 @@ t % remote: Counting objects: 100% (106/106), done. % remote: Compressing objects: 100% (105/105), done. % remote: Total 106 (delta 9), reused 0 (delta 0) -% 接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, -% 完成. +% 接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, 完成. % 处理 delta 中: 100% (9/9), 完成. % 正在检出文件: 100% (75/75), 完成. % xxxxxx@xxxxxx-lap:~/Desktop $ @@ -730,7 +719,7 @@ t % \end{Verbatim} % %\begin{center} -%\begin{minipage}{0.75\textwidth} +%\begin{minipage}{0.85\textwidth} %\termset{os=ubuntu,theme=white} %\begin{terminal}{窗口标题} %xxxxxx@xxxxxx-lap:~/Desktop $ @@ -740,8 +729,7 @@ t %remote: Counting objects: 100% (106/106), done. %remote: Compressing objects: 100% (105/105), done. %remote: Total 106 (delta 9), reused 0 (delta 0) -%接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, -%完成. +%接收对象中: 100% (106/106), 237.88 MiB | 730.00 KiB/s, 完成. %处理 delta 中: 100% (9/9), 完成. %正在检出文件: 100% (75/75), 完成. %xxxxxx@xxxxxx-lap:~/Desktop $ @@ -997,6 +985,8 @@ t }% % \end{macrocode} % +% \changes{v1.1.0}{2021/12/24}{调整Win10 Logo的yshift} +% % 定义Win10终端盒子的tcolorbox样式 % % \begin{macrocode} @@ -1020,15 +1010,15 @@ t right~color=WinBlue% },% overlay~unbroken = {% - \node[inner~sep=0pt,anchor=north~west,yshift=-3pt,xshift=1.2pt,text=black] + \node[inner~sep=0pt,anchor=north~west,yshift=-2pt,xshift=1.2pt,text=black] at (frame.north~west){\WindowsLogo}; - \node[inner~sep=0pt,anchor=north~east,yshift=-5pt,xshift=-8pt,text=black] + \node[inner~sep=0pt,anchor=north~east,yshift=-4pt,xshift=-8pt,text=black] at (frame.north~east){\rule{0.8em}{0.6pt}\quad$\square$\quad{\Large$\times$}}; },% overlay~first = {% - \node[inner~sep=0pt,anchor=north~west,yshift=-3pt,xshift=1.0pt,text=black] + \node[inner~sep=0pt,anchor=north~west,yshift=-2pt,xshift=1.0pt,text=black] at (frame.north~west){\WindowsLogo}; - \node[inner~sep=0pt,anchor=north~east,yshift=-5pt,xshift=-8pt,text=black] + \node[inner~sep=0pt,anchor=north~east,yshift=-4pt,xshift=-8pt,text=black] at (frame.north~east){\rule{0.8em}{0.6pt}\quad$\square$\quad{\Large$\times$}}; }% }, @@ -1249,6 +1239,8 @@ t % % \subsection{内部函数} % +% \changes{v1.1.0}{2021/12/24}{为minted宏包添加autogobble参数} +% % \begin{macro}{\@@_minted_tcbset:} % 设置终端盒子minted宏包参数。 % @@ -1259,6 +1251,7 @@ t listing~engine=minted,% minted~style=\tl_use:N \l_@@_shell_style_tl,% minted~options={% + autogobble, breaklines,% fontsize=\tl_use:N \l_@@_shell_fontsize_tl,% baselinestretch=#1,% |