mdframed 옵션에서 색상을 투명/없음으로 명시적으로 설정하는 방법은 무엇입니까?

mdframed 옵션에서 색상을 투명/없음으로 명시적으로 설정하는 방법은 무엇입니까?

배경이 투명하게 유지되도록(또는 "비어 있음"으로 가정) 패키지 backgroundcolor에서 옵션을 명시적으로 설정할 수 있습니까 ?mdframed

그것은 수

\begin{mdframed}[backgrouncolor = ***]
Test
\end{mdframed}

***= no color, 을 사용 empty하지만 {}그 중 어느 것도 작동하지 않습니다.

mdframed 옵션에서 색상을 투명/없음으로 명시적으로 설정할 수 있습니까?


편집하다

더 명확하게 말하면 ***다음과 같은 값이 있습니까?

\begin{mdframed}[backgrouncolor = ***]
Test
\end{mdframed}

그리고

% assuming no global options have been set
\begin{mdframed}
Test
\end{mdframed}

동등합니까?

답변1

질문을 잘 이해하지 못해서 세 가지 가능한 답변을 제시합니다.

첫 번째 옵션:

\mdfsetup전역 설정을 정의하는 데 사용할 수 있습니다 .

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}

\mdfsetup{backgroundcolor=red!20}

\begin{document}

\begin{mdframed}
test
\end{mdframed}

\end{document}

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

두 번째 옵션:

기본적으로 초기 구성에서는 mdframed배경색을 로 설정 white하므로

\begin{mdframed}[backgroundcolor=white]
test
\end{mdframed}

그리고

\begin{mdframed}
test
\end{mdframed}

동등하다; 기본 배경색은 실제로 투명하지 않고 흰색이며 배경색의 불투명도를 설정하는 미리 정의된 키가 없습니다(투명도 문제에 대한 해결 방법은 tcolorbox아래 세 번째 옵션 참조).

예:

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}

\begin{document}

\begin{mdframed}[backgroundcolor=white]
test
\end{mdframed}

\begin{mdframed}
test
\end{mdframed}

\end{document}

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

동등합니다.

세 번째 옵션:

mdframed배경 불투명도를 설정하는 방법을 제공한 기억이 없습니다 (그러나 제가 틀렸을 수도 있습니다). 와 함께tcolorbox를 사용하여 배경 및/또는 프레임 불투명도를 제어할 수 있습니다 opacityframe=<value>. opacityback=<value>( 0완전히 투명함을 의미하고 1불투명함을 의미함) 작은 예( \pagecolor{cyan!10}opcity 효과를 표시하는 데에만 사용됨):

\documentclass{article}
\usepackage{tcolorbox}

\pagecolor{cyan!10}
\begin{document}

\begin{tcolorbox}[
  standard jigsaw,
  opacityframe=0.5,
  opacityback=0.2
]
test
\end{tcolorbox}

\end{document}

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

답변2

간단하고 "불법적인" 솔루션

를 사용해야 합니다 backgroundcolor = none. none종료되지 않기 때문에 이는 "불법적인 솔루션"입니다 . 그래서, backgroundcolor = none같은 backgroundcolor = frogs...

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}

\begin{document}
\pagecolor{yellow}
\begin{mdframed}[backgroundcolor = none]
Test
\end{mdframed}
\end{document}

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

복잡하고 "합법적인" 솔루션

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}

\begin{document}
\pagecolor{yellow}
\begin{mdframed}[apptotikzsetting={%
    \tikzset{mdfbackground/.append style={fill=red,fill opacity=0}}}]
Test
\end{mdframed}

\end{document}

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

관련 정보