General ⇒ line spacing [baselinestretch]
line spacing [baselinestretch]
I'm solving a problem with line spacing in the parts of text (article). For example the content I need to be made with line spacing 1.0 (standart) and other text with 1.5.
I tried to use command \renewcommand{\baselinestretch}{1.5} in front of assigned parts, but that was without efect.
I've attached part of my work. The parts that I want change line spacing in are marked.
Thank you
- Attachments
-
- LaTeX1.tex
- (4.66 KiB) Downloaded 753 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
line spacing [baselinestretch]
I recommend the setspace package. That package provides commands (\singlespacing, \onehalfspacing and \doublespacing) and environments (singlespace, onehalfspace and doublespace) that allow to change the spacing within the document. You will find the documentation inside the setspace.sty file.
Stefan
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
line spacing [baselinestretch]
Code: Select all
\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[czech]{babel}
\usepackage[bindingoffset=1cm,centering,includeheadfoot,margin=2cm]{geometry}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{txfonts}
\usepackage{blindtext}
\begin{document}
\onehalfspacing
\blindtext
\medskip
\singlespacing
\blindtext
\medskip
\doublespacing
\blindtext
\end{document}
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: line spacing [baselinestretch]
pls where I have to insert the file setspace.sty?
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
Re: line spacing [baselinestretch]
do you use MiKTeX on Windows? Then you could install it with the MiKTeX Package Manager (Browse packages). But first check if it is already installed, try to compile your document after you included the line \usepackage{setspace} like Thorsten showed above.
Stefan
Re: line spacing [baselinestretch]
I use such structure
{\renewcommand{\baselinestretch}{1.5}
Your text1.
After this text you need insert blank line that make "Latex group".
}
{\renewcommand{\baselinestretch}{1}
Your text2.
After this text you need insert blank line.
}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
line spacing [baselinestretch]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10