タイトルページの背景の中央に画像を配置する方法

タイトルページの背景の中央に画像を配置する方法

私は LaTeX ドキュメントのタイトル ページを作成しようとしていますが、最初から失敗してしまい、その理由がわかりません。(ドキュメントの他の部分はすでに正常に動作していますが、タイトル ページだけが問題です。)

(これは、Word 文書からデザインを「コピー」することです。)

誰か、最初に手伝ってくれませんか?例えば、画像を中央に配置したり、背景にしたり、半透明のブロックを作成したり。

例として、長期的には次のようになるはずです。

現時点では、一番上の画像に焦点を当てていることにご注意ください。私の目的は学習することなので、ページの残りの部分については助けを求めていません。

関連する場合は、Windows 上で LuaLatex と TeXworks を使用します。

ご協力いただきありがとうございます。

望ましい最終結果を示す画像

\documentclass[a4paper]{article}

\usepackage{eso-pic}
\usepackage{xparse}
\usepackage{rotating}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[danish]{babel}
\usepackage{fontspec}

% that's where the full title and specific data comes from.
\usepackage{project}

% that's me trying to center the picture with various packages, without any positive result
\usepackage{titling}
\usepackage[tt]{titlepic}

\def\dokTitle{A1.2.\AfsnitNr{} }
\title{Your Title Here}
\author{Your Name}
\date{}

\begin{document}

\begin{titlepage}
\centering
\includegraphics[width=18cm, keepaspectratio]{pic/titleback.jpg}

\begin{sideways}
\makebox{\huge \setmainfont{QTHelvet-Black}\bfseries\ProjektNavn}
\makebox{\large \setmainfont{Cambria}\dokTitle}
\makebox{\Large \setmainfont{Calibri}\AfsnitNavn}
\end{sideways}


\end{titlepage}

\end{document}

答え1

そこで、Tikz を使用するアドバイスを受けて、ここでかなり良いものを作ることができました。

特に、私はそれを授業に取り入れました。

デザインの面でも非常に非効率的かもしれないので、コメントをお待ちしています。

最も重要な問題は、横書きのタイトル (En by i Sverige) と表が背景画像の中央に残っていることです。表は住所と下部のロゴのすぐ上に配置したいのですが。

タイトル自体は画像と表の間に少し浮いていても構いませんが、正確な位置はそれほど重要ではありません。

ここに画像の説明を入力してください

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{paneltrade}[2024/01/01 LaTeX class created to write PanelTrade technical documents]

\LoadClass[a4paper,11pt]{article}

\RequirePackage{booktabs}

\RequirePackage{tikz}
\RequirePackage{siunitx}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{xcolor}
\RequirePackage{fancyhdr}
\RequirePackage[left=2cm,right=2cm,top=3cm,bottom=3cm]{geometry}
\RequirePackage{graphicx}

\usetikzlibrary{positioning,fit,shapes.geometric,calc,backgrounds}

% That's where are the names, title of the project, etc...
\RequirePackage{project}

%%%%%%%%%
%fonte
\RequirePackage{fontspec}
\setmainfont{calibri}

\RequirePackage{titlesec}

% Define light and dark Microsoft blue colours
\definecolor{MSBlue}{rgb}{.204,.353,.541}
\definecolor{MSLightBlue}{rgb}{.31,.506,.741}

% Define a new fontfamily for the subsubsection font
% Don't use \fontspec directly to change the font
\newfontfamily\subsubsectionfont[Color=MSLightBlue]{Times New Roman}
% Set formats for each heading level
\titleformat*{\section}{\Large\bfseries\sffamily\color{MSLightBlue}}
\titleformat*{\subsection}{\large\bfseries\sffamily\color{MSLightBlue}}

%%%%%

\RequirePackage[danish]{babel}

\newcommand{\RomanNumeralCaps}[1]
    {\MakeUppercase{\romannumeral #1}}

\renewcommand{\maketitle}{
\begin{titlepage}

%% rectangle geometry
% offset as offset from border of picture and between rects
\def\offsetrect{4mm}
% width of rects
\def\largrect{16mm}

\begin{tikzpicture}[remember picture,overlay]

%% mega large picture in background
\node[outer sep=0pt,anchor=north](backpic) at ([yshift=-1cm]current page.north) {\includegraphics[keepaspectratio]{pic/titleback.jpg}};

\coordinate (topA) at ([xshift=\offsetrect, yshift= - \offsetrect ] backpic.north west); % Offset from top
\coordinate (bottomA) at ([xshift=\offsetrect + \largrect, yshift=\offsetrect ] backpic.south west); % Offset from bottom
    
\coordinate(topB) at ([xshift=\offsetrect + \largrect] topA);
\coordinate(bottomB) at ([xshift=\offsetrect + \largrect] bottomA);

\coordinate(topC) at ([xshift=\offsetrect + \largrect] topB);
\coordinate(bottomC) at ([xshift=\offsetrect + \largrect] bottomB);

\filldraw[fill= white, very thick,draw=white,opacity=0.5] (topA) rectangle (bottomA);
\node[anchor=east] at ([yshift=-8mm,xshift=0.5*\largrect]topA) [rotate=90] {\huge \setmainfont{QTHelvet-Black}\bfseries\ProjektNavn};

\filldraw[fill= white, very thick,draw=white,opacity=0.5] (topB) rectangle (bottomB);
\node[anchor=east] at ([yshift=-8mm,xshift=0.5*\largrect]topB) [rotate=90] {\Large \setmainfont{Cambria}\bfseries\dokTitle};

\filldraw[fill= white, very thick,draw=white,opacity=0.5] (topC) rectangle (bottomC);
\node[anchor=east] at ([yshift=-8mm,xshift=0.5*\largrect]topC) [rotate=90] {\Large\bfseries\sffamily\color{MSBlue}\AfsnitNavn};

\end{tikzpicture}

\vspace{1cm}

{\large\bfseries\sffamily\color{MSBlue}\dokTitle}
\\
{\huge \setmainfont{QTHelvet-Black}\bfseries\ProjektNavn}

\vspace{2cm}

\begin{table}[h]
    \centering
    \setlength\tabcolsep{0pt}
    \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}llll}

Projekt Nr:     & \ProjektNr    & Konstruktionsafsnit:      & \AfsnitNr     \\
 \addlinespace[10pt]

Udarbejdet af : &\ingenior & {} & {}    \\
\midrule
\addlinespace[10pt]

Godkendt af :   & \kontrolant & {} & {} \\
\bottomrule
\end{tabular*}
\end{table}

%%% pay attention to margins if you modify the (2cm, 2cm) -> I took the same side margins as the general doc class.
%
\begin{tikzpicture}[remember picture,overlay]
\node [outer sep=0pt,anchor=south west, align=left] at ($(current page.south west)+(2cm,2cm)$) {\parbox{\textwidth}{
\textbf{Tlf.: +45 8620 2020\\
    E-mail: [email protected]\\
    Hjemmeside: https://www.paneltrade.dk}
}};
\end{tikzpicture}

\begin{tikzpicture}[remember picture,overlay]
\node[outer sep=0pt,anchor=south east] at ($(current page.south east)+(-2cm,2cm)$) {\includegraphics[keepaspectratio]{pic/footpic.jpg}};
\end{tikzpicture}

\end{titlepage}
}


\pagestyle{fancy}
\fancyhead[L]{\large\bfseries\sffamily\color{MSBlue}\dokTitle}
\fancyhead[R]{\small\color{MSLightBlue}Side \thepage}

%%% footer
% void in center, otherwise the page number appears
\fancyfoot[C]{}
\fancyfoot[R]{\includegraphics{pic/footpic}}

関連情報