11

Mathematical formulas in a PDF from LaTex generate lots of noise while reading it with Text-to-speech software. This is why I would like find a way to make all the set of symbols inside the formulas not selectable.

There is already a package that allows to do that? (It has to work only for formulas if not all the document become inaccessible by text-to-speech)

If not, which is the best way to solve this kind of problem? Writing a new macro or modify how the compiler generate the PDF from Tex?

  • 4
    Welcome to TeX.SX! I have a hunch that the package accsupp will be helpful here. You can give answerers a head-start by providing a minimal working example (MWE) that sets up a document that might be used for testing solutions. – Paul Gessler Apr 26 '15 at 22:06
  • Hi @PaulGessler, thanks for the advices. I had a look to the documentation of the package accsupp but I don't see how/where it can be useful for what I need. Could you give me more information about how to use that? – Massimo Giordano Apr 27 '15 at 06:39
  • 1
    See the accepted answer to this question: http://tex.stackexchange.com/questions/233390/in-which-way-have-fake-spaces-made-it-to-actual-use It shows how to get a copy/paste of PDF formulas to provide the LaTeX code. – Steven B. Segletes Jan 13 '17 at 20:31

1 Answers1

9

The accsupp package can indeed be of some help here.

Consider the following:

\documentclass{article}
\usepackage{accsupp}
\begin{document}

\BeginAccSupp{ActualText=I don't want you to select this text.}
$\sum_{x > 1} x$
\EndAccSupp{}

\BeginAccSupp{ActualText=The sum of all the x greater than 1.}
$\sum_{x > 1} x$
\EndAccSupp{}

\BeginAccSupp{ActualText=Some math}
$\sum_{x > 1} x$
\EndAccSupp{}

\BeginAccSupp{ActualText=}
$\sum_{x > 1} x$
\EndAccSupp{}

\end{document}

Then, when selected, the math equation will actually read a text of your choice ("I don't want you to select this text."), a description of the equation ("The sum of all the x greater than 1."), a simple message ("Some math") or … nothing.

I haven't tried with a text-to-speech software, but I think this should work just as fine.

Clément
  • 5,591
  • 1
    How can we combine the copy-paste fix with giving useful text to a screen reader? The two solutions use the same mechanism so they seem to conflict. – Raphael Feb 03 '17 at 09:23
  • I don't think you can combine those two techniques: what is going to be selectable is precisely what is going to be read, you can't offer two different things at the same time. So, you have to make a choice, I'm afraid… – Clément Feb 03 '17 at 13:36
  • 1
    Too bad. There could conceivably be more than one "alt text" property in PDF; both copy-paste and screen reading are utterly basic functions, and would usually not have the same content. – Raphael Feb 03 '17 at 13:44
  • Honestly: ask the question. You are right, there might be more than one way of adding "alt text" to a pdf, but I don't know if it is the case, nor if it exists. It is an interesting question, though, that could be of practical use. – Clément Feb 03 '17 at 14:20
  • 1