0

Within a \tabular environment, in a cell with several lines, I cannot change the distance between text lines using \fontsize.

With this code:

\documentclass[a3paper]{article} \usepackage[margin={7mm,18mm,7mm,7mm},noheadfoot]{geometry} \usepackage[T1]{fontenc} \usepackage{helvet} \usepackage{multicol} \usepackage{array} \usepackage{lipsum} \renewcommand{\familydefault}{\sfdefault} \setlength{\columnsep}{14mm} \def\arraystretch{1.5} \setlength\tabcolsep{0.5mm} \newcommand{\monthTitle}[1]{ {\fontsize{36pt}{30pt}\selectfont \textbf{\uppercase{#1}}} \vspace{2mm} } \newcommand{\monthLine}[4]{ {\fontsize{28pt}{30pt}\selectfont \textbf{#1}} & {\fontsize{28pt}{30pt}\selectfont \textbf{#2}} & {\fontsize{7pt}{6pt}\selectfont #3} & #4 \\ \hline\\[-4mm] } \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}b{#1}} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}b{#1}} \begin{document} \begin{multicols}{2} \monthTitle{Title} \begin{tabular}{R{12mm}L{9mm}L{99mm}C{5mm}} \hline\\[-4mm] \monthLine{1}{D}{\lipsum[1][1-4]}{o} \monthLine{10}{M}{\lipsum[1][1]}{} \end{tabular} \vfill\null \columnbreak \monthTitle{Title} \vfill\null \columnbreak \end{multicols} \end{document} 

I get this result:

actual result

while I would like this:

desired result

Changing second parameter of {\fontsize{7pt}{6pt}\selectfont #3} inside \newcommand{\monthLine}[4] take no effect.

2
  • 1
    you need a \par for the change to be effective. off-topic: don't use \uppercase. Commented Jun 29 at 15:47
  • The second argument of \fontsize should be at least as large as the first. Instructions such as \fontsize{36pt}{30pt} and \fontsize{7pt}{6pt} look suspiciously like user error. Commented Jun 29 at 16:01

1 Answer 1

2

this is unrelated to being in a table, all your usages have the form {\fontsize{28pt}{30pt}\selectfont \textbf{#2}} so the paragraph ends outside the group so is set with the baselineskip in effect before the group.

Either use \par before the final } to end the paragraph, or more naturally here do not use the outer group at all, so the font and baseline setting is still in effect when the cell ends, which will end the paragraph.

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.