5

I'd like to be able of copy & pasting the results of a picture environment in a PDF file to a plain text file.

The problem is that once I copy the text the results are unsatisfactory: for example, if the picture consists solely of lines, there's nothing to be selected to begin with.

To give you a MWE:

\documentclass{article}
\begin{document}
  This is the standard Shogi board:

  \bigskip
  \setlength{\unitlength}{18pt}
  \centering
  \begin{picture}(9,9)
    \multiput(0,0)(1,0){10}{\line(0,1){9}}
    \multiput(0,0)(0,1){10}{\line(1,0){9}}
  \end{picture}
\end{document}

The result looks something like:

The resulting PDF

I'd like the actual board to be selectable, copyable and the resulting pasted text to be something like:

+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+

I don't pretend the solution to figure this out by itself, but rather allow me to specify what should be the text representation of a picture (or an otherwise "graphical") element.

2
  • Woudn't that be the alt-text of an image? Also, could you specify that via the OCR layer?
    – Canageek
    Commented Dec 16, 2011 at 23:14
  • I don't know about the OCR layer and how to access it... care to explain? Indeed, this would be like an alt text for a picture environment :)
    – mpr
    Commented Dec 17, 2011 at 5:41

1 Answer 1

1

I think you can provide alternate text for your image: While I'm not enough of a TeX guru to understand how to do it, but this answers can probably provide a starting point: Is it possible to provide alternative text to use when copying text from the PDF?

Possibly also of interest as it discusses alternate text: Why can't "fi" be separated when being copied from a compiled pdf?

1
  • Both of those links deal with having text copy&pasted correctly... I'm dealing with images (pictures) and can't see how to (straightforwardly, at least) extrapolate those answers to my particular problem.
    – mpr
    Commented Dec 17, 2011 at 5:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .