Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to render "closed square roots"? #60

Open
coronel-kittycannon opened this issue Sep 30, 2019 · 0 comments
Open

How to render "closed square roots"? #60

coronel-kittycannon opened this issue Sep 30, 2019 · 0 comments

Comments

@coronel-kittycannon
Copy link

This article describes how it is possible in LaTeX to render a "closed square root".
I would like to draw one myself, but the code provided does not work. I suppose I am doing something wrong, because I literally started using this library today.

This is the LaTeX code provided by the article

% New definition of square root:
% it renames \sqrt as \oldsqrt
\let\oldsqrt\sqrt
% it defines the new \sqrt in terms of the old one
\def\sqrt{\mathpalette\DHLhksqrt}
\def\DHLhksqrt#1#2{%
\setbox0=\hbox{$#1\oldsqrt{#2\,}$}\dimen0=\ht0
\advance\dimen0-0.2\ht0
\setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
{\box0\lower0.4pt\box2}}

image

This is the result from the article. I am thinking I could just do something like...

TeXFormula fx = new TeXFormula("% New definition of square root:\r\n" + 
				"% it renames \\sqrt as \\oldsqrt\r\n" + 
				"\\let\\oldsqrt\\sqrt\r\n" + 
				"% it defines the new \\sqrt in terms of the old one\r\n" + 
				"\\def\\sqrt{\\mathpalette\\DHLhksqrt}\r\n" + 
				"\\def\\DHLhksqrt#1#2{%\r\n" + 
				"\\setbox0=\\hbox{$#1\\oldsqrt{#2\\,}$}\\dimen0=\\ht0\r\n" + 
				"\\advance\\dimen0-0.2\\ht0\r\n" + 
				"\\setbox2=\\hbox{\\vrule height\\ht0 depth -\\dimen0}%\r\n" + 
				"{\\box0\\lower0.4pt\\box2}}");

...but it doesn't work. Please help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant