Text FormattingProblem with leading etc.

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
krz
Posts: 63
Joined: Thu Jul 22, 2010 5:03 pm

Problem with leading etc.

Post by krz »

Hi,
Do you know how to set line spacing in pt? Or maybe know how to set it by using \linespread? I know that 15,5 pt for font 12 pt = 1.069, but I'm not sure how to use it for font 10 pt and line spacing 12 pt. I tried to calculate it and I got 1.076. Is it true? If not, how to calcuate it?
I tried to use \fontsize{10}{12} too, but it didn't work. I put it into preambule and document area but with no result.
I know there is package {setspace}, but I don't know how to use it with pt.

And by the way, do you know if it's a method to change spaces between words in a whole line?

krz

Updating.
I've just found I put \fontsize in wrong way. It should look like this \begin{document}\fontsize{10}{12}\rm (by the way do you know what \rm is for?)
Despite that I found it I still ask if it's possible to use {setspace} with pt and if I can set spaces between words?
Last edited by krz on Thu Oct 07, 2010 11:37 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Problem with leading etc.

Post by meho_r »

There is a package you may want to try: leading.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Problem with leading etc.

Post by frabjous »

Did you use \selectfont to "activate" \fontsize?

Code: Select all

\fontsize{10}{12}\selectfont
"\rm" means "Roman" (as opposed to italic, etc.); however, that command is obsolete. You would use "\rmfamily" instead. But it's probably not necessary here.
krz
Posts: 63
Joined: Thu Jul 22, 2010 5:03 pm

Re: Problem with leading etc.

Post by krz »

No, I didn't use \selectfont. I have what I wrote above.
What is it for? Is it to choose a font in a document? I use
\usepackage[T1]{fontenc}
\usepackage{fouriernc}
to choose it.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Problem with leading etc.

Post by frabjous »

\selectfont by itself doesn't choose a font, it just activates the font commands (such as \fontsize) you've already made. More details in the »Font Guide«.

If all you're doing is changing the fontsize and spacing, then \fontsize{10}{12}\selectfont should do it. The selectfont is necessary to activate the \fontsize command.

Generally it's preferable to use packages to do font control, but if no packages are doing the trick, then you can use these low level commands instead.
krz
Posts: 63
Joined: Thu Jul 22, 2010 5:03 pm

Re: Problem with leading etc.

Post by krz »

Thanks, frabjous,
I've just checked it and it works, but it also works without \selectfont when I put \fontsize in the same line as \begin{document}.
I'm just curious how I can change line spacing in document. I've just checked it didn't work when I put \fontsize{with different sizes} in another place in document. It changed only size of font. Line spacig is still the same as in first \fontsize command.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Problem with leading etc.

Post by frabjous »

Please provide a minimal working example showing an instance where it doesn't work.
krz
Posts: 63
Joined: Thu Jul 22, 2010 5:03 pm

Re: Problem with leading etc.

Post by krz »

frabjous,
I'm (how to say...?) stupid. 5 minutes after you explained me that I had to use \selectfont I forgot to do it. When I added it started to work. :)

Can you help me with another problem? I don't know how to change font size in footnotes and size of number mark, both in text and footnote area. I use footmisc package and looked through a manual, but I couldn't find an information.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Problem with leading etc.

Post by frabjous »

With footmisc, you can introduce arbitrary code into how the footnotes are typeset by redefining the \footnotelayout command, so to change the fontsize and spacing of footnote, you could use something like:

Code: Select all

\renewcommand*{\footnotelayout}{\fontsize{12}{14}\selectfont}
An alternative might be to renew the \footnotesize command, but that might have other unintended consequences.

The footnote numbers are typeset using \thefootnote command, so you could redefine it as follows:

Code: Select all

\renewcommand*{\thefootnote}{\normalsize\arabic{footnote}}
Replace "\normalsize" with one of the other sizing commands, or even "\fontsize{X}{Y}\selectfont" if you need to.

Some of this may be different if you are still loading setspace (though I'm not sure you need to if you're using \fontsize instead.) Again, it's much easier to give advice with a minimal working example of your usage.
krz
Posts: 63
Joined: Thu Jul 22, 2010 5:03 pm

Re: Problem with leading etc.

Post by krz »

Thanks!
I had to fight with \renewcommand for some time (I'm still a beginer in LaTeX), but now it looks great. I can change font size in footnotes as I want.
I'll study MWE to resolve problems.
Post Reply