
점선을 정의하려고 합니다 \Uparrow
. 를 사용하여 첫 번째 시도는 tikz
단순히 일반 위에 두 개의 흰색 직사각형을 그리는 것으로 구성되며 \Uparrow
수동으로 직사각형의 좋은 위치를 찾으려고 합니다.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\newcommand{\Dasheduparrow}{
\begin{tikzpicture}[x=1, y=1]
\node (0,0) [inner sep=0] {$\Uparrow$};
\fill[fill=white] (-3,0.5) rectangle (2,-1);
\fill[fill=white] (-3,-2) rectangle (2,-3.5);
\end{tikzpicture}}
지금 입력하면
\begin{document}
Text $\Dasheduparrow$ $\Downarrow$ $\Uparrow$ text.
\end{document}
나는 이것을 얻는다
출력에 매우 만족합니다. 그러나 세 가지 질문이 있습니다.
- 법선
\Downarrow
과 의 동일한 정렬을 얻는 방법은 무엇입니까\Uparrow
? 내 새 기호는 텍스트의 기준선에 정렬되는 반면 두 기본 기호는 약간 아래쪽으로 이동됩니다. - 이 새로운 기호를 올바르게 확장 가능하게 만드는 방법은 무엇입니까?
\LARGE Text $\Dasheduparrow$ $\Downarrow$ $\Uparrow$ text.
출력을 수행하면 기본이 확대되었지만 흰색 직사각형은 확대되지 않은것이 분명합니다 .
\Uparrow
- 내가 제안한 것보다 더 나은 해결책이 있습니까?
답변1
수정된 답변
OP는 내 원래 답변에 따라 간격이 다른 글꼴 크기(및 수학 스타일)로 조정되지 않는다고 설명합니다. 이 문제는 tikz
내 stackengine
패키지를 사용하지 않고 수학 스타일로 간격 크기를 조정하는 방식 으로 해결할 수 있습니다 ( 흰색 직사각형 오버레이의 치수 대신 scalerel
패키지의 \LMex
[Local-Mathstyle ex] 사용).cm
pt
OP의 또 다른 질문에 대답하기 위해 \ThisStyle{...\SavedStyle...}
구문을 사용하면 현재 수학 스타일을 일반적으로 손실되는 구성, 이 경우 편집 \hbox
되고 \vcenter
쌓이는 구성으로 전달할 수 있습니다. 이는 glorified 와 동일 \mathchoice
하지만 필요한 타이핑 양을 상당히 줄여주는 경우가 많습니다.
\documentclass{article}
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{scalerel,stackengine,xcolor}
\newcommand{\Dasheduparrow}{\ThisStyle{\vcenter{\hbox{$%
\stackengine{0.45\LMex}{\stackengine{-.15\LMex}{$\SavedStyle\Uparrow$}
{\textcolor{white}{\rule{1.1\LMex}{0.3\LMex}}}{O}{c}{F}{T}{L}%
}{\textcolor{white}{\rule{1.1\LMex}{0.3\LMex}}}{O}{c}{F}{T}{L}%
$}}}}
\begin{document}
Text $\Dasheduparrow$ $\Downarrow$ $\Uparrow$ text.
$\Dasheduparrow \scriptstyle \Dasheduparrow \scriptscriptstyle \Dasheduparrow$
\LARGE
Text $\Dasheduparrow$ $\Downarrow$ $\Uparrow$ text.
\end{document}
원래 답변
여기서는 OP의 정의부터 시작합니다.
그러나 그런 다음 \vcenter
수학 축의 중앙에 배치하고 scalerel
수학 스타일을 유지하는 기능도 사용합니다.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{scalerel}
\newcommand{\Dasheduparrow}{\ThisStyle{\vcenter{\hbox{$
\begin{tikzpicture}[x=1, y=1]
\node (0,0) [inner sep=0] {$\SavedStyle\Uparrow$};
\fill[fill=white] (-3,0.5) rectangle (2,-1);
\fill[fill=white] (-3,-2) rectangle (2,-3.5);
\end{tikzpicture}$}}}}
\begin{document}
Text $\Dasheduparrow$ $\Downarrow$ $\Uparrow$ text.
$\Dasheduparrow \scriptstyle \Dasheduparrow \scriptscriptstyle \Dasheduparrow$
\end{document}
답변2
빠른 해결 방법(약간 불결할 수 있음):
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz,calc}
\newcommand{\Dasheduparrow}{
\begin{tikzpicture}[x=1, y=1]
\node (0,0) [inner sep=0] {$\Uparrow$};
\fill[fill=white] (-3,0.5) rectangle (2,-1);
\fill[fill=white] (-3,-2) rectangle (2,-3.5);
\end{tikzpicture}}
\begin{document}
Text \parbox{\widthof{$\Dasheduparrow$}}{$\Dasheduparrow$} $\Downarrow$ $\Uparrow$ text.
\end{document}
parbox
내용을 중앙에 배치하기 위해 a를 사용한 곳입니다 .
\parbox{\widthof{$\Dasheduparrow$}}{$\Dasheduparrow$}
또 다른 가능성은 수학 중심화 명령을 사용하는 것입니다.
\vcenter{\hbox{\Dasheduparrow}}