Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I know that this question in some way is duplicate, but I spent 2 hours trying some solution that I saw on this csite and I failed to solve my problem.

I made next table enter image description here

and I would like to center vertical and horizontal that $\varphi$, and only that (not month in the same row)

\documentclass[11pt]{article}                
\usepackage[T2A,T1]{fontenc}                 
\usepackage[utf8]{inputenc}                  
\usepackage{amstext,amsfonts,amsmath,amssymb}
\usepackage{rotating}                                      
\usepackage{iwona}                   

\DeclareRobustCommand{\cyr}[1]{%      
              {\fontencoding{T2A}\selectfont#1}%  
                         }                                     

 \begin{document}
 \cyr{ТЕКСТ сдаоп чфиондф фгпоин инафонг ачоигнаои ачоингачфоин}
 \begin{table}[!htbp]                                                                                                                                      
 \centering                                                                                                                  
 \begin{tabular}{cccccccccccccc}                                                                                             
  $\varphi$  & \quad  & \begin{turn}{90}\cyr{Јануар}\end{turn} & \begin{turn}       {90}\cyr{Фебруар}\end{turn} & \begin{turn}{90}\cyr{Март}\end{turn} & \begin{turn}{90}\cyr{Април}\end{turn} &  \begin{turn}{90}\cyr{Мај}\end{turn} & \begin{turn}{90}\cyr{Јун}\end{turn} & \begin{turn}{90}\cyr{Јул}\end{turn} &  \begin{turn}{90}\cyr{Август}\end{turn} & \begin{turn}{90}\cyr{Септембар}$\,\,$\end{turn} & \begin{turn}{90}\cyr{Октобар}\end{turn} & \begin{turn}{90}\cyr{Новембар}\end{turn} & \begin{turn}{90}\cyr{Децембар}\end{turn}\\                                     


   \hline                                                                                                                      
   & & & & & & & & & & & & & \multicolumn{1}{c}{} \\ [-1ex]                                                                   
  $\quad$ & $\quad$ & \multicolumn{12}{c}{\cyr{Трајање грађанског сумрака}}\\                                                 
   & & & & & & & & & & & & &\\ [-1ex]                                                                                         
    $\circ$   & $\quad$  & m & m & m & m & m & m & m & m & m & m & m & m \\                                                                                                                                                                                 
    40   & $\quad$  & 30 & 28 & 27 & 28 & 31 & 33 & 32 & 29 & 27 & 27 & 29 & 31 \\                                            
    42   & $\quad$  & 31 & 29 & 28 & 29 & 32 & 34 & 33 & 30 & 28 & 28 & 30 & 32 \\                                            
    44   & $\quad$  & 32 & 30 & 29 & 30 & 34 & 36 & 35 & 31 & 29 & 29 & 31 & 33 \\                                            
    46   & $\quad$  & 34 & 31 & 30 & 31 & 35 & 39 & 37 & 33 & 30 & 30 & 32 & 35 \\                                            
   & & & & & & & & & & & & &  \\[-1ex]                                                                                        
  $\quad$ & $\quad$ & \multicolumn{12}{c}{\cyr{Трајање астрономског сумрака}}\\                                               
   & & & & & & & & & & & & &  \\[-1ex]                                                                                        
    40   & $\quad$  & 96 & 96 & 90 & 97 & 111 & 123 & 117 & 102 & 92 & 90 & 94 & 98 \\                                        
    42   & $\quad$  & 99 & 94 & 93 & 101 & 117 & 132 & 125 & 106 & 95 & 93 & 97 & 101\\                                      
    44   & $\quad$  & 102 & 97 & 97 & 105 & 125 & 145 & 134 & 112 & 99 & 96 & 100 & 105         \\                                    
    46   & $\quad$  & 106 & 100 & 100 & 110 & 134 & 162 & 147 & 118 & 103 & 99 & 104 & 109 \\                                 
\hline                                                                                                                      
\end{tabular}                                                                                                                 
\end{table}     
\cyr{ТЕКСТ сдаоп чфиондф фгпоин инафонг ачоигнаои ачоингачфоин}  
\end{document}                                                                                                          
share|improve this question
    
If your document is in Serbian, there's no point in using \cyr: \usepackage[serbianc]{babel} should be sufficient. –  egreg Dec 11 '13 at 18:19
    
@egreg It is not only on Serbian. –  Cortizol Dec 11 '13 at 19:08
    
In any case, \cyr is not the solution –  egreg Dec 11 '13 at 19:13
    
@egreg Honestly, I have problem when I am using sebianc babel. That is the reason why I use \cyr, and that command I saw in some your answer (and all works fine for me). For example, I can compile your code in solution, but there is warning message i.imgur.com/mNMvXQE.png –  Cortizol Dec 11 '13 at 19:44
    
You need to update your TeX distribution. –  egreg Dec 11 '13 at 20:38
show 1 more comment

2 Answers

up vote 3 down vote accepted

If it needn't be an exact centering, maybe the following small modificitation will be enough (the precise value in \raisebox to be chosen}?

\documentclass[11pt]{article}                
\usepackage[T2A,T1]{fontenc}                 
\usepackage[utf8]{inputenc}                  
\usepackage{amstext,amsfonts,amsmath,amssymb}
\usepackage{rotating}                                      
\usepackage{iwona}                   

\DeclareRobustCommand{\cyr}[1]{%      
              {\fontencoding{T2A}\selectfont#1}%  
                         }                                     

 \begin{document}
 \cyr{ТЕКСТ сдаоп чфиондф фгпоин инафонг ачоигнаои ачоингачфоин}
 \begin{table}[!htbp]                                                                                                                                      
 \centering                                                                                                                  
 \begin{tabular}{cccccccccccccc}                                                                                             
%  $\varphi$  & \quad  & \begin{turn}{90}\cyr{Јануар}\end{turn} & \begin{turn}       {90}\cyr{Фебруар}\end{turn} & \begin{turn}{90}\cyr{Март}\end{turn} & \begin{turn}{90}\cyr{Април}\end{turn} &  \begin{turn}{90}\cyr{Мај}\end{turn} & \begin{turn}{90}\cyr{Јун}\end{turn} & \begin{turn}{90}\cyr{Јул}\end{turn} &  \begin{turn}{90}\cyr{Август}\end{turn} & \begin{turn}{90}\cyr{Септембар}$\,\,$\end{turn} & \begin{turn}{90}\cyr{Октобар}\end{turn} & \begin{turn}{90}\cyr{Новембар}\end{turn} & \begin{turn}{90}\cyr{Децембар}\end{turn}\\                                     
\raisebox{20pt}{$\varphi$ }
& \quad  & \begin{turn}{90}\cyr{Јануар}\end{turn} & \begin{turn}       {90}\cyr{Фебруар}\end{turn} & \begin{turn}{90}\cyr{Март}\end{turn} & \begin{turn}{90}\cyr{Април}\end{turn} &  \begin{turn}{90}\cyr{Мај}\end{turn} & \begin{turn}{90}\cyr{Јун}\end{turn} & \begin{turn}{90}\cyr{Јул}\end{turn} &  \begin{turn}{90}\cyr{Август}\end{turn} & \begin{turn}{90}\cyr{Септембар}$\,\,$\end{turn} & \begin{turn}{90}\cyr{Октобар}\end{turn} & \begin{turn}{90}\cyr{Новембар}\end{turn} & \begin{turn}{90}\cyr{Децембар}\end{turn}\\              

   \hline                                                                                                                      
   & & & & & & & & & & & & & \multicolumn{1}{c}{} \\ [-1ex]                                                                   
  $\quad$ & $\quad$ & \multicolumn{12}{c}{\cyr{Трајање грађанског сумрака}}\\                                                 
   & & & & & & & & & & & & &\\ [-1ex]                                                                                         
    $\circ$   & $\quad$  & m & m & m & m & m & m & m & m & m & m & m & m \\                                                                                                                                                                                 
    40   & $\quad$  & 30 & 28 & 27 & 28 & 31 & 33 & 32 & 29 & 27 & 27 & 29 & 31 \\                                            
    42   & $\quad$  & 31 & 29 & 28 & 29 & 32 & 34 & 33 & 30 & 28 & 28 & 30 & 32 \\                                            
    44   & $\quad$  & 32 & 30 & 29 & 30 & 34 & 36 & 35 & 31 & 29 & 29 & 31 & 33 \\                                            
    46   & $\quad$  & 34 & 31 & 30 & 31 & 35 & 39 & 37 & 33 & 30 & 30 & 32 & 35 \\                                            
   & & & & & & & & & & & & &  \\[-1ex]                                                                                        
  $\quad$ & $\quad$ & \multicolumn{12}{c}{\cyr{Трајање астрономског сумрака}}\\                                               
   & & & & & & & & & & & & &  \\[-1ex]                                                                                        
    40   & $\quad$  & 96 & 96 & 90 & 97 & 111 & 123 & 117 & 102 & 92 & 90 & 94 & 98 \\                                        
    42   & $\quad$  & 99 & 94 & 93 & 101 & 117 & 132 & 125 & 106 & 95 & 93 & 97 & 101\\                                      
    44   & $\quad$  & 102 & 97 & 97 & 105 & 125 & 145 & 134 & 112 & 99 & 96 & 100 & 105         \\                                    
    46   & $\quad$  & 106 & 100 & 100 & 110 & 134 & 162 & 147 & 118 & 103 & 99 & 104 & 109 \\                                 
\hline                                                                                                                      
\end{tabular}                                                                                                                 
\end{table}     
\cyr{ТЕКСТ сдаоп чфиондф фгпоин инафонг ачоигнаои ачоингачфоин}  
\end{document}         

enter image description here

share|improve this answer
    
That works for me! Thank you very much –  Cortizol Dec 11 '13 at 17:44
add comment

Your input can be vastly simplified and the phi exactly centered.

\documentclass[11pt]{article}                
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[serbianc]{babel}
\usepackage{amstext,amsfonts,amsmath,amssymb,booktabs,calc}
\usepackage{rotating}
\usepackage{iwona}

\newcommand{\turnhead}[1]{\begin{turn}{90}#1\end{turn}}

\begin{document}
ТЕКСТ сдаоп чфиондф фгпоин инафонг ачоигнаои ачоингачфоин

\begin{table}[!htbp]
\centering
\begin{tabular}{*{13}{c}}
\toprule
\settowidth{\dimen0}{Септембар}% measure the widest month
\raisebox{.5\dimen0-.5\totalheight}{$\varphi$} & 
  \turnhead{Јануар}    & \turnhead{Фебруар} & 
  \turnhead{Март}      & \turnhead{Април}   &
  \turnhead{Мај}       & \turnhead{Јун}     &
  \turnhead{Јул}       & \turnhead{Август}  &
  \turnhead{Септембар} & \turnhead{Октобар} &
  \turnhead{Новембар}  & \turnhead{Децембар}\\
\midrule
        & \multicolumn{12}{c}{Трајање грађанског сумрака} \\
$\circ$ & m & m & m & m & m & m & m & m & m & m & m & m \\
40      &  30 &  28 &  27 &  28 &  31 &  33 &  32 &  29 &  27 & 27 &  29 &  31 \\
42      &  31 &  29 &  28 &  29 &  32 &  34 &  33 &  30 &  28 & 28 &  30 &  32 \\
44      &  32 &  30 &  29 &  30 &  34 &  36 &  35 &  31 &  29 & 29 &  31 &  33 \\
46      &  34 &  31 &  30 &  31 &  35 &  39 &  37 &  33 &  30 & 30 &  32 &  35 \\
\addlinespace
        & \multicolumn{12}{c}{Трајање астрономског сумрака}\\
\addlinespace
40      &  96 &  96 &  90 &  97 & 111 & 123 & 117 & 102 &  92 & 90 &  94 &  98 \\
42      &  99 &  94 &  93 & 101 & 117 & 132 & 125 & 106 &  95 & 93 &  97 & 101 \\
44      & 102 &  97 &  97 & 105 & 125 & 145 & 134 & 112 &  99 & 96 & 100 & 105 \\
46      & 106 & 100 & 100 & 110 & 134 & 162 & 147 & 118 & 103 & 99 & 104 & 109 \\
\bottomrule
\end{tabular}
\end{table}
ТЕКСТ сдаоп чфиондф фгпоин инафонг ачоигнаои ачоингачфоин
\end{document}

enter image description here

share|improve this answer
    
Thank you for this solution and for improving it. –  Cortizol Dec 11 '13 at 19:12
    
.5\dimen0-.5\totalheight What measure \totalheight in this example? And I used here [utf8x], because there was warning message about that. And \newcommand is pretty nice, because everything look simpler now. And \addlinespace is nice command (instead of adding new row, like me). –  Cortizol Dec 11 '13 at 19:31
    
@Cortizol \totalheight measures the whole height and depth of the phi (height is what's above the baseline, depth is what's below it). –  egreg Dec 11 '13 at 20:39
    
Ah, that is for phi. Ok, I get it now. Thanks. –  Cortizol Dec 11 '13 at 21:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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