Font style in ref and autoref
up vote
0
down vote
favorite
I'd like to use both autoref and ref, so when enumerating references in the text I can get something like "Ecuaciones 1 y 2" (with Ecuación 1 being a link inserted by autoref and 2 a link inserted by ref). The problem is that I need all the references in the text to be sans serif, but I can't get autoref and ref to use sans serif by default, and inserting textsf or sffamily in every case wouldn't be practical. With this MWE:
documentclass[twoside, 11pt]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
renewcommand{theequation}{sffamilythechapter.arabic{equation}}
renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
begin{document}
Este texto es sólo para incluir las referencias a la autoref{tab:prueba}, la autoref{eq:ecuacion1} y la ref{eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}
I get this:

which shows a terrible mess of mismatched fonts: Tabla 0.0 is all serif, Ecuación is in serif, but 0.1 and 0.2 are sans serif.
I tried things like:
renewcommand{thetable}{sffamilythechapter.arabic{table}}
but doing so ruins the formatting of the captions.
Is there any way of getting all cross references in sans serif? Thanks.
fonts cross-referencing ref autoref
New contributor
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
favorite
I'd like to use both autoref and ref, so when enumerating references in the text I can get something like "Ecuaciones 1 y 2" (with Ecuación 1 being a link inserted by autoref and 2 a link inserted by ref). The problem is that I need all the references in the text to be sans serif, but I can't get autoref and ref to use sans serif by default, and inserting textsf or sffamily in every case wouldn't be practical. With this MWE:
documentclass[twoside, 11pt]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
renewcommand{theequation}{sffamilythechapter.arabic{equation}}
renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
begin{document}
Este texto es sólo para incluir las referencias a la autoref{tab:prueba}, la autoref{eq:ecuacion1} y la ref{eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}
I get this:

which shows a terrible mess of mismatched fonts: Tabla 0.0 is all serif, Ecuación is in serif, but 0.1 and 0.2 are sans serif.
I tried things like:
renewcommand{thetable}{sffamilythechapter.arabic{table}}
but doing so ruins the formatting of the captions.
Is there any way of getting all cross references in sans serif? Thanks.
fonts cross-referencing ref autoref
New contributor
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'd like to use both autoref and ref, so when enumerating references in the text I can get something like "Ecuaciones 1 y 2" (with Ecuación 1 being a link inserted by autoref and 2 a link inserted by ref). The problem is that I need all the references in the text to be sans serif, but I can't get autoref and ref to use sans serif by default, and inserting textsf or sffamily in every case wouldn't be practical. With this MWE:
documentclass[twoside, 11pt]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
renewcommand{theequation}{sffamilythechapter.arabic{equation}}
renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
begin{document}
Este texto es sólo para incluir las referencias a la autoref{tab:prueba}, la autoref{eq:ecuacion1} y la ref{eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}
I get this:

which shows a terrible mess of mismatched fonts: Tabla 0.0 is all serif, Ecuación is in serif, but 0.1 and 0.2 are sans serif.
I tried things like:
renewcommand{thetable}{sffamilythechapter.arabic{table}}
but doing so ruins the formatting of the captions.
Is there any way of getting all cross references in sans serif? Thanks.
fonts cross-referencing ref autoref
New contributor
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I'd like to use both autoref and ref, so when enumerating references in the text I can get something like "Ecuaciones 1 y 2" (with Ecuación 1 being a link inserted by autoref and 2 a link inserted by ref). The problem is that I need all the references in the text to be sans serif, but I can't get autoref and ref to use sans serif by default, and inserting textsf or sffamily in every case wouldn't be practical. With this MWE:
documentclass[twoside, 11pt]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
renewcommand{theequation}{sffamilythechapter.arabic{equation}}
renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
begin{document}
Este texto es sólo para incluir las referencias a la autoref{tab:prueba}, la autoref{eq:ecuacion1} y la ref{eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}
I get this:

