Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
Woudn't that be the alt-text of an image? Also, could you specify that via the OCR layer? –  Canageek Dec 16 '11 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 Dec 17 '11 at 5:41
add comment

1 Answer

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?

share|improve this answer
    
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 Dec 17 '11 at 5:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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