development

라텍스-몇 페이지의 여백 변경

big-blog 2020. 11. 6. 21:02
반응형

라텍스-몇 페이지의 여백 변경


몇 페이지 (그래픽을 많이 추가하는 페이지)의 여백 만 변경해야하는 Latex 문서가 있습니다.

특히 상단 여백 ( \voffset) 을 변경하고 싶습니다 . 나는 시도했다 :

\addtolength{\voffset}{-4cm}

% Insert images here

\addtolength{\voffset}{4cm}

하지만 작동하지 않았습니다. 지오메트리 패키지에 대한 참조는 보았지만 전체 문서가 아닌 여러 페이지에 사용하는 방법을 찾지 못했습니다.

힌트가 있습니까?


나는 이것을에서 사용 beamer했지만 일반 문서에는 사용하지 않았지만 원래 힌트에서 제안하는 것처럼 보입니다.

\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}

그런 다음 사용하려면

\begin{changemargin}{-1cm}{-1cm}

잊지 마세요

\end{changemargin}

페이지 끝에

나는 TeX FAQ의 "즉석에서"마진 변경 에서 이것을 얻었습니다 .


"geometry"패키지를 사용하고 \newgeometry{left=3cm,bottom=0.1cm}여백을 변경할 위치를 작성 하십시오. 여백을 재설정하려면 \restoregeometry.


페이지 상단과 하단에있는 \ vspace {-Xmm}를 포함하여 다양한 솔루션과 경고 및 오류 처리로 많은 어려움을 겪었습니다. 마지막으로이 답변을 찾았습니다.

하나 이상의 페이지의 여백을 변경 한 다음 기본값으로 복원 할 수 있습니다.

\usepackage{geometry}
...
... 
...
\newgeometry{top=5mm, bottom=10mm}     % use whatever margins you want for left, right, top and bottom.
...
... %<The contents of enlarged page(s)>
...    
\restoregeometry     %so it does not affect the rest of the pages.
...
... 
...

추신:

1- 또한 다음 경고를 수정할 수 있습니다.

LaTeX 경고 : 입력 행에서 ... pt 단위로 페이지에 대해 부동이 너무 큼 ...

2- 자세한 답변은 여기를 참조 하십시오 .

3- 나는 이것이 Kevin Chen의 대답에 대한 더 정교하다는 것을 알았습니다.


\par\vfill\break % Break Last Page

\advance\vsize by 8cm % Advance page height
\advance\voffset by -4cm % Shift top margin
% Start big page
Some pictures
% End big page
\par\vfill\break % Break the page with different margins

\advance\vsize by -8cm % Return old margings and page height
\advance\voffset by 4cm % Return old margings and page height

For figures you can use the method described here :
http://texblog.net/latex-archive/layout/centering-figure-table/
namely, do something like this:

\begin{figure}[h]
\makebox[\textwidth]{%
        \includegraphics[width=1.5\linewidth]{bla.png}
    }
\end{figure}

Notice that if you have subfigures in the figure, you'll probably want to enter into paragraph mode inside the box, like so:

\begin{figure}[h]
\makebox[\textwidth]{\parbox{1.5\textwidth}{ %
\centering
\subfigure[]{\includegraphics[width=0.7\textwidth]{a.png}}
\subfigure[]{\includegraphics[width=0.7\textwidth]{b.png}}
\end{figure}

For allowing the figure to be centered in the page, protruding into both margins rather than only the right margin.
This usually does the trick for images. Notice that with this method, the caption of the image will still be in the delimited by the normal margins of the page (which is a good thing).


A slight modification of this to change the \voffset works for me:

\newenvironment{changemargin}[1]{
  \begin{list}{}{
    \setlength{\voffset}{#1}
  }
  \item[]}{\end{list}}

And then put your figures in a \begin{changemargin}{-1cm}...\end{changemargin} environment.


Look up \enlargethispage in some LaTeX reference.


I had the same problem in a beamer presentation. For me worked using the columns environment:

\begin{frame}
  \begin{columns}
    \column{1.2\textwidth}
    \begin{figure}
      \subfigure{\includegraphics[width=.49\textwidth]{1.png}}
      \subfigure{\includegraphics[width=.49\textwidth]{2.png}}
    \end{figure}
   \end{columns}
\end{frame}

I could not find a easy way to set the margin for a single page.

My solution was to use vspace with the number of centimeters of empty space I wanted:

 \vspace*{5cm}                                                             

I put this command at the beginning of the pages that I wanted to have +5cm of margin.

참고URL : https://stackoverflow.com/questions/1670463/latex-change-margins-of-only-a-few-pages

반응형