Graphics, Figures & TablesRemoving a Segment of a Frame

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
niles
Posts: 92
Joined: Mon Dec 01, 2008 9:35 pm

Removing a Segment of a Frame

Post by niles »

Hi

I have the following MWE in PSTricks, showing a rectangle.

Code: Select all

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks}

\begin{document}
  \begin{pspicture}[showgrid=true](5,5)
    \psframe(4,4)
  \end{pspicture}
\end{document}
What I would like to is to remove the part of the right side spanned by the coordinates (4,1) and (4,3). What is the easiest way to achieve this? I could of course just superimpose a white line, but that seems like ... uhm ... not the right way.

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
mayankmi
Posts: 45
Joined: Sat Apr 20, 2013 7:52 pm

Removing a Segment of a Frame

Post by mayankmi »

The code snippet you put is not even running. Please provide correct code.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Removing a Segment of a Frame

Post by Johannes_B »

The code is running fine, did you remember to run latex or xelatex instead of pdflatex?

Regarding the question, I don't think my first suggestion is very comfortable, but it works (I'm more of a TikZ user). To put a white line above this part of the rectangle you need to know the line width. Or just put another rectangle above it.

Code: Select all

%latex or xelatex
\documentclass{article}
\usepackage{pstricks}

\begin{document}
  \begin{pspicture}[showgrid=true](5,5)
    \psline(4,3)(4,4)(0,4)(0,0)(4,0)(4,1)
  \end{pspicture}

  \begin{pspicture}
    \psframe(4,4)
    %\psline[linewidth=1pt,linecolor=white](4,1)(4,3)
    \psframe[linecolor=white,fillstyle=solid ](3.8,1)(4.2,3)
  \end{pspicture}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Removing a Segment of a Frame

Post by localghost »

Just for information to other users for awareness of possibly already existing solutions. The question has also been posted to {TeX} SX and has got an accepted answer. Please read what our administrator thinks about that.
Board Rules wrote:A crossposting is always contra-productive. But there is nothing really against it as long as it is mentioned. This means that a direct link has to be added. So other users who want to help are preserved from double efforts and waste of time.
This kind of x-posting represents a direct violation of our rules and has to be prevented absolutely in future questions.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply