移动水平线并将其与小页面之间的垂直线连接的正确值是多少?

移动水平线并将其与小页面之间的垂直线连接的正确值是多少?

我正在重做学校使用的徽标(在 Word 中),我已设法对齐图像和文本,但我找不到正确的值来移动水平线并将其与垂直线连接起来。乍一看,它们似乎是统一的,但稍微“放大”一下就会发现它们是分开的。我尝试了几个值\rule[...],但都没有奏效。这是 MWE:

\documentclass[10pt]{article}%
\usepackage[osf]{libertine}
\usepackage[margin=0.6in,noheadfoot,papersize={8.5in,13in}]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{adjustbox}
%\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{}{%
\noindent\adjustbox{valign=t}{\noindent\begin{minipage}[t][\ht\mysavebox][t]{0.1\linewidth}%
\usebox\mysavebox%
\end{minipage}}}%

% \coledescript
\NewDocumentCommand\coledescript{}{%
\begin{adjustbox}{minipage=[t][\ht\mysavebox][t]{0.7\linewidth}}%
    \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}
\end{adjustbox}}%

% \coleyear
\NewDocumentCommand\coleyear{}{%
\begin{adjustbox}{minipage=[t][\ht\mysavebox][t]{0.1\linewidth}}%
    \begin{center}
        \strut\bfseries\Large 2018%
    \end{center}
\end{adjustbox}}%

% \colenota
\NewDocumentCommand\colenota{}{%
\adjustbox{valign=t}{\noindent\begin{minipage}[t][\ht\mysavebox][t]{0.1\linewidth}%
    \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}}

% A headcole command
\NewDocumentCommand\headcole{s}{%
\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
}

% A headprueba command
\NewDocumentCommand\headprueba{s}{%
\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}
Use \verb|\headcole|...OK

\headcole
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}

Use \verb|\headcole*|...OK

\headcole*
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}

Use \verb|\headprueba|...OK

\headprueba
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}

Use \verb|\headprueba*|...OK

\headprueba*
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}

我使用 libertine 字体,文档为10pt11pt12pt纸张大小为我国使用的纸张大小(在 MWE 中不够大)。图片可以更清楚地说明: MWE white 规则不加入 问候语

答案1

此解决方案替换了一些紧密包装的\pars \hrule height0pt。同时将一些\rules 放入内部\smash以移除保留的垂直空间(本质上\baselineskip)。

\documentclass[10pt]{article}%
%\usepackage[osf]{libertine}% took too long to download
\usepackage[margin=0.6in,noheadfoot,papersize={8.5in,13in}]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{adjustbox}
%\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{}{%
\noindent\adjustbox{valign=t}{\noindent\begin{minipage}[t][\ht\mysavebox][t]{0.1\linewidth}%
\usebox\mysavebox%
\end{minipage}}}%

% \coledescript
\NewDocumentCommand\coledescript{}{%
\begin{adjustbox}{minipage=[t][\ht\mysavebox][t]{0.7\linewidth}}%
    \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}
\end{adjustbox}}%

% \coleyear
\NewDocumentCommand\coleyear{}{%
\begin{adjustbox}{minipage=[t][\ht\mysavebox][t]{0.1\linewidth}}%
    \begin{center}
        \strut\bfseries\Large 2018%
    \end{center}
\end{adjustbox}}%

% \colenota
\NewDocumentCommand\colenota{}{%
\adjustbox{valign=t}{\noindent\begin{minipage}[t][\ht\mysavebox][t]{0.1\linewidth}%
    \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}}

% A headcole command
\NewDocumentCommand\headcole{s}{%
\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
}

% A headprueba command
\NewDocumentCommand\headprueba{s}{%
\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}
Use \verb|\headcole|...OK

\headcole
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}

Use \verb|\headcole*|...OK

\headcole*
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}

Use \verb|\headprueba|...OK

\headprueba
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}

Use \verb|\headprueba*|...OK

\headprueba*
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}

相关内容