Browse Source

* Added \newlinetospace command which converts \\, \\*, and \newline to \space.

* Wrapped title and author contents of running heads with \newlinetospace.


git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@69 516e2f36-ce3a-0410-bea4-1d4a03f5df72
master
Kevin M. Godby 17 years ago
parent
commit
ffbda85b39
1 changed files with 24 additions and 3 deletions
  1. +24
    -3
      tufte-common.sty

+ 24
- 3
tufte-common.sty View File

@@ -558,6 +558,27 @@
}{}


%%
% Turns newlines into spaces. Based on code from the `titlesec' package.

\DeclareRobustCommand{\@tufte@newlinetospace}{%
\@ifstar{\@tufte@newlinetospace@i}{\@tufte@newlinetospace@i}%
}

\def\@tufte@newlinetospace@i{%
\ifdim\lastskip>\z@\else\space\fi
\ignorespaces%
}

\DeclareRobustCommand{\newlinetospace}[1]{%
\let\@tufte@orig@cr\\% save the original meaning of \\
\def\\{\@tufte@newlinetospace}% turn \\ and \\* into \space
\let\newline\\% turn \newline into \space
#1
\let\\\@tufte@orig@cr% revert to original meaning of \\
}


%%
% Sets up the running heads and folios.

@@ -579,9 +600,9 @@
% The 'fancy' page style is the default style for all pages.
\fancyhf{} % clear header and footer fields
\ifthenelse{\boolean{@tufte@twoside}}
{\fancyhead[LE]{\thepage\quad\smallcaps{\theauthor}}%
\fancyhead[RO]{\smallcaps{\thetitle}\quad\thepage}}
{\fancyhead[RE,RO]{\smallcaps{\thetitle}\quad\thepage}}
{\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\theauthor}}}%
\fancyhead[RO]{\smallcaps{\newlinetospace{\thetitle}}\quad\thepage}}
{\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\thetitle}}\quad\thepage}}


% The `plain' page style is used on chapter opening pages.


Loading…
Cancel
Save