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 2013 times
How can I make sure that B is completely removed?

Thanks.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply