0

I am having some trouble decreasing the length of linespace while inside the table. Some cells are going to contain quite a lot of text, and I would like to minimize the distance between the lines as much as possible, while maintaining it readable. Currently, I could fit another line in between, though I cannot figure out, how to decrease it.

Here is the line of code for table:

\begin{table}[H]
\centering
\caption{Ārējās iedarbības klases}
\label{tab:iedarb_klases}
\small
\begin{tabular}{|p{21mm}|p{59mm}|p{65mm}|}
    \hline
    \textbf{Klašu apzīmējums} & \textbf{ Vides raksturojums} & \textbf{Informatīvi piemēri, kas parāda ārējo iedarbības klašu rašānās iespējas}\\
    \hline
    \multicolumn{3}{|l|}{\textbf{1. Korozijas vai saēšanas risks nepastāv}} \\ \hline
     \textbf{X0} & Betonam bez stiegrojuma vai iebetonētametāla: Visa veida pakļaušana vides ietekmei, izņemot vietas, kur ir sasaldēšanas/atkausēšanas, abrazīvas iedarbības vai ķīmiskas iedarbības risks.\ Betonam ar stiegrojumu vai iebetonētam metālam: Ļoti sausa vide  &  \hline
     M & 43 & 7 \\ \hline
     F & 11 & 39 \\ \hline
\end{tabular} 

\end{table}

And this would be the output, from the given trial: Table

I am quite new to LaTeX, so I am unsure if I am also supposed to paste in all the lines from premable, or that would be unrelated to changing linespace inside table only?

Cheers!

EDIT: This would be my premable:

\usepackage{fontspec}      
\usepackage[a4paper,left=2.54cm,right=2.54cm,top=3.18cm,bottom=3.18cm]{geometry}     
\usepackage{fancyhdr}       
\usepackage{parskip}        
\usepackage{titlesec}
\usepackage{tikz}           
\usepackage{pgfplots}       
\usepackage{xcolor}         
\usepackage{amsmath}        
\usepackage{siunitx}        
\usepackage{listings}       
\PassOptionsToPackage{hyphens}{url} 
\usepackage{hyperref}       
\usepackage{cleveref}       
\usepackage{textcomp}       
\usepackage[latvian]{babel} 
\usepackage{caption}       
\usepackage{subcaption}     
\usepackage{csquotes}       
\usepackage[backend=biber,style=numeric,sorting=none]{biblatex}
\bibliography{bibliography.bib}

\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{float}
\usepackage{calc}
\usepackage[printwatermark=false]{xwatermark} \usepackage{blindtext} \usepackage{titling}

This is the main file:

\documentclass[a4paper,oneside,12pt]{report} %openright

\input{Setup/Statics.tex} \input{Setup/Preamble.tex} \input{Setup/Settings.tex}

% following lines disables hyphenation \tolerance=1 \emergencystretch=\maxdimen \hyphenpenalty=10000 \hbadness=10000

\begin{document}

\pagenumbering{arabic} \input{Frontmatter/Frontpage.tex} \pagecolor{white}

\input{Frontmatter/izpildeslapa.tex} \input{Frontmatter/Bakalauradarbauzdevums.tex} \input{Frontmatter/Inzenierprojektadalas.tex}

\clearpage

\clearpage \input{Frontmatter/Anotacija.tex} \input{Frontmatter/Abstract.tex}

\renewcommand*\contentsname{\LARGE Saturs} \tableofcontents \addcontentsline{toc}{section}{Saturs}

\addtocontents{toc}{\normalsize \textbf{Bakalaura darbs}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \input{Bakalauradarbs/Ievads.tex} \input{Bakalauradarbs/01_Kalposanas_laika_modelesana.tex} \input{Bakalauradarbs/02_Apkartejas_vides_apstakli.tex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \addtocontents{toc}{\normalsize \textbf{Inženierprojekts}} \input{Inzenierprojekts/titullapa.tex} \input{Inzenierprojekts/01_nodala.tex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\printbibliography[heading=bibintoc,title={Izmantotā literatūra}] \bibliographystyle{plain}

\input{Backmatter/Appendix.tex}

\end{document}

And some of the related settings:

% Font
\setmainfont{Times New Roman}
\renewcommand\thepart{Part \Roman{part}}
\titleformat{\part}[display]{\bfseries\huge \centering}{\bfseries\Huge \thepart}{1em}{\thispagestyle{empty}}{}
\titleformat{\chapter}{\bfseries\huge}{\thechapter}{1em}{\centering}
\titleformat{\section}{\bfseries\Large}{\thesection}{12pt}{\centering}
\titleformat{\subsection}{\bfseries\large}{\thesubsection}{1em}{\centering}
\titleformat{\subsubsection}{\bfseries\normalsize}{\thesubsubsection}{1em}{\centering}
\newcommand\TitleFont[1]{{\bfseries #1}}
\newcommand\titlefont[1]{{#1}}
\urlstyle{sf}
%\def\UrlFont{\NeoSansProReg}
% Paragraph

% Table of contents (TOC) and numbering of headings \setcounter{tocdepth}{2} % Depth of table of content: sub sub sections will not be included in table of contents \setcounter{secnumdepth}{2} % Depth of section numbering: sub sub sections are not numbered

\makeatletter % Reset chapter numbering for each part @addtoreset{chapter}{part} \makeatother

% Spacing of titles and captions \titlespacing\chapter{0pt}{0pt plus 4pt minus 2pt}{4pt plus 2pt minus 2pt} \titlespacing\section{0pt}{12pt plus 3pt minus 3pt}{2pt plus 1pt minus 1pt} \titlespacing\subsection{0pt}{8pt plus 2pt minus 2pt}{0pt plus 1pt minus 1pt} \titlespacing\subsubsection{0pt}{4pt plus 1pt minus 1pt}{-2pt plus 1pt minus 1pt} \captionsetup{belowskip=\parskip,aboveskip=4pt plus 1pt minus 1pt}

% Setup header and footer \cfoot{Page \thepage}

\setlength{\parindent}{4em} \setlength{\parskip}{0em} \renewcommand{\baselinestretch}{1.5}

  • 1
    It would at least be interesing to know how you initially increased the linespacing for the whole document. Therefore, please prepare a complete minimal working example (MWE) that allows others to reproduce the output you get. – leandriis Jul 01 '20 at 14:39
  • https://tex.stackexchange.com/q/26167/134144 could be related. – leandriis Jul 01 '20 at 14:40
  • 1
    Do please tell us which document class you employ and how you modify the linespacing for the document as a whole. E.g., do you reset low-level macros such as \baselineskip and/or \baselinestretch? Do you load the setspace package? Please be specific. – Mico Jul 01 '20 at 14:43
  • I have added the missing parts. – Richards Jul 01 '20 at 15:41
  • You have posted far too much code but none of it is usable as we can not run it \input{Frontmatter/izpildeslapa.tex} only works on your machine. Please post a small single file, single table document that shows the problem that you are asking about. – David Carlisle Jul 01 '20 at 15:53
  • not directly related but do you have to have % following lines disables hyphenation \tolerance=1 \emergencystretch=\maxdimen \hyphenpenalty=10000 \hbadness=10000 This does not just disable hyphenation it specifies that white space can stretch in arbitrarily bad ways and that you don't wish to be warned about any bad output. – David Carlisle Jul 01 '20 at 15:54
  • @DavidCarlisle, as I mentioned, I am fairly new and was not aware of this. Was looking for a solution to stop hyphenation. How would I go about adjusting that line to only disable it? – Richards Jul 01 '20 at 15:57
  • The line \renewcommand{\baselinestretch}{1.5} that you show is increasing the line spacing so in principle you could just set it back to 1 for teh table but your image looks like much more than 1.5 spacing so somewheer in code not shown you are probably setting this sgain. – David Carlisle Jul 01 '20 at 15:58
  • @DavidCarlisle , I removed that single line and the whole document now has minimal linespace. Is there a correct way of doing this, so I can seperate the settings for tabular and text environment? – Richards Jul 01 '20 at 16:00
  • Do you have to suppress hyphenation? :-) It makes reasonable output a lot harder. If you really must then https://texfaq.org/FAQ-hyphoff – David Carlisle Jul 01 '20 at 16:03
  • You could look at the setspace package that automatically reverts the spacing in tables and footnotes etc – David Carlisle Jul 01 '20 at 16:04
  • Thanks, @DavidCarlisle, found the solution to my problem :) – Richards Jul 01 '20 at 16:20

0 Answers0