これは非常に一般的な質問なので、直接それに答えているアーカイブされた投稿を簡単に見つけることができませんでした。
私は、LaTeX を使用して、図と少量のテキストを含む片面シートを設計することに興味があります。下図のような特定のレイアウトを念頭に置いています。これらの領域を描画し、それらに合わせてグラフィック (グラフ/ロゴ内) を切り取り、描画された境界領域を越えないようにテキストを配置できるようにしたいと考えています。
どうすればそれができるのでしょうか? 私は PDF を生成しており、情報をループして何百ものそのようなドキュメントを生成したいので、LaTeX を使用しています。
答え1
あなたはtextpos パッケージページ上のオブジェクト (テキストや図) を配置します。
答え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
ConTeXtでは、レイヤーページの特定の場所に素材を配置するためによく使用されます。たとえば、目的のレイアウトは次のように実現できます。
\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}}