Skip to content

Commit

Permalink
[LaTeX] Improved cover image
Browse files Browse the repository at this point in the history
Now can be added a SVG image in the cover. Not sure why, but if the path
has an "_" it escaped with "\_". To avoid this, in the YAML must be
like:

cover: '`img/temas_comunes/wsl/logo.svg`{=html}`img/temas_comunes/wsl/logo.svg`{=latex}'
  • Loading branch information
yuki committed Nov 30, 2024
1 parent 621e6a7 commit 404cbda
Showing 1 changed file with 61 additions and 55 deletions.
116 changes: 61 additions & 55 deletions template/yuki.tex
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@

\RequirePackage{blindtext} % to add Lorem Impsum...

\RequirePackage{xstring} % for the Cover's "if png...else svg"

%--------------------------------------------------------------------------
% Custom color BOXES
%--------------------------------------------------------------------------
Expand Down Expand Up @@ -595,61 +597,65 @@
\color{white}\textbf{\textit{$degree$}}
\end{tcolorbox}

\begin{tcolorbox}[
boxrule=0mm,
arc=0mm,
colframe=white,
colback=white,
fit to={\paperwidth} and 12.5cm,
halign=flush center,
valign=center,
space to=\myspace,
]
\includegraphics[width=\linewidth,height=13cm,keepaspectratio]{$cover$}
\end{tcolorbox}

\begin{tcolorbox}[
boxrule=0mm,
arc=0mm,
colframe=maincolor,
colback=maincolor,
fit to={\paperwidth} and 8cm,
fit basedim=130pt,
halign=flush center,
valign=center,
top=1cm,bottom=1cm,
]
\color{white}\textbf{\textit{$title$}}
\end{tcolorbox}

\begin{tcolorbox}[
boxrule=0mm,
colframe=white,
colback=white,
fit to={\paperwidth} and 2cm,
halign=flush right,
valign=top,
left=8cm,
right=1cm
]
\Large{\color{maincolor}\textit{$phrase$}} \\
\small{\color{maincolor}\textit{$phrase-author$}}
\end{tcolorbox}

\begin{tcolorbox}[
before skip=0cm,
boxrule=0mm,
colframe=white,
colback=white,
fit to={\paperwidth} and 2.6cm,
fit basedim=210pt,
halign=flush left,
left=1cm,
valign=top
]
\color{maincolor}\textbf{$author$} \linebreak
\color{maincolor}\textbf{$date$}
\end{tcolorbox}
\begin{tcolorbox}[
boxrule=0mm,
arc=0mm,
colframe=white,
colback=white,
fit to={\paperwidth} and 12.5cm,
halign=flush center,
valign=center,
space to=\myspace,
]
\IfEndWith{$cover$}{png}{
\includegraphics[width=\linewidth,height=13cm,keepaspectratio]{$cover$}
}{
\includesvg[pretex=\escapeus,width=\linewidth,height=13cm,keepaspectratio]{$cover$}
}\par
\end{tcolorbox}

\begin{tcolorbox}[
boxrule=0mm,
arc=0mm,
colframe=maincolor,
colback=maincolor,
fit to={\paperwidth} and 8cm,
fit basedim=130pt,
halign=flush center,
valign=center,
top=1cm,bottom=1cm,
]
\color{white}\textbf{\textit{$title$}}
\end{tcolorbox}

\begin{tcolorbox}[
boxrule=0mm,
colframe=white,
colback=white,
fit to={\paperwidth} and 2cm,
halign=flush right,
valign=top,
left=8cm,
right=1cm
]
\Large{\color{maincolor}\textit{$phrase$}} \\
\small{\color{maincolor}\textit{$phrase-author$}}
\end{tcolorbox}

\begin{tcolorbox}[
before skip=0cm,
boxrule=0mm,
colframe=white,
colback=white,
fit to={\paperwidth} and 2.6cm,
fit basedim=210pt,
halign=flush left,
left=1cm,
valign=top
]
\color{maincolor}\textbf{$author$} \linebreak
\color{maincolor}\textbf{$date$}
\end{tcolorbox}


\restoregeometry
Expand Down

0 comments on commit 404cbda

Please sign in to comment.