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} 
4
  • Please add some example code (MWE) to help us help you. Commented Jul 18, 2017 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) Commented Jul 18, 2017 at 8:47
  • You replace one problem with another: it quite visible that XII and CBSE are not aligned. Commented Jul 18, 2017 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. Commented Jul 18, 2017 at 9:52

2 Answers 2

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

2
  • Is there a way to eliminate the space automatically if there are no descenders in a word? Commented Jul 18, 2017 at 9:04
  • @KarthikNishanth No, unless you are willing to write something like \parenthesize{CBSE}. Commented Jul 18, 2017 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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.