Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Liam0205
Created August 23, 2016 04:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Liam0205/488895b9555273207f3f99918d368e83 to your computer and use it in GitHub Desktop.
Save Liam0205/488895b9555273207f3f99918d368e83 to your computer and use it in GitHub Desktop.
minted in mdframed and tikz node, with new environment
\documentclass[UTF8, openany,twoside]{ctexbook}
\usepackage{minted}
\usepackage[tikz]{bclogo,rotating}
\usepackage{tikz}
\usepackage{mdframed}
\usepackage{geometry}
\usetikzlibrary{calc}
\DeclareGraphicsRule{.mps}{eps}{.mps}{}
\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
\usemintedstyle{tango}
\geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\newenvironment{attention}[1]
{\par\medskip\noindent
\begin{tikzpicture}
\node[inner sep = 0pt] (box) \bgroup%
\begin{minipage}[t]{.99\textwidth}%
\begin{minipage}{.3\textwidth}
\centering
\tikz[scale = 5]\node[scale = 3, rotate = 30]{\bclampe};
\end{minipage}%
\begin{minipage}{.65\textwidth}
\textbf{#1}\par\smallskip
\surroundwithmdframed
[topline=false, bottomline=false, leftline=false, rightline=false,
backgroundcolor=lbcolor]
{minted}}% former part
{%
\end{minipage}\hfill
\end{minipage}%
\egroup;
\draw[black,line width=3pt]
( $ (box.north east) + (-5pt,3pt) $ ) -- ( $ (box.north east) + (0,3pt) $ ) -- ( $ (box.south east) + (0,-3pt) $ ) -- + (-5pt,0);
\draw[black,line width=3pt]
( $ (box.north west) + (5pt,3pt) $ ) -- ( $ (box.north west) + (0,3pt) $ ) -- ( $ (box.south west) + (0,-3pt) $ ) -- + (5pt,0);
\end{tikzpicture}
\par\medskip}
\newminted{bash}{fontsize=\footnotesize,linenos=false,breaklines=true}
\begin{document}
\begin{attention}{Attention}
\begin{bashcode}
export FS=$(virt-filesystem -a centos7.raw)
guestmount -a centos7.raw -m $FS /mnt
sed -i 's/xfs/ext4/g' /mnt/etc/fstab
guestumount /mnt
\end{bashcode}
\end{attention}
\end{document}
@wuzhouhui
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment