Bläddra i källkod

* Improved letterspacing using either the microtype or soul packages. The

dependencies are optional -- if the packages aren't installed, you won't
  get improved letterspacing for small-caps and all-caps.


git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@47 516e2f36-ce3a-0410-bea4-1d4a03f5df72
master
Kevin M. Godby 18 år sedan
förälder
incheckning
ba4262c3fe
1 ändrade filer med 33 tillägg och 1 borttagningar
  1. +33
    -1
      tufte-handout.cls

+ 33
- 1
tufte-handout.cls Visa fil

@@ -134,11 +134,43 @@
\partopsep\plpartopsep
\def\makelabel##1{\hss\llap{##1}}}}

%%
% Improved letterspacing of small caps and all-caps text.
%
% First, try to use the `microtype' package, if it's available.
% Failing that, try to use the `soul' package, if it's available.
% Failing that, well, I give up.

\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase
\newcommand{\allcaps}[1]{\MakeTextUppercase{#1}}
\newcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{#1}}}
\newcommand{\smallcapsspacing}[1]{#1}

\IfFileExists{microtype.sty}{%
\RequirePackage[final]{microtype}
% Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+
\renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}
\renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}}
\renewcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{##1}}}
}{% microtype failed, check for soul
\IfFileExists{soul.sty}{%
\RequirePackage{soul}
\sodef\allcapsspacing{\upshape}{0.15em}{0.65em}{0.6em}
\sodef\smallcapsspacing{\scshape}{0.075em}{0.5em}{0.6em}
\renewcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{##1}}}
\renewcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{##1}}}
}{}% neither microtype nor soul are installed... giving up.
}

\DeclareTextFontCommand{\textsmallcaps}{\scshape}
\renewcommand{\textsc}[1]{\textsmallcaps{\smallcapsspacing{#1}}}


%%
% An environment for paragraph-style section

\providecommand\newthought[1]{\vspace{1.8\baselineskip plus 3pt minus 2pt}%
{\noindent\scshape #1}}
{\noindent\textsc{#1}}}

%%
% Transform existing \footnotes into \sidenotes


Laddar…
Avbryt
Spara