0

Existing

In this image, since there are no characters like g,y in the first cell, there seems to be a misalignment between the round brackets and the text CBSE. Is there any way to automatically center text like the following image? I edited the following in GIMP and moved the text CBSE slightly down, to align it vertically. Is there any way to do the same in LaTeX?

Requirement

Code snippet from my class file

\begin{tabular}{|M{0.295\textwidth}|c|c|c|} 
    \hline
    Program & Institute & Percent/CGPA & Year of Completion \\
    \hline
    #1 & #2 & #3 & #4
    \hline
\end{tabular}
  • Please add some example code (MWE) to help us help you. – TeXnician Jul 18 '17 at 8:38
  • Added the code snippet from the class file. #1, #2, #3, #4 are filled in the main TeX file. Here, #2 is XII (CBSE) – Karthik Nishanth Jul 18 '17 at 8:47
  • You replace one problem with another: it quite visible that XII and CBSE are not aligned. – Bernard Jul 18 '17 at 9:49
  • Hi, the intended behavior was that if a cell was completely without bottom glyphs as in g,y, it should center the entire cell's contents. I was too lazy and just moved the CBSE alone. – Karthik Nishanth Jul 18 '17 at 9:52
1

This is not a bug. It is the intended behaviour. The parentheses account for possible descenders.

\documentclass{article}
\begin{document}
(CBSE)
\end{document}

enter image description here

If you want to adjust vertical alignment use \raisebox.

\documentclass{article}
\begin{document}
\raisebox{.1333ex}{(}CBSE\raisebox{.1333ex}{)}
\end{document}

enter image description here

  • Is there a way to eliminate the space automatically if there are no descenders in a word? – Karthik Nishanth Jul 18 '17 at 9:04
  • @KarthikNishanth No, unless you are willing to write something like \parenthesize{CBSE}. – Henri Menke Jul 18 '17 at 9:10
1

You can obtain this result using small caps in a larger font, adding some negative kerning if you're perfectionist:

\documentclass{article}

\begin{document}

XII (CBSE)

 \large\textsc{xii \kern-0.1em(\kern-0.07em cbse\kern-0.05em)}

 \Large\textsc{xii (cbse)}

\end{document} 

enter image description here

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.