调整 dingbat 字体符号的垂直位置

调整 dingbat 字体符号的垂直位置

在简短的句子末尾,我插入了一个 dingbat 字体符号,指向页面右侧的区域。由于原始尺寸看起来很小,我使用字体大小控制命令放大了符号,如下所示:

\usepackage{charter}
\usepackage{pifont}
...
... professional sites) \ \LARGE\ding{43}

但是,这样做不仅会放大符号,还会使符号向上抬高,破坏垂直对齐(请参见下图)。解决此问题的最佳(和/或最简单)方法是什么?


在此处输入图片描述


更新(调查简单\raisebox解决方案的问题):

这是我的平均能量损失对于这种情况:

\documentclass[12pt]{article}
\RequirePackage[T1]{fontenc}

\usepackage{charter}
\usepackage{pifont}

\usepackage{calc}
\usepackage[shortcuts]{extdash}

\reversemarginpar

\usepackage[paper=a4paper,
  marginparwidth=30.5mm,
  marginparsep=1.5mm,
  margin=25mm,
  includemp]{geometry}

\setlength{\parindent}{0in}

\usepackage[shortlabels]{enumitem}
\usepackage{graphicx}

% I wasn't sure, if I could omit 'fancyhdr'-related
% code for the MWE purposes, so included just in case
\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}

\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfootoffset{\marginparsep+\marginparwidth}
\newlength{\footpageshift}
\setlength{\footpageshift}
{0.5\textwidth+0.5\marginparsep+0.5\marginparwidth-2in}
\lfoot{\hspace{\footpageshift}%
  \parbox{4in}{\, \hfill %
    \arabic{page} of \protect\pageref*{LastPage}
    \hfill \,}}

\usepackage{color,hyperref}
\definecolor{darkblue}{rgb}{0.0,0.0,0.3}
\hypersetup{colorlinks,breaklinks,
  linkcolor=darkblue,urlcolor=darkblue,
  anchorcolor=darkblue,citecolor=darkblue}

\newcommand{\makeheading}[2][]%
{\hspace*{-\marginparsep minus \marginparwidth}%
  \begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%
    {\large \bfseries #2 \hfill #1}\\[-0.15\baselineskip]%
    \rule{\columnwidth}{2pt}%
  \end{minipage}}

\renewcommand{\section}[1]{\pagebreak[3]%
  \vspace{1.3\baselineskip}%
  \phantomsection\addcontentsline{toc}{section}{#1}%
  \noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
  \vspace{-\baselineskip}\par}

\usepackage{url}
\urlstyle{same}

\providecommand*\emaillink[1]{\nolinkurl{#1}}
\providecommand*\email[1]{\href{mailto:#1}{\emaillink{#1}}}


\begin{document}

\makeheading{Aleksandr~L.~Blekh}

\section{Contact Information}

\newlength{\rcollength}\setlength{\rcollength}{1.85in}%
\newlength{\spacewidth}\setlength{\spacewidth}{20pt}

\begin{tabular}[t]{@{}p{\textwidth-\rcollength-\spacewidth}@{}p{\spacewidth}@{}p{\rcollength}}%

  \parbox{\textwidth-\rcollength-\spacewidth}{%
    \begin{tabular}[t]{@{}ll@{\quad}}
      \textit{Mobile:}& \texttt{+}1-111-111-1111 \\
      \textit{E-mail:}& \email{[email protected]} \\
      \textit{Web:}& \href{http://www.aleksandrblekh.com}{www.aleksandrblekh.com} \\
      \\
      \textit{Profiles}& (on professional sites) \ 
      \raisebox{-1.7\baselineskip}[0pt][0pt]{\LARGE\ding{43}}
    \end{tabular}
  }

  &
  % Uncomment to add a vertical bar in middle of contact information
  {\vrule width 0.5pt}
  \parbox[c][5\baselineskip]{\spacewidth}{} &

  % Non-snail-mail contact information
  \parbox{\rcollength}{%
    \href{http://linkedin.com/in/ablekh}{LinkedIn}\\
    \href{https://www.researchgate.net/profile/Aleksandr_Blekh}{ResearchGate}\\
    \href{http://quora.com/Aleksandr-Blekh}{Quora}\\
    \href{http://stackexchange.com/users/3422261/aleksandr-blekh?tab=accounts}{StackExchange}\\
    \href{https://github.com/abnova}{GitHub}
  }

\end{tabular}

\end{document}

这是结果(如您所见,手仍然错位):

在此处输入图片描述

答案1

我只会用

\raisebox{<len>}[0pt][0pt]{...}

<len>您可以根据需要使用负数。0pt垂直移动元素时,可选参数会删除任何垂直高度/深度。

答案2

以下示例定义了\largehand,即指向右侧的较大版本的手形符号。它假设 中的手形符号pifont位于典型全字形高度的中间,由实心方块 ( \ding{110}) 表示。当符号向下移动时,需要减少白色深度。然后符号向下移动,其高度不超过当前字体的大写字母(由 表示M)。

\documentclass{article}
\usepackage{charter}
\usepackage{pifont}

\newcommand{\largehand}{}% error if \largehand is already defined
\DeclareRobustCommand*{\largehand}{%
  \begingroup
    \sbox0{M}%
    \sbox2{\LARGE\ding{110}}%
    \raisebox{\dimexpr\ht0-\height\relax}[\ht0]%
    [\dimexpr2\height+\depth-\ht0-\ht2\relax]{\LARGE\ding{43}}%
  \endgroup
}

\begin{document}
\dots\ professional sites) \ \largehand\ TeX.SX

% Show symbol bounding boxes
\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{.1pt}
\fbox{\largehand}\fbox{X}
\end{document}

结果

相关内容