我看到过很多页面专门介绍如何使用 tufte 解决此问题。这些解决方案对我都不起作用。我尝试使用 tufte 处理几个简单的 .tex 文件。所有文件都存在同样的问题。
“\MakeTextLowercase 的参数有一个额外的 }”
系统:ubuntu 16.10,texlive完整安装。
我似乎在 /usr/share 下还有其他与 latex 相关的内容:texmf、latex-cjk、texinfo、lintian、tex4ht,我将它们包括在内以防已知干扰。
我喜欢 tufte 提供的产品。但我愿意尝试其他产品。
那么,有已知的解决方法吗?或者,有其他强大的书籍类可用吗?
创建包含建议修复之一的错误的示例:
\documentclass{tufte-book}
\usepackage{ifxetex}
\ifxetex
\newcommand{\textls}[2][5]{%
\begingroup\addfontfeatures{LetterSpace=#1}#2\endgroup
}
\renewcommand{\allcapsspacing}[1]{\textls[15]{#1}}
\renewcommand{\smallcapsspacing}[1]{\textls[10]{#1}}
\renewcommand{\allcaps}[1]{\textls[15]{\MakeTextUppercase{#1}}}
\renewcommand{\smallcaps}[1]
{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}}
\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\usepackage{fontspec}
\fi
\title{this is a title}
\author{me}
\begin{document}
\maketitle
\end{document}
使用“latex”版本:
$ latex --version
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1
Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.17; using libpng 1.6.17
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.41.0
然后,将“\listfiles”放在“\begin{document}”之前,我重新运行它,结果如下:
$ latex mono2
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(./mono2.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 81 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/tufte-latex/tufte-book.cls
Document Class: tufte-book 2015/06/21 v3.5.2 Tufte-book class
(/usr/share/texlive/texmf-dist/tex/latex/tufte-latex/tufte-common.def
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex))))
(/usr/share/texlive/texmf-dist/tex/latex/xifthen/xifthen.sty
(/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/share/texlive/texmf-dist/tex/latex/ifmtarg/ifmtarg.sty))
(/usr/share/texlive/texmf-dist/tex/latex/hardwrap/hardwrap.sty
(/usr/share/texlive/texmf-dist/tex/latex/ifplatform/ifplatform.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/catchfile.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))
Package ifplatform Warning:
shell escape is disabled, so I can only detect \ifwindows.
) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)
(/usr/share/texlive/texmf-dist/tex/latex/titlesec/titletoc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty)
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def)
(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty))
Package hyperref Message: Driver (default): hdvips.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hdvips.def
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pdfmark.def
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/ms/ragged2e.sty
(/usr/share/texlive/texmf-dist/tex/latex/ms/everysel.sty))
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty)
(/usr/share/texlive/texmf-dist/tex/latex/changepage/changepage.sty)
(/usr/share/texlive/texmf-dist/tex/latex/paralist/paralist.sty)
(/usr/share/texlive/texmf-dist/tex/latex/textcase/textcase.sty)
(/usr/share/texlive/texmf-dist/tex/latex/soul/soul.sty)
(/usr/share/texlive/texmf-dist/tex/latex/setspace/setspace.sty)
(/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvips.def)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def)
(/usr/share/texlive/texmf-dist/tex/latex/xcolor/svgnam.def))
(/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty)
(/usr/share/texlive/texmf-dist/tex/latex/natbib/bibentry.sty)
No file mono2.bbl.
(/usr/share/texlive/texmf-dist/tex/latex/sauerj/optparams.sty)
(/usr/share/texlive/texmf-dist/tex/latex/placeins/placeins.sty)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/mathpazo.sty)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/helvet.sty)
(/usr/share/texlive/texmf-dist/tex/latex/bera/beramono.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def))
(/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def))
(/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
(/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty))) (./mono2.aux)
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1pplj.fd)
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(./mono2.out) (./mono2.out) ABD: EverySelectfont initializing macros
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1phv.fd)
! Argument of \MakeTextUppercase has an extra }.
<inserted text>
\par
l.22 \maketitle
?
答案1
该类tufte
用于soul
字母间距,可以通过使用来覆盖microtype
。
这里我使用因子 500 来强调间距。
\documentclass[nohyper]{tufte-book}
\usepackage{microtype}
\renewcommand{\allcapsspacing}[1]{\textls[500]{#1}}
\renewcommand{\smallcapsspacing}[1]{\textls[500]{#1}}
\renewcommand{\allcaps}[1]{\textls[500]{\MakeTextUppercase{#1}}}
\renewcommand{\smallcaps}[1]{%
\smallcapsspacing{\scshape\MakeTextLowercase{#1}}%
}
\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\title{this is a title}
\author{me}
\begin{document}
\maketitle
\end{document}
用 编译pdflatex
。
答案2
这是一个使用该类的示例memoir
。
\documentclass[10pt,draft]{memoir}
%% calc used for algebra
%% environ used for environments
\usepackage{calc, environ}
\usepackage{lipsum}
%% page size and text block sizes
\setstocksize{9.25in}{6.125in}
\settrimmedsize{\stockheight}{\stockwidth}{*}
\setulmarginsandblock{0.75in}{*}{1}
\setlrmarginsandblock{0.5in}{*}{4.6}
%% calculations to size margin paragraphs
\newlength{\margindiff}\setlength{\margindiff}{\foremargin - \spinemargin}
\newlength{\mpsep}\setlength{\mpsep}{2em}
\newlength{\mwidth}\setlength{\mwidth}{\margindiff -\mpsep}
\setmarginnotes{\mpsep}{\mwidth}{2.5\baselineskip}
%% validate everything
\checkandfixthelayout
%% narrower text flow needs a more relaxed justification rule
\midsloppy
%% FULL PAGE ENVIRONMENT
\NewEnviron{FullPage}{%
\begin{adjustwidth*}{0em}{-\margindiff}
\BODY
\end{adjustwidth*}
}
%% document
\begin{document}
%% textbook cover
\begin{FullPage}
\thispagestyle{empty}
\begin{center}
{\sffamily\HUGE{}An Example Tufte-Mimic Layout}
\vfill
Using the \textit{Memior} Class Instead
\vfill
Generated \today.
\end{center}
\end{FullPage}
\clearpage
%% body
\lipsum[1]
\marginpar{Here is some text located in the margin}
\lipsum[2-4]
\end{document}
我发现的一个缺点是,FullPage 环境只能跨越一页。它不允许文本跨多页流动。我使用来自geometry 包的book
类savegeometry
和命令克服了这个问题。但是,它还有其他我更喜欢的好处。restoregeometry
memoir
答案3
使用 pdflatex 而不是 latex 或 xetex。tufte-book 模板无法与任何其他翻译器配合使用。我的问题可能与我的配置有关。这对我来说是个问题,因为我的参考文献包括来自世界各地的作者,例如:Santiago Ramón y Cajal。我相信这些特殊字符(例如 ó)仍然可以使用转义序列。尽管如此,还是要感谢那些审阅我的问题的人。