Text FormattingUndefined old font command

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
danielvelizv
Posts: 45
Joined: Wed May 25, 2016 7:04 am

Undefined old font command

Post by danielvelizv »

Hello people! I have a problem, two months ago I full installed Miktex with all packages in my laptop on Windows 7, in another PC I worked a document with the same packages but when I tried to compile the same document in my laptop, it shows me the following error in the attached picture in this post, I don't know what's happening, I have the same number of packages installed on both computers. Can anyone help me on this? :?:
Attachments
error-latex.png
error-latex.png (143.36 KiB) Viewed 32652 times
Last edited by cgnieder on Wed Sep 21, 2016 9:10 pm, edited 1 time in total.
Reason: scaled image down so it won't destroy the forum view on small screens

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Undefined old font command

Post by Johannes_B »

You (or a package you are using) are using font commands that are officially obsolete since 1994. The author of KOMA-script decided to finally encourage people to stop using them.
You can use the global option enabledeprecatedfontcommands, which by definition is also deprecated.

By the way, a minimal working example and an upload of the log-file is much better than a screenshot. I cannot copy the text to run LaTeX on it myself and see the problem. Luckily, in this case the reason is easy to know.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Undefined old font command

Post by Stefan Kottwitz »

As an addition, replace \bf by \bfseries or by \normalfont\bfseries.

Or use it like \textbf{...} similar as you already use \textcolor{...}. Such commands can be nested, such as \textbf{\textcolor{...}}.

Stefan
LaTeX.org admin
danielvelizv
Posts: 45
Joined: Wed May 25, 2016 7:04 am

Undefined old font command

Post by danielvelizv »

Johannes_B wrote:You (or a package you are using) are using font commands that are officially obsolete since 1994. The author of KOMA-script decided to finally encourage people to stop using them.
You can use the global option enabledeprecatedfontcommands, which by definition is also deprecated.

By the way, a minimal working example and an upload of the log-file is much better than a screenshot. I cannot copy the text to run LaTeX on it myself and see the problem. Luckily, in this case the reason is easy to know.
Thanks buddy. I didn't know that, I was looking for this in a lot of websites, So, for both explanations I read, I have to edit all deprecated commands in my TeX file, no?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Undefined old font command

Post by Johannes_B »

That would be a good start. But some packages also use the old font commands, most notably fanyhdr. Using that package with a KOMA class is not recommended anyway, as KOMA-script comes with its own package to style header and footer. It is called scrlayer-scrpage.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
danielvelizv
Posts: 45
Joined: Wed May 25, 2016 7:04 am

Undefined old font command

Post by danielvelizv »

Johannes_B wrote:That would be a good start. But some packages also use the old font commands, most notably fanyhdr. Using that package with a KOMA class is not recommended anyway, as KOMA-script comes with its own package to style header and footer. It is called scrlayer-scrpage.
That's very good, I don't know how much I have to change my TeX. Is there any possibity to send to any of you (you or Stefan) and check and comment the modifications in my file? I want to learn about scrbook class, regards!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: Undefined old font command

Post by Stefan Kottwitz »

You can post your code here and we can make suggestions.

It's a public forum - would we start moving know-how to private messages it would not have public use anymore.

Stefan
LaTeX.org admin
danielvelizv
Posts: 45
Joined: Wed May 25, 2016 7:04 am

Undefined old font command

Post by danielvelizv »

Stefan_K wrote:You can post your code here and we can make suggestions.

It's a public forum - would we start moving know-how to private messages it would not have public use anymore.

Stefan
I hope it will not be a problem on the language because I wrote in Spanish using babel, so here is my code

Code: Select all