which shows a terrible mess of mismatched fonts: Tabla 0.0 is all serif, Ecuación is in serif, but 0.1 and 0.2 are sans serif.
I tried things like:
renewcommand{thetable}{sffamilythechapter.arabic{table}}
but doing so ruins the formatting of the captions.
Is there any way of getting all cross references in sans serif? Thanks.
fonts cross-referencing ref autoref
fonts cross-referencing ref autoref
New contributor
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 hours ago
Pertrecho
1
1
New contributor
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Pertrecho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The cleveref package does all the hard work for you:
documentclass[twoside, 11pt,spanish]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
%renewcommand{theequation}{sffamilythechapter.arabic{equation}}
%renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
usepackage[capitalise,nameinlink,noabbrev]{cleveref}
makeatletter
def@setcref{sffamily@@setcref{cref}}%
makeatother
begin{document}
Este texto es sólo para incluir las referencias a la cref{tab:prueba}, la cref{eq:ecuacion1,eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}

New contributor
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The cleveref package does all the hard work for you:
documentclass[twoside, 11pt,spanish]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
%renewcommand{theequation}{sffamilythechapter.arabic{equation}}
%renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
usepackage[capitalise,nameinlink,noabbrev]{cleveref}
makeatletter
def@setcref{sffamily@@setcref{cref}}%
makeatother
begin{document}
Este texto es sólo para incluir las referencias a la cref{tab:prueba}, la cref{eq:ecuacion1,eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}

New contributor
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
The cleveref package does all the hard work for you:
documentclass[twoside, 11pt,spanish]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
%renewcommand{theequation}{sffamilythechapter.arabic{equation}}
%renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
usepackage[capitalise,nameinlink,noabbrev]{cleveref}
makeatletter
def@setcref{sffamily@@setcref{cref}}%
makeatother
begin{document}
Este texto es sólo para incluir las referencias a la cref{tab:prueba}, la cref{eq:ecuacion1,eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}

New contributor
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
up vote
0
down vote
The cleveref package does all the hard work for you:
documentclass[twoside, 11pt,spanish]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
%renewcommand{theequation}{sffamilythechapter.arabic{equation}}
%renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
usepackage[capitalise,nameinlink,noabbrev]{cleveref}
makeatletter
def@setcref{sffamily@@setcref{cref}}%
makeatother
begin{document}
Este texto es sólo para incluir las referencias a la cref{tab:prueba}, la cref{eq:ecuacion1,eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}

New contributor
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
The cleveref package does all the hard work for you:
documentclass[twoside, 11pt,spanish]{book}
usepackage[utf8]{inputenc}
usepackage[spanish, es-noindentfirst, es-nosectiondot]{babel}
%renewcommand{theequation}{sffamilythechapter.arabic{equation}}
%renewcommand{thetable}{thechapter.arabic{figure}}
usepackage[font={sf, footnotesize}]{caption}
usepackage[colorlinks=true]{hyperref}
usepackage[capitalise,nameinlink,noabbrev]{cleveref}
makeatletter
def@setcref{sffamily@@setcref{cref}}%
makeatother
begin{document}
Este texto es sólo para incluir las referencias a la cref{tab:prueba}, la cref{eq:ecuacion1,eq:ecuacion2}.
begin{table}
begin{center}
caption{Prueba de tabla.}
label{tab:prueba}
begin{tabular}{c c c}
Columna 1 & Columna 2 & Resultados\
1 & 1 & 2
end{tabular}
end{center}
end{table}
begin{equation}
label{eq:ecuacion1}
1 + 1 = 2
end{equation}
begin{equation}
label{eq:ecuacion2}
1 + 1 = 2
end{equation}
end{document}

New contributor
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 56 mins ago
book
425111
425111
New contributor
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
book is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
Pertrecho is a new contributor. Be nice, and check out our Code of Conduct.
Pertrecho is a new contributor. Be nice, and check out our Code of Conduct.
Pertrecho is a new contributor. Be nice, and check out our Code of Conduct.
Pertrecho is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463207%2ffont-style-in-ref-and-autoref%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown