패딩이 없는 \fbox

패딩이 없는 \fbox

안녕하세요 . \fbox{}. figure그래픽에 흰색 부분이 있으므로 더 잘 볼 수 있도록 테두리를 추가하고 싶습니다. 그러나 나는 그것이 \fbox{}내가 좋아하지 않거나 원하지 않는 그래픽에 패딩을 추가한다는 것을 인식했습니다. 그래픽이 "끝나는" 위치(또는 +1px)에 테두리를 추가하고 싶습니다.

설명을 위해 다음은 내 코드입니다.

\documentclass{report}
\usepackage{xcolor}
\newcommand\crule[3][black]{\textcolor{#1}{\rule{#2}{#3}}}
\begin{document}

  \crule[yellow]{2cm}{1cm} 

  \fbox{\crule[yellow]{2cm}{1cm}}

\end{document}

나에게 이것을 제공합니다 :

분명히 내 적절한 코드에는 s.th가 있습니다. \fbox{\includegraphics[width=0.28\textwidth] {img/file.ext}}노란색 상자 안에 이렇게 들어있어요.

프레임 내부의 패딩을 제거하는 방법에 대한 아이디어가 있습니까?

답변1

테두리는 길이에 따라 결정됩니다 \fboxsep.

\documentclass{report}
\usepackage{xcolor}
\newcommand\crule[3][black]{\textcolor{#1}{\rule{#2}{#3}}}
\begin{document}

\crule[yellow]{2cm}{1cm}

\setlength{\fboxsep}{0pt}\fbox{\crule[yellow]{2cm}{1cm}}

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보