2
$\begingroup$

Mathpix is a tool which can covert $\TeX$ image to $\TeX$ expression, they also say they can return a string which is compatible with the Wolfram Alpha engine if possible.

I found their documentation and did such an attempt:

doc: https://docs.mathpix.com/#processing-a-single-image

img = Import@"https://raw.githubusercontent.com/Mathpix/api-examples/master/images/limit.jpg";
base64 = ExportString[ExportString[img, "JPEG"], "Base64"];
HTTPRequest[
    "https://api.mathpix.com/v3/latex",
    <|
        "Method" -> "POST",
        "Headers" -> {
            "app_id" -> "trial",
            "app_key" -> "34f1a4cea0eaca8540c95908b4dc84ab",
            "Content-type" -> "application/json"
        },
        "Body" -> {
            "src" -> "data:image/jpg;base64," <> base64,
            "format" -> <|"wolfram" -> True|>
        }
    |>
] // URLExecute[#, "RawJSON"]&

Then Mathematica kept asking me to input Authentication Require, and no matter what I do with that, it always return:

<|
    "error" -> "Invalid credentials",
    "error_info" -> <|
        "id" -> "http_unauthorized",
        "message" -> "Invalid credentials"
    |>
|>

I don't know what Authentication Require is, can I avoid jumping out of that verification.

$\endgroup$
2
$\begingroup$

Try Mathpix API in Mathematica

https://github.com/Moe-Net/Mathpix

$\endgroup$
  • $\begingroup$ Isn't that created by the very same person who asked the question above? :-) $\endgroup$ – Szabolcs Apr 5 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.