3

At the end of brief sentence I inserted a dingbat font symbol to point to an area on the page to the right. Since the original size looked small, I enlarged the symbol by using font size control command as follows:

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

However, that, along with enlarging the symbol, also results in the symbol raising up some and breaking the vertical alignment (please see picture below). What is the best (and/or easiest) way to fix this issue?


enter image description here


UPDATE (investigating the simple \raisebox solution's problem):

Here's my MWE for this scenario:

\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{first.last@provider.com} \\
      \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}

Here's the result (as you see, the hand is still misaligned):

enter image description here

2
  • Frankly, this issue is not a big deal - I can leave it as is. But, if there is a quick and easy way to fix the alignment, I would prefer to do it. Forgot to mention that "(on professional sites)" and the hand are inside a tabular environment (same cell). Jun 24 '15 at 22:35
  • Sorry, I think I might have used the wrong term - it seems to be horizontal alignment that I am concerned about here. I will leave the question intact until people will confirm this. Jun 24 '15 at 22:40
4

I would just use

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

where you use a negative <len> that suits your needs. The 0pt optional arguments remove any vertical height/depth when moving the element vertically.

14
  • I appreciate your help and fast reply. Do I understand correctly that LaTeX code for the hand symbol should go instead of the ellipsis? Jun 24 '15 at 22:43
  • @AleksandrBlekh: Yes, and <len> should be positive/negative in order to move content upward/downward. For example, \raisebox[0pt][0pt]{-.2\baselineskip}{\LARGE\ding{43}}.
    – Werner
    Jun 24 '15 at 22:43
  • Great, thanks again. I will give it try. Hopefully, I will report success and will be happy to upvote and accept your answer. Appreciate your code snippet. Jun 24 '15 at 22:45
  • Hmm... I tried your example and I'm getting some errors: Missing number, treated as zero. } and Illegal unit of measure (pt inserted). } and package calc Error: '[' Invalid at this point. }. Jun 24 '15 at 22:50
  • 2
    @AleksandrBlekh: I see. The reason why using \baselineskip doesn't work is because you're in a tabular. For those situations you need to use \normalbaselineskip. Alternatively, use a fixed-length like -10pt or -1ex.
    – Werner
    Jun 24 '15 at 23:53
3

The following example defines \largehand, the larger version of the hand pointing to the right. It assumes that the hand symbols in pifont are centered around the middle of the typical full glyph height, represented by the filled square (\ding{110}). This is needed to reduce the white depth, when the symbol is moved down. Then the symbol is moved down, that its height does not exceed the upper case letters of the current font (represented by 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}

Result

6
  • Amazing (+1 and will likely accept, though I'd prefer a simpler solution)! Thank you so much for taking time to share such a comprehensive answer. And, of course, it seems to me like writing that macro is an overkill, but it's most likely my lack of enough expertise in LaTeX. I understand that you solution is more universal and flexible, but I am curious about why @Werner's nice and simple solution didn't work. I was working on my MWE, which almost compiles successfully, but then I saw your answer. Do you have any thoughts about the simple \raisebox solution's potential issues? Jun 24 '15 at 23:36
  • MWE is ready - please see UPDATE section in the question. Jun 24 '15 at 23:48
  • @AleksandrBlekh I am using \raisebox as well, even with all length parameters, which are automatically calculated. You can also use a simple \raisebox with pleasant values. With \fbox you can check the bounding box of the symbol, see my answer. Jun 24 '15 at 23:50
  • But why the simple use of \raisebox doesn't work in my MWE above? Jun 24 '15 at 23:54
  • 2
    @AleksandrBlekh It's already answered by Werner's comment: Inside a tabular the length \baselineskip is zero (disabled). Therefore you are not moving anything. Jun 24 '15 at 23:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.