Code, edit and compile here:
\documentclass[10pt,letterpaper,fleqn]{scrbook}
\usepackage[left=3cm,right=2.5cm,top=2.5cm,bottom=2.5cm, marginparwidth=2.85cm, marginparsep=0pt]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{mathtools} %MANIPULACIÓN DE LA ALINEACIÓN LATERAL DE LAS EXPRESIONES MATEMÁTICAS
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{array}
\usepackage{marginnote} %COLOCACIÓN DE NOTAS DE PÁGINA EN LOS LADOS
\usepackage{setspace} %SEPARACIÓN DE LÍNEAS EN PÁRRAFOS
\usepackage{fancyhdr} %ENCABEZADOS DECORADOS
\usepackage{cancel} %CANCELACIÓN DE TÉRMINOS
\usetikzlibrary{calc}
\usetikzlibrary{shapes.callouts} %CUADROS DE IDEAS
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning}
\newcommand{\titulo}{{\fontsize{8}{0}\selectfont \sf 650 integrales indefinidas \\[-0.5ex] resueltas ¡paso a paso!}}
\newcommand{\inmediata}{{\fontsize{8}{0}\selectfont \sf Integrales inmediatas}}
\usepackage{varwidth}
\def\cabecera#1{%\x2-\x1 CABECERA EN LA PRIMERA PÁGINA DEL CAPÍTULO
% \thispagestyle{empty}
\begin{tikzpicture}[overlay, remember picture]
\draw let \p1 = (current page.west), \p2 = (current page.east) in
node[minimum width=\x2-\x1, minimum height=3cm, line width=0pt, rectangle, fill=gris!80, anchor=north west, align=left, text width=17cm] at ($(current page.north west)$) {#1};
\end{tikzpicture}
}
\pagestyle{fancy}
\fancyhead[LE]{\inmediata}
\fancyhead[RO]{\inmediata}
\fancyhead[RE]{\titulo}
\fancyhead[LO]{\titulo}
\fancyfoot[LE]{\bf \thepage} %NUMERACIÓN EN LAS PÁGINAS PARES
\fancyfoot[RO]{\bf \thepage} %NUMERACIÓN EN LAS PÁGINAS IMPARES
\fancyfoot[C]{}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Undefined old font command

Post by Johannes_B »

That's the good thing, the relevant LaTeX code is the same for all of us. There is no language barrier.

Another thing though, you really should have read soma basics about LaTeX. You are doing everything by hand, leaving behind spaghetti code of the worst kind.

I'll see what i can do to slim things up a bit.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Undefined old font command

Post by Johannes_B »

The following at least took care of the headers and footers. The rest, it is just too much to invest time in it.

For your next projects, use proper empty lines to separate paragraphs. You are making LaTeX a very hard time by avoiding them.
Don't use \displaystyle in inline mode. It make the text ugly.
Don't number stuff by hand. LaTeX is supposed to do that for you.
There are excellent pacages like exsheets that help you setting up this kind of documents. Also very helpful for what you want to do: tasks.

Code: Select all

Code, edit and compile here:
\documentclass[10pt,letterpaper,fleqn,
headsepline,footsepline,
plainheadsepline,plainfootsepline,
]{scrbook}
\usepackage[left=3cm,right=2.5cm,top=2.5cm,bottom=2.5cm, marginparwidth=2.85cm, marginparsep=0pt,head=22.22223pt]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{mathtools} %MANIPULACIÓN DE LA ALINEACIÓN LATERAL DE LAS EXPRESIONES MATEMÁTICAS
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{array}
\usepackage{marginnote} %COLOCACIÓN DE NOTAS DE PÁGINA EN LOS LADOS
\usepackage{setspace} %SEPARACIÓN DE LÍNEAS EN PÁRRAFOS
% \usepackage{fancyhdr} %ENCABEZADOS DECORADOS
\usepackage{cancel} %CANCELACIÓN DE TÉRMINOS
\usetikzlibrary{calc}
\usetikzlibrary{shapes.callouts} %CUADROS DE IDEAS
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning}
\usepackage{varwidth}
\def\cabecera#1{%\x2-\x1 CABECERA EN LA PRIMERA PÁGINA DEL CAPÍTULO
% \thispagestyle{empty}
\begin{tikzpicture}[overlay, remember picture]
\draw let \p1 = (current page.west), \p2 = (current page.east) in
node[minimum width=\x2-\x1, minimum height=3cm, line width=0pt, rectangle, fill=gris!80, anchor=north west, align=left, text width=17cm] at ($(current page.north west)$) {#1};
\end{tikzpicture}
}
% \pagestyle{fancy}
%
% \fancyhead[LE]{\inmediata}
% \fancyhead[RO]{\inmediata}
% \fancyhead[RE]{\titulo}
% \fancyhead[LO]{\titulo}
%
% \fancyfoot[LE]{\bf \thepage} %NUMERACIÓN EN LAS PÁGINAS PARES
% \fancyfoot[RO]{\bf \thepage} %NUMERACIÓN EN LAS PÁGINAS IMPARES
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
EDIT: Package fontenc with opion T1 is missing as well.
Add \usepackage[T1]{fontenc} to your preamble.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply