Closer Slanted Parallel Symbol


Answer :

Raise and scale.

\documentclass{article} \usepackage{amsmath,graphicx}  \makeatletter \newcommand{\newparallel}{\mathrel{\mathpalette\new@parallel\relax}} \newcommand{\new@parallel}[2]{%   \begingroup   \sbox\z@{$#1T$}% get the height of an uppercase letter   \resizebox{!}{\ht\z@}{\raisebox{\depth}{$\m@th#1/\mkern-5mu/$}}%   \endgroup } \makeatother  \begin{document}  $AB\newparallel CD$  $\scriptstyle AB\newparallel CD$  \end{document} 

enter image description here

A different implementation with picture mode. One can easily vary the slope by acting on the second argument to \mathpalette.

\documentclass{article} \usepackage{amsmath,pict2e}  \makeatletter \newcommand{\newparallel}{\mathrel{\mathpalette\new@parallel{0.3}}} \newcommand{\new@parallel}[2]{%   \begingroup   \settoheight{\unitlength}{$#1T$}% get the height of an uppercase letter   \sbox\z@{\new@parallel@slash{#1}{#2}}%   \mkern0.5mu\copy\z@\mkern-0.5mu\copy\z@\mkern0.5mu   \endgroup } \newcommand{\new@parallel@slash}[2]{%   \begin{picture}(#2,1)   \roundcap   \new@parallel@linethickness{#1}   \Line(0,0)(#2,1)   \end{picture}% } \newcommand{\new@parallel@linethickness}[1]{%   \linethickness{%       \ifx#1\displaystyle \fontdimen8\textfont\else       \ifx#1\textstyle \fontdimen8\textfont\else       \ifx#1\scriptstyle \fontdimen8\scriptfont\else       1.1\fontdimen8\scriptscriptfont\fi\fi\fi 3   }% } \makeatother  \begin{document}  $AB\newparallel CD$ ${\newparallel}/$  $\scriptstyle AB\newparallel CD$ $\scriptstyle{\newparallel}/$  $\scriptscriptstyle AB\newparallel CD$ $\scriptscriptstyle{\newparallel}/$  {\Large$AB\newparallel CD$ ${\newparallel}/$}  \end{document} 

This is for Computer Modern fonts; for different fonts, \roundcap might be omitted. In the example I show the standard slash to compare the line thickness.

enter image description here


Comments

Popular posts from this blog

Chrome Ipad Extensions Code Example

AngularJS $on Event Handler Trigger Order