'PDF'에 해당되는 글 1건

  1. 2009.09.27 LaTeX 컴파일 시 용지 크기 설정
CS 전공/논문 쓰기2009. 9. 27. 16:35
미국애들이 쓰는 용지 크기는 USLetter이고, 한국은 A4이고... 용지 차이로 인해 컴파일시 제대로 
용지 크기에 맞추어서 행간이 적절히 설정이 안되는 문제가 있다.  PDF LaTeX를 이용하여 컴파일 한다면, 아래대로 처리하자. 

아래의 글은 (Andrew J. Norman이 작성한 http://physics.wm.edu/~norman/latexhints/pdf_papersize.html)에서 발췌하였다. 

When compiling a document using pdflatex (under the default installation of teTeX) the papersize (page size) may be set incorrectly if calls to the Vmargin or Vpage packages are used.

The resulting page size will normally be set to an A4 default (210x297mm or roughly 8.24x11.71in) with appropriate margins. This behavior is caused by page defaults both in the pdftex configuration file and in the Vmargin style file. To correct this you should perform the following modification:
In pdftex.cfg ($TEXBASE/texmf/pdftex/config/pdftex.cfg) remove or modify the lines:

page_width 210truemm
page_height 297truemm

So that they correspond to your desired default pagesize. An example entry for letter sized paper would read:

page_width 8.5truein
page_height 11.0truein

Additionally in the Vmargin style file ($TEXBASE/texmf/tex/latex/misc/Vmargin.sty) at or around line 225 you should change the following default settings so that they reflect the correct default paper size and margins:

%
% DEFAULTS:
%
\setpapersize{A4}
\setmarginsrb{35mm}{20mm}{25mm}{15mm}{12pt}{11mm}{0pt}{11mm}

For example changing this to read:

%
% DEFAULTS:
%
\setpapersize{USletter}
\setmarginsrb{1in}{1in}{1in}{1in}{0pt}{0mm}{0pt}{0mm}

Will set up the default page layout to be the standard USLetter (8.5x11.0in) with 1 inch margins and no headers or footers.

It should be noted that for some reason calls to \setpapersize{} that are made within the document seem to be ignored by pdflatex. Even so, it is advised that you include a proper \setpagesize{} and \setmarginsrb{} call so that pagesize can be controlled when building documents with the standard latex package.

If you are constructing your PDF files via conversion of a postscript document that was produced using dvips, then you should additionally check to make sure that your postscript config file ($TEXBASE/texmf/dvips/config/config.ps) is set up to default to a USLetter (8.5in by 11.0in) bounding box. If you see the following: 

@ A4size 210mm 297mm
@+ %%PaperSize: A4

@ letterSize 8.5in 11in

@ letter 8.5in 11in
@+ %%BeginPaperSize: Letter
@+ letter
@+ %%EndPaperSize

In the config.ps file then the A4 bounding box is used incorrectly in place of the letter bounding box, resulting in documents that are typeset to a USLetter layout but are generated with an A4 canvas. To correct the situation comment out the first two A4size lines so that the file appears as: 

% @ A4size 210mm 297mm
% @+ %%PaperSize: A4

@ letterSize 8.5in 11in

@ letter 8.5in 11in
@+ %%BeginPaperSize: Letter
@+ letter
@+ %%EndPaperSize

This will now generate the proper bounding box for letter defaults.

또한, 아래의 방법도 확인해 두자. 아래는 ifpdf 패키지를 이용하여,  PDF TeX로 컴파일 할 경우 용지 크기를 설정한다.

\usepackage{ifpdf}

\ifpdf % set page size.

\setlength{\pdfpagewidth}{8.5in}

\setlength{\pdfpageheight}{11in}

\else

\fi


Posted by Bart