
일부 프로젝트의 경우 여백 없이 한 페이지의 PDF를 만들어야 합니다. 왼쪽, 오른쪽 및 위쪽 여백은 0으로 설정하기 쉽지만 내부 내용의 정확한 높이를 얻으려면 pdf도 필요하므로 최종 vbox 깊이의 아래쪽을 잘라야 합니다. 나는 이를 위해 LuaTeX를 사용하고 있으며 PDF의 수직 절단이 별도의 스크립트에서 수행되는 것이 가장 좋습니다(원하는 PDF를 생성하려면 여러 패스가 필요하므로).
내가 생각하는 것은 aux 파일의 최종 상자 깊이의 절대 높이를 출력한 XXXcutAt:10cm
다음 aux 파일을 구문 분석하고 이 값을 pdfcrop
스크립트에 전달하는 것입니다.
하지만 이 값을 알 수 있는 가장 좋은 방법은 잘 모르겠습니다. 제가 놓친 값을 얻을 수 있는 확실한 TeX 전용 방법이 있습니까? 그렇지 않은 경우 LuaTeX 매뉴얼을 읽는 것이 pdf.v
내가 원하는 것 같지만 사용 방법에 대해 약간 의아해합니다. 이를 사용하여 예제로 사용할 수 있는 코드가 있습니까?
답변1
이것은 일반 텍스이지만 라텍스에서도 동일한 작업을 수행할 수 있습니다.
\setbox0=\vbox{\hsize=7.8cm
some text to fill out several lines of a paragraph with a high
proportion of g and y and f so that the depth is non zero
some text to fill out several lines of a paragraph with a high
proportion of g and y and f so that the depth is non zero
some text to fill out several lines of a paragraph with a high
proportion of g and y and f so that the depth is non zero
some text to fill out several lines of a paragraph with a high
proportion of g and y and f so that the depth is non zero
some text to fill out several lines of a paragraph with a high
proportion of g and y and f so that the depth is non zero
some text to fill out several lines of a paragraph with a high
proportion of g and y and f so that the depth is non zero}
\hoffset-1in
\voffset-1in
%asuming luatex 0.80 or older
\pdfpagewidth\wd0
\pdfpageheight\dimexpr\ht0+\dp0\relax
\shipout\box0
\bye