# How to improve my unicode/tikz enabled big integral sign?

I found the following Big integral sign after I asked the (almost?) duplicate Is there a more typographically-satisfying bigints package? and decided that the given solutions are not great. I found the unicode characters U+2320 TOP HALF INTEGRAL implemented as \inttop in unicode-math, U+2321 BOTTOM HALF INTEGRAL implemented as \intbottom so I gave it a quick try in TikZ. (there is also U+23AE INTEGRAL EXTENSION). It looks like this: (line (1) is the normal \int for comparison)

Issues I see-

• too much whitespace on the left and right
• baseline is messed up
• static angle slant causes an intersection with sufficiently large integrands
• the use of \draw[line width = 1pt] is probably not perfect but its very very close in print.
• this is definitely not font agnostic (CMU doesn't even have the symbols) but I'm OK with that.

I decided to try a second time from scratch and I think this is probably closer to a good result (although it isn't currently usable). Its code will follow the code of the first attempt. In this one,

• baseline issue is fixed but not the whitespace(should I just leave a few \!s?)
• static angle is now a problem for short integrands as well
• the unicode character ⎮ seems to be better but I somehow need to implement a for loop to make it connect.

Can someone help me fix these issues? I would greatly appreciate if not a finished product, a good sketch to make a finished command. In particular, I would like to be able to measure the width and height of the integrand to help me set coordinates properly (I've been trying \widthof and \heightof but I can't get them to work nicely), and how to measure the correct angle to rotate my integral sign (I'm not even sure how to schematically do this one)

the code + example output:

\documentclass[leqno]{article}
\usepackage{tikz}
\usepackage{xparse}
\RequirePackage{amsmath,amssymb}
%\usetikzlibrary{calc}
\RequirePackage{unicode-math}
\setmathfont{xits-math.otf}

\NewDocumentCommand{\mybigint}{ m m m }{%
%
\vcenter{\hbox{%
\begin{tikzpicture}[rotate = -15, transform shape]
\tikzstyle text node=[rotate=15]
\node[anchor=west, align=left] (body){$\phantom{ #3 }$};
\node[text node, anchor=west] {$\phantom{#1} #3$};
\node at (body.north west) (top) {$\inttop$};
\node at (body.south west) (bottom) {$\intbottom$};
\draw[black,line width = 1pt] (body.north west) -- (body.south west);
\node[text node] at (bottom.east) {\scriptsize $#1$};
\node[text node, anchor = south] at (top.east) {\sczriptsize $#2$};
\end{tikzpicture}
}}%
%
}

\begin{document}
\begin{align}
\int_A^B f(x) \ \dx +1
&= \int_A^B f(x) \ \dx + 1 \\
&= \mybigint{A}{B}{f(x) \ \dx} +1\\
&= \mybigint{A}{B}{\left[\begin{matrix} 1& 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix}\right] \ \dx}  +1\\
&= \mybigint{A}{B}{\left[\begin{matrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \\ 7 & 8 \end{matrix}\right] \ \dx} +1\\
&= \mybigint{A}{B}{\left[\begin{matrix} 1 \\2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7 \\ 8 \\ 9 \end{matrix}\right] \ \dx} +1\\
&= \mybigint{A}{B}{\left[\begin{matrix} 1 \\2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7 \\ 8 \\ 9  \\ 10 \\ 11 \\ 12 \end{matrix}\right] \ \dx } + 1
\end{align}

%found the symbols at http://www.latex-community.org/forum/viewtopic.php?f=48&t=11764

\end{document}


code for the second attempt:

\NewDocumentCommand{\mybigint}{ m m m }{%
%
\hbox{%
\begin{tikzpicture}[ baseline = 0]
\tikzstyle rotation=[rotate=-15 ]

\node[anchor = base] (body) {$\phantom{ #1 } #3$};
\node[rotation] at (body.north west) (top) {$\displaystyle \inttop$};
\node at (body.south west) (belowtop) {};
\node[rotation] at (belowtop.west) (bottom) {$\intbottom$};
\node[rotation] at ($(top)!0.5!(bottom)$) {$⎮$};
\node[] at (bottom.east) {\scriptsize $\!\!\!\!\!#1$};
\node[anchor = north] at (top.north east) {\scriptsize $\!\!\!\!\!#2$};
\end{tikzpicture}
}%
%
}

• – Henri Menke Jun 13 '16 at 11:31
• Hi @HenriMenke, thanks for the comment. I came across that as well but I don't know how to adapt that for my situation. – Calvin Khor Jun 13 '16 at 19:47