Text FormattingUndefined old font command

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Undefined old font command

Post by Stefan Kottwitz »

Another recommendation: never use font commands or spacing commands in the document body. Define macros that use them. The reason is: you can easily adjust the macro to fine-tune the whole text. Otherwise each change needs to be made at a lot of places.

Example, one of your multi-line equations changed:

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[leqno]{mathtools}
\newtagform{bold}{}{\textbf{)}}
\usetagform{bold}
\renewcommand*{\theequation}{\textbf{Ej. 1.}}
\newcommand{\remark}[1]{& \quad \longleftarrow
& \quad\fontsize{8}{0}\selectfont\parbox{0.25\textwidth}{\raggedright#1}}
\setlength{\jot}{10pt}
\begin{document}
\begin{equation}
\begin{alignedat}[t]{2}
\int \frac{x^2 + x + 1}{\sqrt{x}}\,dx
&= \int \frac{x^2}{\sqrt{x}}\,dx
+ \int \frac{x}{\sqrt{x}}\,dx + \int \frac{1}{\sqrt{x}}\,dx
\remark{separar en 3 integrales} \\
&= \int \frac{x^2}{x^{1/2}}\,dx + \int \frac{x}{x^{1/2}}\,dx
+ \int \frac{1}{x^{1/2}}\,dx
\remark{escribir los radicales en forma de potencia} \\
&= \int x^{3/2}\,dx + \int x^{1/2}\,dx + \int x^{- 1/2}\,dx
\remark{reescribir} \\
&= \frac{x^{5/2}}{5/2} + \frac{x^{3/2}}{3/2} + \frac{x^{1/2}}{1/2} + C
\remark{integrar} \\
&= \frac{2}{5}\,x^{5/2} + \frac{2}{3}\,x^{3/2} + 2\,\sqrt{x} +
\remark{simplificar}
\end{alignedat}
\end{equation}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
formulas.png
formulas.png (14.71 KiB) Viewed 13078 times
Stefan
LaTeX.org admin

Recommended reading 2024:

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

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

danielvelizv
Posts: 45
Joined: Wed May 25, 2016 7:04 am

Undefined old font command

Post by danielvelizv »

Johannes_B wrote: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.
I thought about this, I have to improve in my typeset ability because I don't have so much time in LaTeX, a lot of automatic processes like numbering I do this manually due to the problem of doing my own customs with other instructions and environments, I improvise a lot and I want to stop doing this by this way. I need better recommendations, especially in this document, it is a part of an important work I want to publish in a future and I need help of professional people I don't find in my country in this software...
danielvelizv
Posts: 45
Joined: Wed May 25, 2016 7:04 am

Undefined old font command

Post by danielvelizv »

Stefan_K wrote:Another recommendation: never use font commands or spacing commands in the document body. Define macros that use them. The reason is: you can easily adjust the macro to fine-tune the whole text. Otherwise each change needs to be made at a lot of places.

Example, one of your multi-line equations changed:

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[leqno]{mathtools}
\newtagform{bold}{}{\textbf{)}}
\usetagform{bold}
\renewcommand*{\theequation}{\textbf{Ej. 1.}}
\newcommand{\remark}[1]{& \quad \longleftarrow
& \quad\fontsize{8}{0}\selectfont\parbox{0.25\textwidth}{\raggedright#1}}
\setlength{\jot}{10pt}
\begin{document}
\begin{equation}
\begin{alignedat}[t]{2}
\int \frac{x^2 + x + 1}{\sqrt{x}}\,dx
&= \int \frac{x^2}{\sqrt{x}}\,dx
+ \int \frac{x}{\sqrt{x}}\,dx + \int \frac{1}{\sqrt{x}}\,dx
\remark{separar en 3 integrales} \\
&= \int \frac{x^2}{x^{1/2}}\,dx + \int \frac{x}{x^{1/2}}\,dx
+ \int \frac{1}{x^{1/2}}\,dx
\remark{escribir los radicales en forma de potencia} \\
&= \int x^{3/2}\,dx + \int x^{1/2}\,dx + \int x^{- 1/2}\,dx
\remark{reescribir} \\
&= \frac{x^{5/2}}{5/2} + \frac{x^{3/2}}{3/2} + \frac{x^{1/2}}{1/2} + C
\remark{integrar} \\
&= \frac{2}{5}\,x^{5/2} + \frac{2}{3}\,x^{3/2} + 2\,\sqrt{x} +
\remark{simplificar}
\end{alignedat}
\end{equation}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
formulas.png
Stefan
I thought about this, I have to improve in my typeset ability because I don't have so much time in LaTeX, a lot of automatic processes like numbering I do this manually due to the problem of doing my own customs with other instructions and environments, I improvise a lot and I want to stop doing this by this way. I need better recommendations, especially in this document, it is a part of an important work I want to publish in a future and I need help of professional people I don't find in my country in this software...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Undefined old font command

Post by Stefan Kottwitz »

Hi Daniel,

you can achieve great results with LaTeX, it just requires some learning, that's no problem. Reading and understanding - here's some stuff to read: LaTeX Resources for Beginners - especially the book of Nicola is recommendable. I wrote two books about LaTeX, so I know what's hard and I can help to understand.

Regarding understanding - you can post any question here, we will help. While we cannot replace reading an introduction, we don't have a problem to answer 100 questions you may have while learning LaTeX.

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:Hi Daniel,

you can achieve great results with LaTeX, it just requires some learning, that's no problem. Reading and understanding - here's some stuff to read: LaTeX Resources for Beginners - especially the book of Nicola is recommendable. I wrote two books about LaTeX, so I know what's hard and I can help to understand.

Regarding understanding - you can post any question here, we will help. While we cannot replace reading an introduction, we don't have a problem to answer 100 questions you may have while learning LaTeX.


Stefan
Thanks Stefan, I checked the link in your response, Johannes made some modifications in my code and I noticed LaTeX compiled successfully a little bit faster. I need to learn much more about macros for example, I want to apply the one you used to align equations in a response below (I will need help to understand well what you did there) and apply that in the following parts of my work, thanks both again for your efforts to answer all questions, you are great!
Post Reply