
스케치:
스케일링을 하려고 했는데간트 차트Beamer 프레젠테이션에 맞추기 위해.
프레젠테이션 직사각형보다 큰 간트 차트가 있다고 가정해 보겠습니다.
\begin{figure}
\begin{gantt}{20}{20}
\begin{ganttitle}
\numtitle{2012}{1}{2016}{4}
\end{ganttitle}
%% lots of activities
\ganttbar{1}{0}{3}
...
...
\ganttbar{1}{0}{19}
%% lots of activities
\end{gantt}
\end{figure}
질문: 비머 프레임에 고정하기 위해 이 그림의 크기를 어떻게 조정할 수 있나요?
예: PNG 이미지를 사용하고 있다면 반드시 다음과 같이 만들 것입니다.
\begin{figure}
\includegraphic[scale=0.5]{mypngpic.png}
\end{figure}
하지만 간트 환경에서는(적어도 나는 아직 모른다)확장하는 방법.
답변1
TikZ를 기반으로 하기 때문에 gantt
외부에서 스케일을 강제하는 것도 가능합니다. 코드를 주의깊게 확인하지는 않았지만 환경에 직접 옵션을 제공할 가능성이 있을 수도 있습니다 gantt
. 자체 키 시스템이 있지만 규모 옵션을 인식하지 못했습니다.
\documentclass{article}
\usepackage{gantt}
\begin{document}
\tikzset{every picture/.style={yscale=0.3,transform shape}}
\begin{gantt}{5}{12}
\begin{ganttitle}
\numtitle{2012}{1}{2014}{4}
\end{ganttitle}
%% lots of activities
\ganttbar{1}{0}{3}
\ganttbar{1}{0}{10}
%% lots of activities
\end{gantt}
\tikzset{every picture/.style={yscale=1,transform shape}}
\begin{gantt}{5}{12}
\begin{ganttitle}
\numtitle{2012}{1}{2014}{4}
\end{ganttitle}
%% lots of activities
\ganttbar{1}{0}{3}
\ganttbar{1}{0}{10}
%% lots of activities
\end{gantt}
\end{document}
또 다른 TikZ 기반 패키지가 있다는 점도 참고하세요.
pgfgantt
.
답변2
\begin{gantt}{20}{20}......\end{gantt}
파일 사이에 내용을 넣으십시오 myganttfig1.tex
. 그런 다음 기본 tex 파일에서 \resizebox
다음과 같이 사용하십시오.
%=========================
\begin{figure}[htb]
\centering{
\resizebox{0.62\textwidth}{!}{\input{myganttfig1.tex}}}
\caption{your caption \label{fig:mygantt1}
\end{figure}
%===========================
필요에 따라 너비 0.62\textwidth
와 높이를 변경할 수 있습니다. !
이 매개변수는 {!}
종횡비를 그대로 유지하면서 높이가 결정되도록 합니다.
Gonzalo가 자신의 의견에서 관찰했듯이 이 특별한 경우에는 높이와 너비를 모두 사용하는 것이 더 적합합니다.