
을 사용하여 포스터를 만들고 있습니다 beamerposter
. 블록 안의 텍스트에는 항상 왼쪽 여백이 없는 것 같습니다. 누구든지 블록에 왼쪽 여백을 도입하는 방법을 말해 줄 수 있습니까?
다음은 블록이 어떻게 보이는지에 대한 샘플입니다. 텍스트는 왼쪽 여백 없이 시작됩니다.
블록 내에서 왼쪽, 오른쪽, 위쪽, 아래쪽 여백을 정의하는 방법을 알려주면 좋을 것 같습니다. 중첩된 블록은 환경 이름이 다르지만 중첩된 블록이 있다는 점에 유의하세요(저는 그때 호출했습니다 insideBlocks
). 따라서 나는 block
환경에 대한 마진이 내 환경에 대한 마진에 영향을 미치는 것을 원하지 않습니다 insideBlocks
.
내가 분명하길 바랍니다.
답변1
나는 이것이 여러 가지 방법으로 달성될 수 있다고 생각한다. 한 가지 가능성은 다음과 같이 사용자 지정 여백을 사용하여 새 블록 환경을 정의하는 것입니다.
\documentclass{beamer}
\usetheme{Frankfurt}
\newenvironment<>{myblock}[1]{%
\begin{actionenv}#2%
\def\insertblocktitle{\leftskip=10pt\rightskip=10pt\vspace{10pt} #1\vspace{10pt}}%
\par%
\usebeamertemplate{block begin}\leftskip=10pt\rightskip=10pt\vspace{10pt}}
{\par\vspace{10pt}\usebeamertemplate{block end}
\end{actionenv}}
\begin{document}
\begin{frame}
\begin{myblock}{example title to show 10pt up, down, left and right margins}
example text to show 10pt up, down, left and right margins
\end{myblock}
\begin{block}{example title to show standard margins}
example text to show standard margins
\end{block}
\end{frame}
\end{document}
새로운 환경에서는 (나는 이것을이라고 불렀습니다 ) myblock
여백 을 설정하는 데 사용됩니다 . 예를 들어 모든 것을 10pt로 설정했습니다. 예를 들어 오른쪽 여백을 원하지 않는 경우 코드에서 를 제거하면 됩니다. 에서 등을 제거하고 싶지 않은 경우 제목 텍스트 여백도 사용자 정의하고 싶다고 가정했습니다 . 결과는 다음과 같습니다
\leftskip
\rightskip
\vspace
rightskip
leftskip
\def\insertblocktitle{}
또 다른 가능성은 tcolorbox
다음과 같이 여백을 설정할 수 있는 패키지를 사용하는 것입니다.
\documentclass{beamer}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbset{ % custom tcolorbox
skin=enhanced,
frame style={fill=blue}, % sets the frame color
bottom=10pt, % distance between the body text and the bottom frame
top=10pt, % distance between the body text and the top frame
left=10pt,
right=10pt,
boxrule=0pt, % frame width
bottomtitle=10pt, % distance between the title text and the bottom title frame
toptitle=10pt, % distance between the title text and the top title frame
lefttitle=10pt, % title text left margin
righttitle=10pt
}
\begin{document}
\begin{frame}
\begin{tcolorbox}[title=test]
test
\end{tcolorbox}
\end{frame}
\end{document}
결과는 다음과 같습니다
편집: 수정 여부 에 beamerposter
관계없이 작동하기 때문에 예제 코드에 패키지를 추가하지 않았습니다 .beamer
beamerposter
답변2
tcolorbox 내부 테마의 향후 버전 v0.3을 사용할 수 있습니다(https://www.ctan.org/pkg/beamertheme-tcolorbox). 이 테마를 사용하면 중첩된 블록이 자동으로 주변 블록보다 약간 작아집니다.
\documentclass{beamer}
\usetheme{Warsaw}
\usepackage[size=a4,orientation=portrait]{beamerposter}
\useinnertheme{tcolorbox}
\begin{document}
\begin{frame}
\begin{block}{title}
content...
\begin{block}{title}
content...
\end{block}
\end{block}
\end{frame}
\end{document}