
我正在使用 minipage 將圖形分為兩個位置,左邊有一個用 pgf-pie 製作的圖形,我希望大文本能夠在外部書寫,對於文本,我希望它是在中心(請參見圖片)
\documentclass[12pt,a4paper]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{pgf-pie}
\begin{document}
\section{example}
\hrule
\begin{figure}[!h]
\begin{minipage}[b]{0.3\textwidth}
\caption{Example}\label{fig:ex1}
\begin{tikzpicture}[scale=0.7]
\pie[/tikz/nodes={text=white, font=\footnotesize\bfseries},
text=inside,
explode={0.1,0.1,0.1,0.1},color={blue!70,cyan!70,red!70,orange!50}]{9.3/Cedro\\rojo, 19.45/Café, 30.4/Cacao, 40.43/Tornillo }
\end{tikzpicture}
\end{minipage}\hfill\vrule\hfill
\begin{minipage}[b]{0.6\textwidth}
vallis augue. Etiam facilisis. Nunc elementum fermen-
tum wisi. Aenean placerat. Ut imperdiet, enim sed
gravida sollicitudin, felis odio placerat quam, ac pul-
vinar elit purus eget enim. Nunc vitae tortor. Proin
tempus nibh sit amet nisl. Vivamus quis tortor vitae
risus porta vehicula.
\end{minipage}
\end{figure}
\hrule
\end{document}
記得查看論壇上的其他答案,它似乎不受支援。論壇
答案1
使用該
[b]
選項可以強制小型頁面底部對齊。如果這不是您想要的,請不要使用此選項您可以使用普通的 tikz 節點手動將文字新增至餅圖之外
\documentclass[12pt,a4paper]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{pgf-pie}
\begin{document}
\section{example}
\hrule
\begin{figure}[!h]
\begin{minipage}{0.45\textwidth}
\caption{Example}\label{fig:ex1}
\centering
\begin{tikzpicture}[scale=0.7]
\pie[/tikz/nodes={text=white, font=\footnotesize\bfseries},
text=inside,
explode={0.1,0.1,0.1,0.1},color={blue!70,cyan!70,red!70,orange!50}]{9.3/, 19.45/Café, 30.4/Cacao, 40.43/Tornillo }
\node[align=center,font=\footnotesize] at (4.2,0.8) {Cedro\\rojo};
\end{tikzpicture}%
\end{minipage}\hfill\vrule\hfill
\begin{minipage}{0.5\textwidth}
vallis augue. Etiam facilisis. Nunc elementum fermen-
tum wisi. Aenean placerat. Ut imperdiet, enim sed
gravida sollicitudin, felis odio placerat quam, ac pul-
vinar elit purus eget enim. Nunc vitae tortor. Proin
tempus nibh sit amet nisl. Vivamus quis tortor vitae
risus porta vehicula.
\end{minipage}%
\end{figure}
\hrule
\end{document}