
Text Formatting ⇒ Undefined old font command
-
- Posts: 45
- Joined: Wed May 25, 2016 7:04 am
Undefined old font command
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 (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
Reason: scaled image down so it won't destroy the forum view on small screens
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Undefined old font command
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
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.
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.
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Undefined old font command
As an addition, replace
Or use it like
Stefan
\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
-
- Posts: 45
- Joined: Wed May 25, 2016 7:04 am
Undefined old font command
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?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 optionenabledeprecatedfontcommands
, 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.
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Undefined old font command
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.
-
- Posts: 45
- Joined: Wed May 25, 2016 7:04 am
Undefined old font command
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 aboutJohannes_B wrote:That would be a good start. But some packages also use the old font commands, most notablyfanyhdr
. 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 calledscrlayer-scrpage
.
scrbook
class, regards!- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Undefined old font command
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
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
-
- Posts: 45
- Joined: Wed May 25, 2016 7:04 am
Undefined old font command
I hope it will not be a problem on the language because I wrote in Spanish usingStefan_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
babel
, so here is my codeCode: 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) innode[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]{}
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Undefined old font command
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.
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.
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Undefined old font command
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
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.
EDIT: Package fontenc with opion T1 is missing as well.
Add
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) innode[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
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.