Text FormattingCustomized Font Size

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Sventimir
Posts: 3
Joined: Fri Mar 23, 2012 4:21 pm

Customized Font Size

Post by Sventimir »

Hello everybody, I'm new here.

And for the beginning I've got a problem. First of all it doesn't recognize commands changing font size (e.g. \large, \small and so on). When I define document class as "minimal", an error of undefined control sequence occurs, otherwise the code is compiled properly, but font size is left unchanged all the same.

Secondly I tried to use \fontsize{x}{y} command, but then another error occured:

Code: Select all

! Missing number, treated as zero.
<to be read again> 
                   \aftergroup 
l.24 \center \textbf \fontsize
                              {12}{15} 1
What can I do? I suppose some package is missing, but no idea what could it be. Thanks for any help.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Customized Font Size

Post by localghost »

Never ever use the »minimal« class! It does not define anything including the mentioned font size commands. The second issue might be related to that. But due missing information caused by an absent minimal example that is difficult to diagnose.


Best regards and welcome to the board
Thorsten
Sventimir
Posts: 3
Joined: Fri Mar 23, 2012 4:21 pm

Customized Font Size

Post by Sventimir »

Well, here's the code (after replacing {minimal} with {book}):

Code: Select all

\documentclass[12pt, a4paper]{book}
\usepackage[landscape]{geometry}
\usepackage{fullpage}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\usepackage[polish]{babel}

\begin{document}
\vspace*{\fill}
\center \textbf \huge 1
\vspace*{\fill}
\end{document}
The point is to produce a huge number 1 in the center of the sheet. My TeXWorks however compiles a normal 12pt. "1" there. What's the problem?

When I produce something like that:

Code: Select all

\documentclass[12pt, a4paper]{book}
\usepackage[landscape]{geometry}
\usepackage{fullpage}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\usepackage[polish]{babel}

\begin{document}
\vspace*{\fill}
\center \textbf \fontsize{50}{100} 1
\vspace*{\fill}
\end{document}
it returns an error:

Code: Select all

! Missing number, treated as zero.
<to be read again> 
                   \aftergroup 
l.10 \center \textbf \fontsize
                              {100}{200}1
? 
! Illegal unit of measure (pt inserted).
<to be read again> 
                   \aftergroup 
l.10 \center \textbf \fontsize
                              {100}{200}1
? 
! Missing number, treated as zero.
<to be read again> 
                   p
l.10 \center \textbf \fontsize
                              {100}{200}1
? 
What's going on?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Customized Font Size

Post by Stefan Kottwitz »

Hi,
Sventimir wrote:

Code: Select all

\center \textbf \fontsize{50}{100} 1
  • Consider using \centering instead. \center actually means an environment and should be used like \begin{center} ... \end{center}.
  • \textbf requires an argument, such as \textbf{1}. If you don't give an argument, use the declaration \bfseries instead.
  • \fontsize{...}{...} should be followed by \selectfont.
Stefan
LaTeX.org admin
Sventimir
Posts: 3
Joined: Fri Mar 23, 2012 4:21 pm

Re: Customized Font Size

Post by Sventimir »

Now its working. Thank you very much. But what sort of argument does "\textbf" require? It must be something new for I didn't find it in any manual or course and I checked a few of them.
checatavo
Posts: 1
Joined: Fri Apr 06, 2012 1:47 am

Re: Customized Font Size

Post by checatavo »

hello everybody i am working on latex and now i have a problem when I want to increase the size of the fonts, maximum size is 25 but I want more than that. what i can do whit this problem, any ideas??
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Customized Font Size

Post by Stefan Kottwitz »

Hi,

welcome to the board!

That's no problem. For example, this works fine for me:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage{lmodern}
\begin{document}
\fontsize{60}{70}\selectfont Huge text
\end{document}
Btw. for a new question please create a new topic, don't attach to an existing one. However it's good to add a link to the older topic, for further information. As you can see, the topic has already been marked as solved, with the check mark, so there's less chance that somebody reads your additional question - that's why writing a new topic is better.

Stefan
LaTeX.org admin
Post Reply