이것은 너무 일반적인 질문이어서 이 질문을 직접적으로 다룬 보관된 게시물을 쉽게 찾을 수 없었습니다.
저는 LaTeX를 사용하여 그림과 소량의 텍스트가 포함된 단면 시트를 디자인하는 데 관심이 있습니다. 아래에 특정 레이아웃을 염두에 두고 있습니다. 나는 이러한 영역을 그리고, 이에 맞게 그래픽(그래프/로고)을 자르고, 그려진 경계 영역을 벗어나지 않는 텍스트를 배치할 수 있기를 원합니다.
어떻게 그렇게 할 수 있습니까? 나는 PDF를 생성하고 정보를 반복하여 수백 개의 문서를 생성하기를 희망하기 때문에 라텍스를 사용하고 있습니다.
답변1
당신은 사용할 수 있습니다텍스트포스 패키지페이지에 개체(텍스트 및 그림)를 배치합니다.
답변2
실험으로서, 그리고 그 대답을 기초로 삼아프랭크 미텔바흐에서 언급된스캇 H님의 의견을 듣고 처음으로 사용하기로 결정했습니다.xcoffins
패키지에 대한 결과는 다음과 같습니다(분명히 수행할 수 있는 개선 사항이 많이 있지만 시작점으로 사용할 수 있음).
\documentclass{article}
\usepackage[landscape,paperwidth=19cm]{geometry}
\usepackage{xcolor}
\usepackage{xcoffins}
\usepackage{lipsum}
\newlength\GraphWd
\setlength\GraphWd{2.5cm}
\pagestyle{empty}
\definecolor{mycolor}{RGB}{134,34,0}
\begin{document}
% upper coffins
\NewCoffin \result
\NewCoffin \Title
\NewCoffin \Date
\NewCoffin \Logo
% lateral info coffin
\NewCoffin \Info
% 10 small graph coffins
\NewCoffin \Graph
\NewCoffin \Graphi
\NewCoffin \Graphii
\NewCoffin \Graphiii
\NewCoffin \Graphiv
\NewCoffin \Graphv
\NewCoffin \Graphvi
\NewCoffin \Graphvii
\NewCoffin \Graphviii
\NewCoffin \Graphix
\NewCoffin \Graphx
% 1 wider graph coffin
\NewCoffin \LGraph
% filling the coffins
\SetHorizontalCoffin \result {}
\SetHorizontalCoffin \Graph {}
\SetHorizontalCoffin \Title {\Large\bfseries Document title}
\SetHorizontalCoffin \Date {\Large\bfseries Document date}
\SetHorizontalCoffin \Logo {\color{mycolor}\rule{4cm}{2cm}}
\SetVerticalCoffin\Info {4cm} {\noindent\raggedright\lipsum[6]}
\SetHorizontalCoffin \LGraph {\Large\color{mycolor}\rule{\dimexpr5\GraphWd+12pt\relax}{2cm}}
\SetHorizontalCoffin \Graphi {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphii {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphiii {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphiv {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphv {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphvi {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphvii {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphviii {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphix {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
\SetHorizontalCoffin \Graphx {\Large\color{mycolor}\rule{\GraphWd}{\GraphWd}}
% put the smaller graph coffins in a 2x5 array inside \Graph
\JoinCoffins \Graph \Graphi
\JoinCoffins \Graph [\Graphi-vc,\Graphi-r] \Graphii[vc,l](3pt,0pt)
\JoinCoffins \Graph [\Graphii-vc,\Graphii-r] \Graphiii[vc,l](3pt,0pt)
\JoinCoffins \Graph [\Graphiii-vc,\Graphiii-r] \Graphiv[vc,l](3pt,0pt)
\JoinCoffins \Graph [\Graphiv-vc,\Graphiv-r] \Graphv[vc,l](3pt,0pt)
\JoinCoffins \Graph [\Graphi-hc,\Graphi-b] \Graphvi[hc,t](0pt,-3pt)
\JoinCoffins \Graph [\Graphvi-vc,\Graphvi-r] \Graphvii[vc,l](3pt,0pt)
\JoinCoffins \Graph [\Graphvii-vc,\Graphvii-r] \Graphviii[vc,l](3pt,0pt)
\JoinCoffins \Graph [\Graphviii-vc,\Graphviii-r] \Graphix[vc,l](3pt,0pt)
\JoinCoffins \Graph [\Graphix-vc,\Graphix-r] \Graphx[vc,l](3pt,0pt)
% put the wider graph below \Graph
\JoinCoffins \Graph[hc,b] \LGraph[hc,t](0pt,-15pt)
% put the upper coffins into \result
\JoinCoffins \result \Title
\JoinCoffins \result[\Title-b,\Title-l] \Date [t,l](0pt,-8pt)
\JoinCoffins \result [vc,l] \Logo [vc,r](\textwidth,0pt)
% add the \info coffin to \result
\JoinCoffins \result [b,l] \Info [t,l](10pt,-\baselineskip)
% add the \Graph coffin to \result
\JoinCoffins \result [\Info-t,\Info-r] \Graph [t,l](40pt,-1.5\baselineskip)
\noindent\TypesetCoffin \result
\end{document}
xcoffins
정말 좋은 패키지네요.
답변3
문맥,레이어페이지의 특정 위치에 자료를 배치하는 데 자주 사용됩니다. 예를 들어, 찾고 있는 레이아웃은 다음과 같이 얻을 수 있습니다.
\setuppapersize[A5,landscape]
\setuppagenumbering[location=] % No page numbering
\useMPlibrary[dum] % For placeholder pictures
\definelayer
[header]
[
x=2mm,
y=2mm,
]
\definelayer
[info]
[
x=5mm,
y=\the\dimexpr0.2\paperheight+15mm,
]
\definelayer
[graph]
[
x=\the\dimexpr0.3\paperwidth-10mm,
y=\the\dimexpr0.85\paperheight-5mm,
]
\definelayer
[grid]
[
x=\the\dimexpr0.3\paperwidth-10mm,
y=\the\dimexpr0.2\paperheight+15mm,
]
\setupbackgrounds[page][background={header, info, graph, grid}]
\setlayerframed
[header]
[
width=\the\dimexpr\paperwidth-4mm,
height=0.2\paperheight,
]
{Document header}
\setlayerframed
[info]
[
width=0.2\paperwidth,
height=\the\dimexpr0.6\paperheight-5mm,
align={flushleft, hyphenated},
]
{Information about the content}
\setlayer
[graph]
{\externalfigure[dummy][width=0.7\paperwidth, height=0.1\paperheight]}
\def\GRAPH
{\externalfigure[dummy]
[
width=\the\dimexpr0.1\paperwidth-0.4mm,
height=\the\dimexpr0.2\paperheight-0.5mm,
]}
\setlayerframed
[grid]
[
width=0.7\paperwidth,
height=0.5\paperheight,
%frame=off,
]
{
\startTABLE[offset=1mm]
\NC \GRAPH \NC \GRAPH \NC \GRAPH \NC \GRAPH \NC \GRAPH \NC \NR
\NC \GRAPH \NC \GRAPH \NC \GRAPH \NC \GRAPH \NC \GRAPH \NC \NR
\stopTABLE
}
\starttext
% Insert an empty page, with only the background layers.
\null
\stoptext
이는
답변4
명백한 패널에서 그래프를 조립하는 것은 wrapfig
. 로고를 상단에 정렬하는 것은 어려웠지만 fancyhdr
다음 줄만 있으면 패키지가 매우 잘 작동한다는 것을 알았습니다.
\fancyheader[R]{\includegraphics{logo.jpg}}