答案1
已更新 2:此解决方案仅适用于 Computer Modern 和 Latin Modern 数学字体。
\documentclass[12pt]{article}
\newcommand{\lstruck}{\mathopen{\Big(\kern-.475ex\Big\vert}}
\newcommand{\rstruck}{\mathclose{\Big\vert\kern-.475ex\Big)}}
\newcommand{\parstruck}[1]{\lstruck #1\rstruck}
\newcommand{\lmstruck}{\mathopen{\Big(\kern-.8ex\big\vert}}
\newcommand{\rmstruck}{\mathclose{\big\vert\kern-.8ex\Big)}}
\newcommand{\nparstruck}[1]{\lmstruck #1\rmstruck}
\begin{document}
\phantom{\texttt{n}}\verb|\parstruck|: $\parstruck{aBf(x)g}$
\verb|\nparstruck|: $\nparstruck{aBf(x)g}$
\end{document}
已更新 1
这是我以前的答案的改进:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\newcommand{\lstruck}{\Bigl(\mkern-4mu{\Big\lvert}}
\newcommand{\rstruck}{{\Big\rvert}\mkern-4mu\Bigr)}
\newcommand{\lmstruck}{\Bigl(\mkern-7.1mu{\bigl\lvert}}
\newcommand{\rmstruck}{{\bigr\rvert}\mkern-7.1mu\Bigr)}
\newcommand{\parstruck}[1]{{\lstruck{\mathbin #1}\rstruck}}
\newcommand{\nparstruck}[1]{{\lmstruck{\mathbin #1}\rmstruck}}
\begin{document}
\verb|\parstruck{...}| direct command where has been used \verb|\mathbin| for the first type of brackets:
\[\parstruck{aBf(x)g}\]
\verb|\nparstruck{...}| direct command where has been used \verb|\mathbin| for the second type of brackets:
\[\nparstruck{rsg(x)hp}\]
Classic \verb|\parstruck{...}| commands without \verb|\mathbin|:
\[\lstruck pQr \rstruck, \, \lmstruck pQr \rmstruck\]
\end{document}
仅作为练习。您可以自己创建括号。
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\newcommand{\lstruck}{\Bigl(\mkern-4mu{\Big\lvert}}
\newcommand{\rstruck}{{\Big\rvert}\mkern-4mu\Bigr)}
\newcommand{\lmstruck}{\Bigl(\mkern-7.1mu{\bigl\lvert}}
\newcommand{\rmstruck}{{\bigr\rvert}\mkern-7.1mu\Bigr)}
\begin{document}
\[\lstruck pQr \rstruck\]
\[\lmstruck pQr \rmstruck\]
\end{document}