Flashcard 包无法在 Latex 中编译

Flashcard 包无法在 Latex 中编译

首先我要说的是,我完全没有编码和编程的天赋。

我使用 MikTeX(我相信是最新版本)和 WinEdt 作为界面。我想使用 flashcard 包,这样我就可以生成一些可以打印出来的抽认卡。Anki 抽认卡软件无法帮我完成这个任务(以防有人建议这样做)。

无论如何,我已经安装了 flashcard 包;它在我的包管理器中。但是,我无法让它编译我需要的 pdf。这是我尝试编译的代码示例,它直接取自文档:

\documentclass[avery5388,grid,frame]{flashcards}

\cardfrontstyle[\large\slshape]{headings}
\cardbackstyle{empty}
\begin{document}

\cardfrontfoot{Functional Analysis}


\begin{flashcard}[Definition]{Norm on a Linear Space \\ Normed Space}

A real-valued function $||x||$ defined on a linear space $X$, where
$x \in X$, is said to be a \emph{norm on} $X$ if


\smallskip

\begin{description}
\item [Positivity] $||x|| \geq 0$,
\item [Triangle Inequality] $||x+y|| \leq ||x|| + ||y||$,
\item [Homogeneity] $||\alpha x|| = |\alpha| \: ||x||$,
$\alpha$ an arbitrary scalar,
\item [Positive Definiteness] $||x|| = 0$ if and only if $x=0$,
\end{description}

\smallskip

where $x$ and $y$ are arbitrary points in $X$.

\medskip

A linear/vector space with a norm is called a \emph{normed space}.
\end{flashcard}

\begin{flashcard}[Definition]{Inner Product}

Let $X$ be a complex linear space. An \emph{inner product} on $X$ is
a mapping that associates to each pair of vectors $x$, $y$ a scalar,
denoted $(x,y)$, that satisfies the following properties:

\medskip

\begin{description}
\item [Additivity] $(x+y,z) = (x,z) + (y,z)$,
\item [Homogeneity] $(\alpha \: x, y) = \alpha (x,y)$,
\item [Symmetry] $(x,y) = \overline{(y,x)}$,
\item [Positive Definiteness] $(x,x) > 0$, when $x\neq0$.
\end{description}
\end{flashcard}


\begin{flashcard}[Definition]{Linear Transformation/Operator}

A transformation $L$ of (operator on) a linear space $X$ into a linear
space $Y$, where $X$ and $Y$ have the same scalar field, is said to be
a \emph{linear transformation (operator)} if

\medskip

\begin{enumerate}
\item $L(\alpha x) = \alpha L(x), \forall x\in X$ and $\forall$
scalars $\alpha$, and
\item $L(x_1 + x_2) = L(x_1) + L(x_2)$ for all $x_1,x_2 \in X$.
\end{enumerate}

\end{flashcard}
\end{document}

这是它产生的错误:

Command Line:   texify.exe --pdf --tex-option=--interaction=errorstopmode --tex-    option=--synctex=-1 "C:\Users\Jay\Desktop\Latex\testing4.tex"
Startup Folder: C:\Users\Jay\Desktop\Latex

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9)
entering extended mode
(C:/Users/Jay/Desktop/Latex/testing4.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.

("C:\Users\Jay\AppData\Local\Programs\MiKTeX 2.9\tex\latex\flashcards\flashcard
s.cls"
Document Class: flashcards 2010/08/13 1.0.1 ([email protected])
("C:\Users\Jay\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\ifthen.sty")
("C:\Users\Jay\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Users\Jay\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\size10.clo"))
Coudln't find avery5388.cfg, using defualt.
! Undefined control sequence.
\reserved@b ...@onefilewithoptions #1[{\cardpaper 
                                              }][{}]\noexpand \@pkgexten...
l.77 \setlength
           {\oddevenshift}{\oddoffset}
? 

Process has been terminated ...

我也尝试了一些其他非常简单的示例,但什么也没发生。有人能帮忙吗?提前谢谢!

编辑:我尝试了一个更简单的例子,如下所示:

\documentclass[avery5371]{flashcards}
\begin{document}
\begin{flashcard}{Start}
To finish
\end{flashcard}
\end{document}

并产生了这个错误:

Command Line:   texify.exe --pdf --tex-option=--interaction=errorstopmode --tex-    option=--synctex=-1 "C:\Users\Jay\Desktop\Latex\Testing 2.tex"
Startup Folder: C:\Users\Jay\Desktop\Latex

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9)
entering extended mode
("C:/Users/Jay/Desktop/Latex/Testing 2.tex"
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.

("C:\Users\Jay\AppData\Local\Programs\MiKTeX 2.9\tex\latex\flashcards\flashcard
s.cls"
Document Class: flashcards 2010/08/13 1.0.1 ([email protected])
("C:\Users\Jay\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\ifthen.sty")
("C:\Users\Jay\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Users\Jay\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\size10.clo"))
Coudln't find avery5371.cfg, using defualt.
! Undefined control sequence.
\reserved@b ...@onefilewithoptions #1[{\cardpaper 
                                              }][{}]\noexpand \@pkgexten...
l.77 \setlength
           {\oddevenshift}{\oddoffset}
? 

我认为我没有正确安装该软件包。有人知道吗?

答案1

当我尝试编译它时,它对我来说运行完美,这更加证实了你的猜测,即你的安装无法正常工作。

我不完全确定安装在哪里中断了,但如果您将此文件保存为avery5371.cfg与 .tex 文件位于同一文件夹中,您可能会成功:

%%
%% This is file `avery5371.cfg',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% flashcards.dtx  (with options: `avery5371')
%% 
%% FlashCards LaTeX2e Class for Typesetting Double Sided Cards
%% Copyright (C) 2000  Alexander M. Budge <[email protected]>
%% 
%% This program is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by
%% the Free Software Foundation; either version 2 of the License, or
%% (at your option) any later version.
%% 
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%% GNU General Public License for more details.
%% 
%% You should have received a copy of the GNU General Public License
%% along with this program (the file COPYING); if not, write to the
%% Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%% 
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesFile{avery5371.cfg}
\newcommand{\cardpapermode}{portrait}
\newcommand{\cardpaper}{letterpaper}
\newcommand{\cardrows}{5}
\newcommand{\cardcolumns}{2}
\setlength{\cardheight}{2.0in}
\setlength{\cardwidth}{3.5in}
\setlength{\topoffset}{0.50in}
\setlength{\oddoffset}{0.75in}
\setlength{\evenoffset}{0.75in}

\endinput
%%
%% End of file `avery5371.cfg'.

或者,尝试从文档类选项中删除 [avery5371.cfg],看看是否可以找到该包。

相关内容