我读了几篇文章,但仍然不知道如何执行以下操作。我想在证明环境中使用手写字体,例如 Augie 字体。我安装了包翠然后我读到有人建议定义一个新的环境,比如
\newenvironment{myfont}{\fontfamily{<familyname>}\selectfont}{\par}
我无法让它工作,因为我根本找不到它的字体系列。有人能给我提供一个具体的例子吗?谢谢!这是我目前拥有的代码。
\documentclass[english]{scrartcl}
\usepackage{bm}
\usepackage{graphics}
\usepackage{relsize}
\usepackage{color}
\usepackage{bigints}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.eps, .pdf, .jpeg, .png}
\usepackage{epstopdf}
\usepackage{float}
\usepackage{hyperref}
\usepackage{environ}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsmath}
\setkomafont{disposition}{\normalfont}
\usepackage{graphicx}
\usepackage{emerald}
\usepackage{geometry}
\geometry{
a4paper,
left=20mm,
right=20mm,
top=10mm,
bottom=10mm
}
\usepackage{listings}
\usepackage{color}
\setcounter{tocdepth}{1}
\usepackage{tocloft}
\definecolor{blue}{rgb}{0,0,1}
\definecolor{red}{rgb}{1,0,0}
\newenvironment{myfont}{\fontfamily{<familyname>}\selectfont}{\par}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\newcommand*\ruleline[1]{\par\noindent\raisebox{.8ex}{\makebox[\linewidth]{\hrulefill\hspace{1ex}\raisebox{-.8ex}{#1}\hspace{1ex}\hrulefill}}}
\begin{document}
\section{Question One}
\begin{proof}
\begin{myfont}
Some text in the new font.
\end{myfont}
\end{proof}
\end{document}
答案1
您有以下选择:
使用\newenvironment{myfont}{\fontfamily{augie}\selectfont}{\par}
那么归根结底就是
\begin{proof}
\begin{myfont}
Some text in the new font.
\end{myfont}
\end{proof}
或者使用开关\ECFAugie
\begin{proof}
\ECFAugie
Some text in the new font.
\end{proof}
完整代码:
\documentclass[english]{scrartcl}
\usepackage{bm}
\usepackage{graphics}
\usepackage{relsize}
\usepackage{color}
\usepackage{bigints}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.eps, .pdf, .jpeg, .png}
\usepackage{epstopdf}
\usepackage{float}
\usepackage{hyperref}
\usepackage{environ}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsmath}
\setkomafont{disposition}{\normalfont}
\usepackage{graphicx}
\usepackage{emerald}
\usepackage{geometry}
\geometry{
a4paper,
left=20mm,
right=20mm,
top=10mm,
bottom=10mm
}
\usepackage{listings}
\usepackage{color}
\setcounter{tocdepth}{1}
\usepackage{tocloft}
\definecolor{blue}{rgb}{0,0,1}
\definecolor{red}{rgb}{1,0,0}
\newenvironment{myfont}{\fontfamily{augie}\selectfont}{\par}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\newcommand*\ruleline[1]{\par\noindent\raisebox{.8ex}{\makebox[\linewidth]{\hrulefill\hspace{1ex}\raisebox{-.8ex}{#1}\hspace{1ex}\hrulefill}}}
\begin{document}
\section{Question One}
\begin{proof}
\begin{myfont}
Some text in the new font.
\end{myfont}
\end{proof}
\begin{proof}
\ECFAugie
Some text in the new font.
\end{proof}
\end{document}
您可以使用etoolbox
及其宏\AtBeginEnvironment
来挂接到证明环境,这样可以节省一些输入。那是另一回事。
奖励:一些手写字体。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{frcursive}
\usepackage{calligra}
\usepackage{emerald}% 1
\usepackage{aurical}% 2
\usepackage{pbsi}% 3
%\usepackage{chancery}%Zapf chancery font
\usepackage{la}
\newcommand{\setfont}[2]{{\fontfamily{#1}\selectfont #2}}
\begin{document}
\noindent\setfont{frc}{\Huge This is french cursive font.}\\[5pt]
\setfont{calligra}{\Huge This is Calligra font.}\\[5pt]
\setfont{pzc}{\Huge This is chancery font.}\\[5pt]
%{\Huge\itshape This is chancery italic font.}\\[5pt]
\section{Augie} {\ECFAugie This is Augie font --1.}\\[5pt]
\section{Auriocus Kalligraphicus} {\Fontauri This is Auriocus Kalligraphicus font --2.}\\[5pt]
\section{BrushScriptX-Italic} {\bsifamily This is BrushScriptX-Italic font --3.}\\[5pt]
\end{document}
这是给纳赛尔的。正如 Jim Hefferon 和 LaRiFaRi 在评论中所说,你可以下载免费字体(从这里, 和这里,比如说)并使用 xelatex 或 lualatex 来获得您想要的东西。
\documentclass{article}
\usepackage[no-math]{fontspec}
\setmainfont[
Ligatures=TeX,
]{Stylus ITC TT}
\begin{document}
This is some TEXT.
\end{document}