Text FormattingExtend a new Command with Boldface and a certain Font

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Extend a new Command with Boldface and a certain Font

Post by thedoctor818 »

I am using my own variant of the liturg.sty file. I wish to alter the following

Code: Select all

\newcommand\rub[1]{%
\noindent\small\textcolor{red}{#1}\\% 
}
so that each time I call:

Code: Select all

\rub
I then get the enclosed text not only small, and red, but additionaly--boldface, and in Zapf Chancery Font. I understand the coding for boldface text, and that for Zapf Chancery, I believe is:

Code: Select all

{\fontfamily{qzc}\selectfont <foo>}
But, I am not certain as to how to combine this with the previous newcommand \rub, such that the "foo" below

Code: Select all

\rub{foo}
has all of the properties I am asking for. Thanks a bunch for any help anyone can be. -MD
-Michael D

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Extend a new Command with Boldface and a certain Font

Post by Stefan Kottwitz »

This foe example could be a start:

\newcommand\rub[1]{%
\noindent\small\fontfamily{qzc}\selectfont\texbtbf{\textcolor{red}{#1}}\\%
}

Stefan
LaTeX.org admin
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Extend a new Command with Boldface and a certain Font

Post by thedoctor818 »

Stephen, when I tried your "foe" example, I did the following:

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\newcommand\rub[1]{%
\noindent\normalsize\fontfamily{qzc}\selectfont\texbtbf{\textcolor{red}{#1}}\\%
}

\begin{document}

\rub{Christ is Risen.}

\end{document}
However, I keep getting the error message:
LaTeX Font Warning: Font shape `T1/qzc/m/n' in size <12> not available
and

(Font) Font shape `T1/qzc/m/it' tried instead on input line 13.


As well as:

Undefined control sequence on the line using \rub. I am not sure what is wrong??? Help, please. Thanks. -MD
-Michael D
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Extend a new Command with Boldface and a certain Font

Post by Stefan Kottwitz »

Regarding the font warning: there's no bold Zapf Chancery shape. You could use italic, for example.

Since you didn't write \textbf correctly, an error message "Undefined control sequence" came up. And your example did not load the color package, which is required for \textcolor.

This works:

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{color}
\usepackage[english]{babel}
\newcommand\rub[1]{%
\noindent\normalsize\fontfamily{qzc}\itshape\selectfont\textcolor{red}{#1}\\%
}
\begin{document}
\rub{Christ is Risen.}
\end{document}
Stefan
LaTeX.org admin
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Re: Extend a new Command with Boldface and a certain Font

Post by thedoctor818 »

Thsnks, Stefan. That helps a lot. I really appreciate it.
-Michael D
Post Reply