1

I'm currently using the tufte-book class. I want to change the chapter style from [display] to [hang].

But when I found the tufte-common.def file, I could not edit it, any suggestion on how I should do it?

2

This naturally depends on what sort of editing you are doing.

In nearly every case it's possible to alter the effect of a class or package without editing the file at all. Having loaded that class or package, just redefine (in your document preamble) as necessary. In other words, you start by over-writing definitions, in your document preamble, as far as you can.

In the case of the tufte classes, they use titlesec to define the style of headings, so you should quite easily be able to use titlesec's API (if one dare call it that) to make the redefinition you want. For instance, if you copy and then adapt the tufte definition, you might have something like:

\makeatletter
\titleformat{\chapter}%
  [hang]% CHANGED shape
  {\relax\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\begin{fullwidth}}{}}% format applied to label+text
  {\itshape\huge\thechapter}% label
  {1em}% CHANGED horizontal separation between label and title body
  {\huge\rmfamily\itshape}% before the title body
  [\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\end{fullwidth}}{}]% after the title body
\makeatother

So, to be clear, that would just go in your preamble after loading the class as usual, and before \begin{document}.

You will also need to \setcounter{secnumdepth}{0} since by default this class does not use chapter numbers (so there is nothing to hang anyway!). Note that I have put this in \makeatletter ... \makeatother guards so I can just use the definition from the class file, which includes ampersand-protected commands. I don't actually know whether that is needed given your redefinition; but it's harmless.

That's how you would modify the definition for a single document. If you want to make more long-term changes, you can do it in one of two ways (other than copy and paste):

  1. Define a file tufte-common-local.tex. If the Tufte class can find this in the TeX path it will load this. So you can put redefinitions there and save it in a local TeX tree or in the directory you have your source file in, and it will be loaded every time. This is specific to that class.

  2. Define a personal style file, e.g. my-tufte.sty, put that in your TeX path, and load that in any document you need it in. This is a general mechanism.

What you do not do is modify tufte-common.def. Basically, just don't modify a distributed file (unless you are its maintainer). You very rarely need to modify a file; if you do: copy it with a new name, modify it, put it in your own TeX path (not in the main tree), and load it by its new name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.