对问题接受答案的编辑与旋转门包装相匹配的怀疑结果符号让我可以访问下面 MWE 中的前两个旋转门。如果能帮助我按照 MWE 中表达的方式缩放这些旋转门,我将不胜感激。
\documentclass{article}
\usepackage{turnstile}% http://ctan.org/pkg/turnstile
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usepackage{adjustbox}% http://ctan.org/pkg/adjustbox
\renewcommand{\makehor}[4]
{\ifthenelse{\equal{#1}{n}}{\hspace{#3}}{}
\ifthenelse{\equal{#1}{s}}{\rule[-0.5#2]{#3}{#2}}{}
\ifthenelse{\equal{#1}{d}}{\setlength{\lengthvar}{#2}
\addtolength{\lengthvar}{0.5#4}
\rule[-\lengthvar]{#3}{#2}
\hspace{-#3}
\rule[0.5#4]{#3}{#2}}{}
\ifthenelse{\equal{#1}{t}}{\setlength{\lengthvar}{1.5#2}
\addtolength{\lengthvar}{#4}
\rule[-\lengthvar]{#3}{#2}
\hspace{-#3}
\rule[-0.5#2]{#3}{#2}
\hspace{-#3}
\setlength{\lengthvar}{0.5#2}
\addtolength{\lengthvar}{#4}
\rule[\lengthvar]{#3}{#2}}{}
\ifthenelse{\equal{#1}{w}}{% New wavy $\sim$ definition
\setbox0=\hbox{$\sim$}%
\raisebox{-.6ex}{\hspace*{-.05ex}\adjustbox{width=#3,height=\height}{\clipbox{0.75 0 0 0}{\usebox0}}}}{}
\ifthenelse{\equal{#1}{z}}{% New tikz wavy definition
\raisebox{-.4ex}{\hspace*{-.08ex}\tikz \draw [thin,x=0.5ex,y=.25ex] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0);\hspace*{.2ex}}}{}
}
\begin{document}
I want $\turnstile{s}{s}{}{}{n}B$ and $ A\turnstile{s}{z}{}{}{n}B$ to be scaled so that the size and height of the vertical line and fatness of the lines become as in the standard turnstile $\vdash$.
\end{document}
答案1
这是使用包的方法scalerel
,用于定义\xturnstile{}{}{}{}{}
。它甚至可以跨数学样式工作。
\documentclass{article}
\usepackage{turnstile}% http://ctan.org/pkg/turnstile
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usepackage{adjustbox}% http://ctan.org/pkg/adjustbox
\usepackage{scalerel}
\renewcommand{\makehor}[4]
{\ifthenelse{\equal{#1}{n}}{\hspace{#3}}{}
\ifthenelse{\equal{#1}{s}}{\rule[-0.5#2]{#3}{#2}}{}
\ifthenelse{\equal{#1}{d}}{\setlength{\lengthvar}{#2}
\addtolength{\lengthvar}{0.5#4}
\rule[-\lengthvar]{#3}{#2}
\hspace{-#3}
\rule[0.5#4]{#3}{#2}}{}
\ifthenelse{\equal{#1}{t}}{\setlength{\lengthvar}{1.5#2}
\addtolength{\lengthvar}{#4}
\rule[-\lengthvar]{#3}{#2}
\hspace{-#3}
\rule[-0.5#2]{#3}{#2}
\hspace{-#3}
\setlength{\lengthvar}{0.5#2}
\addtolength{\lengthvar}{#4}
\rule[\lengthvar]{#3}{#2}}{}
\ifthenelse{\equal{#1}{w}}{% New wavy $\sim$ definition
\setbox0=\hbox{$\sim$}%
\raisebox{-.6ex}{\hspace*{-.05ex}\adjustbox{width=#3,height=\height}{\clipbox{0.75 0 0 0}{\usebox0}}}}{}
\ifthenelse{\equal{#1}{z}}{% New tikz wavy definition
\raisebox{-.4ex}{\hspace*{-.08ex}\tikz \draw [thin,x=0.5ex,y=.25ex] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0);\hspace*{.2ex}}}{}
}
\newcommand\xturnstile[5]{\mathrel{\scalerel*{\turnstile{#1}{#2}{#3}{#4}{#5}}{\vdash}}}
\begin{document}
I want $\xturnstile{s}{s}{}{}{n}B$ and $ A\xturnstile{s}{z}{}{}{n}B$ to be scaled
so that the size and height of the vertical line and fatness of the lines become
as in the standard turnstile $\vdash$.
\[
A\xturnstile{s}{z}{}{}{n}B \quad\scriptstyle
A\xturnstile{s}{z}{}{}{n}B \quad\scriptscriptstyle
A\xturnstile{s}{z}{}{}{n}B
\]
\end{document}