
Beamer 슬라이드의 MWE는 다음과 같습니다.
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes,calc}
\usetheme{Singapore}
\begin{document}
\begin{frame}
\begin{tikzpicture}[node distance=15mm, >=latex',
block/.style = {draw, rectangle, minimum height=10mm, minimum width=28mm,align=center},]
\node [block] (dose_reduction) {Dose reduction};
\node [block, below left=of dose_reduction] (filtering) {Filtering techniques};
% issues with either of these lines
%\node [block, below right=of dose_reduction] (reconstruction) {Reconstruction techniques};
\node [block, right=of filtering] (reconstruction) {Reconstruction techniques};
\draw[->] (filtering) edge (dose_reduction);
\draw[->] (reconstruction) edge (dose_reduction);
\end{tikzpicture}
\end{frame}
\end{document}
위쪽 상자를 가로 중앙에 배치하고 싶습니다. 또한 왼쪽 슬라이드 가장자리에서 왼쪽 상자까지의 거리는 오른쪽 슬라이드 가장자리에서 오른쪽 상자까지의 거리만큼 커야 합니다. 두 가지 변형을 시도했지만 아무 것도 효과가 없었습니다.
답변1
가장 간단한 방법은 아마도 노드 below right
와 상위 노드의 below left
앵커 를 배치하여 .south
하위 블록을 기준으로 상위 블록의 중심을 맞추는 것입니다.
프레임을 기준으로 위쪽 블록을 중앙에 배치하려면 아래쪽 블록을 먼저 그린 다음 현재 경계 상자를 기준으로 위쪽 블록을 중앙에 배치하는 것이 가장 쉽습니다.
arrows.meta
또한 더 이상 사용 되지 않는 라이브러리 대신 사용할 구문을 업데이트했습니다 arrows
.
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
\usetheme{Singapore}
\begin{document}
\begin{frame}
\centering
\begin{tikzpicture}[node distance=15mm, >=Latex,
block/.style = {draw, rectangle, minimum height=10mm, minimum width=28mm,align=center},]
\node [block] (dose_reduction) {Dose reduction};
\node [block, below left=of dose_reduction.south] (filtering) {Filtering techniques};
\node [block, below right=of dose_reduction.south] (reconstruction) {Reconstruction techniques};
\draw[->] (filtering) edge (dose_reduction);
\draw[->] (reconstruction) edge (dose_reduction);
\end{tikzpicture}
\end{frame}
\begin{frame}
\centering
\begin{tikzpicture}[node distance=15mm, >=Latex,
block/.style = {draw, rectangle, minimum height=10mm, minimum width=28mm,align=center},]
\node [block] (filtering) {Filtering techniques};
\node [block, right=of filtering] (reconstruction) {Reconstruction techniques};
\node [block, above=of filtering.north -| current bounding box.center] (dose_reduction) {Dose reduction};
\draw[->] (filtering) edge (dose_reduction);
\draw[->] (reconstruction) edge (dose_reduction);
\end{tikzpicture}
\end{frame}
\end{document}
두 슬라이드의 그림은 를 사용하여 프레임을 기준으로 중앙에 배치됩니다 \centering
. 첫 번째 프레임은 아래쪽 블록을 기준으로 위쪽 블록의 중심을 지정합니다.
두 번째 프레임은 프레임을 기준으로 위쪽 블록의 중심을 지정합니다.