what is the correct value to move horizontal rule and join it with vertical rule between minipage?

I am redoing the logos (in word) used by my school, I have managed to align the images and the text, but, I can not find the correct value to move the horizontal rule and join it with the vertical rule. At first sight they seem to be united, but, a little "zoom" notes that they are separated. I have tried with several values in \rule[...], but none has worked. This is the MWE:

\documentclass[10pt]{article}%
\usepackage[osf]{libertine}
\usepackage[most]{tcolorbox}
%\setlength{\parindent}{0pt} % some need a parindent

% box for save dimension
\newsavebox\mysavebox
\sbox\mysavebox{\includegraphics[width=1.45cm,height=1.88cm]{example-image-a}}

% \colelogo
\NewDocumentCommand\colelogo{}{%
\usebox\mysavebox%
\end{minipage}}}%

% \coledescript
\NewDocumentCommand\coledescript{}{%
\begin{center}
\strut\textsc{\bfseries\Large Colegio XXXXXXXXXX YYYYYY de XXXXX}\par\vspace{0.5pt}
\emph{Enseñanza Básica}\par\vspace{0.5pt}
\emph{Formando Personas}\par
\vfill
\sffamily Avenida YYYYYY XXXXXXXXX Nª 123 Fono: (12) 325678 XXXXXXXXXXX%
\end{center}

% \coleyear
\NewDocumentCommand\coleyear{}{%
\begin{center}
\strut\bfseries\Large 2018%
\end{center}

% \colenota
\NewDocumentCommand\colenota{}{%
\begin{flushright}
\tcbox[colback=white,left=0mm,right=0mm,top=0mm,bottom=0mm,%
boxsep=0mm,arc=2mm,boxrule=0.7pt,title style={draw=none,fill=none}]{%
\rule{0pt}{\ht\mysavebox}\rule{\wd\mysavebox}{0pt}} % vertical x horizontal
\end{flushright}
\end{minipage}}}%

% \colevrule
\NewDocumentCommand\colevrule{}{%
\rule[-0.9\ht\mysavebox]{0.4pt}{1.1\ht\mysavebox}\hspace{-4pt}}

\setlength{\fboxsep}{0pt}
\colelogo\coledescript\colevrule\coleyear%
\IfBooleanTF{#1}
{\par\noindent\rule{\linewidth}{0.4pt}\par} % with a star
{\par\noindent\hfil\rule{0.8\textwidth}{0.4pt}\hfil\par} % without a star
}

\setlength{\fboxsep}{0pt}
\colelogo\coledescript\colevrule\coleyear\colenota
\IfBooleanTF{#1}
{\par\noindent\rule{\linewidth}{0.4pt}\par} % with a star
{\par\noindent\hfil\rule{0.8\textwidth}{0.4pt}\hfil\par} % without a star
}

\pagestyle{empty}
\begin{document}

text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text
text text text text text text text text text text

\vspace{1cm}

text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text
text text text text text text text text text text
\vspace{1cm}

text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text
text text text text text text text text text text
\vspace{1cm}

text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text
text text text text text text text text text text
\end{document}


I use the libertine font and the documents are in 10pt, 11pt, 12pt and the paper size is the one used in my country (they are not enough in the MWE). An image to clarify more: Saludos

• Couldn't you just use a simple tabularx for that? – user121799 May 19 '18 at 2:01
• @marmot: tabularx It's an option, but, this will be part of a package that I'll use for tests and exams ... I'm more used to minipage, but, I do not rule it out :) – Pablo González L May 19 '18 at 2:38
• I see. (Of course you are loading tcolorbox, which in turn loads tons of other packages, in particular TikZ, which may allow you to build a more straightforward solution, possibly by also loading tikzpagenodes.) – user121799 May 19 '18 at 3:14

This solution replaces some of the \pars with \hrule height0pt which packs tight. Also put some of the \rules inside \smash to remove the vertical space reserved (essentially \baselineskip).

\documentclass[10pt]{article}%
\usepackage[most]{tcolorbox}
%\setlength{\parindent}{0pt} % some need a parindent

% box for save dimension
\newsavebox\mysavebox
\sbox\mysavebox{\includegraphics[width=1.45cm,height=1.88cm]{example-image-a}}

% \colelogo
\NewDocumentCommand\colelogo{}{%
\usebox\mysavebox%
\end{minipage}}}%

% \coledescript
\NewDocumentCommand\coledescript{}{%
\begin{center}
\strut\textsc{\bfseries\Large Colegio XXXXXXXXXX YYYYYY de XXXXX}\par\vspace{0.5pt}
\emph{Enseñanza Básica}\par\vspace{0.5pt}
\emph{Formando Personas}\par
\vfill
\sffamily Avenida YYYYYY XXXXXXXXX Nª 123 Fono: (12) 325678 XXXXXXXXXXX%
\end{center}

% \coleyear
\NewDocumentCommand\coleyear{}{%
\begin{center}
\strut\bfseries\Large 2018%
\end{center}

% \colenota
\NewDocumentCommand\colenota{}{%
\begin{flushright}
\tcbox[colback=white,left=0mm,right=0mm,top=0mm,bottom=0mm,%
boxsep=0mm,arc=2mm,boxrule=0.7pt,title style={draw=none,fill=none}]{%
\rule{0pt}{\ht\mysavebox}\rule{\wd\mysavebox}{0pt}} % vertical x horizontal
\end{flushright}
\end{minipage}}}%

% \colevrule
\NewDocumentCommand\colevrule{}{%
\rule[-0.9\ht\mysavebox]{0.4pt}{1.1\ht\mysavebox}\hspace{-4pt}}

\setlength{\fboxsep}{0pt}%
\colelogo\coledescript\colevrule\coleyear%
\IfBooleanTF{#1}%
{\hrule height0pt \smash{\rule{\textwidth}{0.4pt}}\par}% with a star
{\hrule height0pt \hfil\smash{\rule{0.8\textwidth}{0.4pt}}\hfil\par}% without a star
}

\setlength{\fboxsep}{0pt}
\colelogo\coledescript\colevrule\coleyear\colenota
\IfBooleanTF{#1}
{\hrule height0pt \smash{\rule{\linewidth}{0.4pt}}\par} % with a star
{\hrule height0pt \hfil\smash{\rule{0.8\textwidth}{0.4pt}}\hfil\par} % without a star
}

\pagestyle{empty}
\begin{document}

text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text
text text text text text text text text text text

\vspace{1cm}

text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text
text text text text text text text text text text
\vspace{1cm}

text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text
text text text text text text text text text text
\vspace{1cm}


• Thanks for the answer, you can tell me how to fix the \rule{0.8\textwidth}{0.4pt}, it is not centered as it should... – Pablo González L May 19 '18 at 2:36
• Replace \smash rule for {\hrule height0pt \begingroup\centering\rule{0.8\linewidth}{0.4pt}\par\endgroup} % without a star and now it works perfectly ... Thank you very much – Pablo González L May 19 '18 at 5:05