1

I have a problem with spacing in section title where section number is bigger than the title. The first and second line are separated by a quite big space. Space after second line is normal. I am not able get good enough result

\documentclass[11pt,a4paper,twoside]{article}

\usepackage[czech]{babel}
\usepackage[utf8]{inputenc}

\usepackage{color}
\usepackage{fontspec}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{filecontents}
\usepackage{siunitx}
\usepackage{tabularx}

\usepackage{tikz, pgfplots}
  \fancyhf{}
  \fancyhead[RO]{\scriptsize{Indikátory udržitelnosti rozvoje hl. m. Prahy  }\hspace*{4pt}\vheadline \hspace*{0.72in} \vheadline\hspace*{13pt}\linepagesep\normalsize \thepage }
  \fancyfoot[RO]{\textbf{\emph{UAP }}\hskip \vfootline\hskip\linepagesep\textbf{\emph{2016}}}
  \renewcommand\headrulewidth{0pt}
  \newskip\linepagesep \linepagesep 5pt\relax
  \def\vfootline{%ñ
    \begingroup\rule[-990pt]{1pt}{1000pt}\endgroup}
  \def\vheadline{%
    \begingroup\rule[-5pt]{0.5pt}{35pt}\endgroup}


\titleformat{\section}{\vspace*{6pt}\bfseries\fontsize{36}{36}\selectfont\bfseries}{\thesection.}{55 pt}{\Large\bfseries\MakeUppercase}{}
%\titlespacing{\section}{0pt}{50ex plus 2ex}{10pt}
\fancyheadoffset[RO]{0.20in}
\fancyfootoffset[RO]{0.20in}
\usepackage[paperheight=11.14in,paperwidth=7.71in,left=0.55in,right=0.7in,top=0.36in,bottom=1.5cm]{geometry}

\definecolor{gray}{RGB}{165,165,165}

\definecolor{darkgray}{RGB}{125,125,125}
\setmainfont[
Path = C:/Windows/Fonts/,
BoldFont = UnitPro-Medi.otf,
ItalicFont = UnitPro-Ita.otf,
BoldItalicFont  = UnitPro-Bold.otf]{UnitPro-Light.otf} % bold italic pouzit jako bold verzi

\pagestyle{fancy}

\pgfplotsset{compat = 1.15,
   x axis line style={semithick,gray},
   y axis line style= { draw opacity=0 },
   every axis label/.append style ={darkgray},
   every tick label/.append style={darkgray},
   grid style = { semithick,gray}
 }

\begin{document}
\newpage

\linespread{1}
\section {Hrubý domácí produkt na obyvatele v paritě kupní síly (EU = 100) zde je dalsi text, ktery se musi zobrazovat  s malou mezerou}
\linespread{1.25}
\vskip
\footnotesize{KATEGORIE INDIKÁTORU : }\small\textbf{hlavní}
\newline
\footnotesize{PILÍŘE HOSPODÁŘSKÉHO ROZVOJE (H = hospodářský(ekonomický) / S = sociální / E = environmentální) : }\small\textbf{E}
\newline
\footnotesize{VZTAHUJE SE KE KAPITOLE : }\small\textbf{432 hospodářský podmínka}
\newline
\footnotesize{VZTAHUJE SE K JEVU : }\small\textbf{B037/02}
\newline
\footnotesize{ZDORJ DAT : }\small\textbf{Eurostat, 2016}
\newline
\newline
\footnotesize{POPIS INDIKÁTORU : }\footnotesize\textit{Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016 Eurostat, 2016}
\newline
\newline
\newline
\vspace{10pt}
\begin{tikzpicture}
\begin{axis}[%
width=0.95\textwidth,
height=0.3\textheight,
scale only axis,
xmin=1994.5,
xmax=2016.5,
xtick={1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016},
xticklabel style={/pgf/number format/1000 sep=,font=\tiny},
xtick align=outside,
ymin=0,
ymax=4,
ytick={1, 2, 3, 3},
ytick align =center,
ylabel={[jednotka]},
yticklabel style={/pgf/number format/precision=3,font=\tiny},
ytick style ={draw=none},
ymajorgrids,
axis x line*=bottom,
axis y line*=left
]
\addplot [color=black,mark = *,mark size=1,solid,line width=0.5pt,forget plot]
  table[row sep=crcr]{
1998    1.3  \\
1999    1.5  \\
};
\end{axis}
\end{tikzpicture}
\newline
\newline
\footnotesize{ŽÁDOUCÍ TREND : }\small\textbf{růst}
\newline
\newline
\footnotesize{DATA [jednotka]: }\\
\begin{tabular}{cS[math-rm=\mathbf,table-format=3.2]@{\hspace{5em}}cS[math-rm=\mathbf,table-format=3.2]@{\hspace{5em}}cS[math-rm=\mathbf,table-format=3.2]}
    -    &   & 2000 &  8 & 2010 & 10 \\
    -    &   & 2001 &  8 & 2011 & 10 \\
    -    &   & 2002 &  8 & 2012 & 10 \\
    -    &   & 2003 &  8 & 2013 & 10 \\
    -    &   & 2004 &  8 & 2014 & 10 \\
    1995 & 5 & 2005 &  8 & 2015 & 10 \\
    1996 & 6 & 2006 &  9 & 2016 & 12 \\
    1997 & 7 & 2007 & 10 & & \\
    1998 & 7 & 2008 & 10 & & \\
    1999 & 7 & 2009 & 10 & & \\
\end{tabular}
\end{document}

Result is like this:

enter image description here

Thanks for any idea.

  • Welcome to TeX.SX! – Bobyandbob Dec 7 '17 at 14:55
  • welcome. i can't test this because i don't have the font, but i think the problem may be related to the depth of the font used for the large numeral (even though it has no descender). try applying \smash[b]{...} to that element and see if the situation improves. – barbara beeton Dec 7 '17 at 15:54
  • i'm not sure where to put the command – betka Dec 7 '17 at 16:01
1

Change this line

\titleformat{\section}{\vspace*{6pt}\bfseries\fontsize{36}{36}\selectfont\bfseries}{\thesection.}{55 pt}{\Large\bfseries\MakeUppercase}{}

to this:

\titleformat{\section}{\vspace*{6pt}\fontsize{36}{\the\baselineskip}\selectfont\bfseries}{\thesection.}{55pt}{\Large\bfseries\MakeUppercase}{}

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.