Graphics, Figures & TablesText selectable in Output after clipping

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
hkyz
Posts: 9
Joined: Wed Apr 25, 2012 9:37 am

Text selectable in Output after clipping

Post by hkyz »

I have a TikZ figure whose code I don't want to modify. I want some parts of this figure not to be displayed. So, I add a clipping code at the beginning. However, the texts in the clipped sections are still visible in the produced PDF if selected by mouse.

Consider the following minimal code:

Code: Select all

\documentclass{article}
\usepackage{tikz}

\begin{document}
  \begin{tikzpicture}
    \clip (0,0) rectangle (2,2);
    % Untouchable code begins
    \node at (1,1) {A};
    \node at (3,1) {B};
    % Untouchable code ends
  \end{tikzpicture}
\end{document}
The intention of the code is to clip off B. However, in the produced PDF, one can still select B with mouse.
AandB.jpg
AandB.jpg (1.42 KiB) Viewed 1973 times
How can I make sure that B is completely removed?

Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply