翻转卡片

Reverse Cards

你可以在 YouTube 上观看视频教程在新窗口打开

如果你想创建双向的卡片(例如,两个“ookii”→“大”和“大”→“ookii”),你有几个选项。最简单的方法是选择“问答题(同时生成翻转的卡片)”内置笔记模板类型。这将生成两张牌,每个方向一张。

If you want to create cards that go in both directions (e.g., both “ookii”→“big” and “big”→“ookii”), you have several options. The simplest is to select the “Basic (and reversed card)” built-in note type. This will generate two cards, one in each direction.

如果你只想为你的一些材料生成翻转卡片(也许你只想花时间学习最重要材料的翻转卡片,或者你有一些卡片不想翻转),你可以选择“问答题(同时生成翻转的卡片<可选>)”笔记模板。当你只填写前两个字段时,此笔记模板会生成一张仅向前的卡片;如果你在“添加翻转的卡片”字段中额外输入一些东西(比如“y”),Anki 也会生成一张反向卡。此字段的内容永远不会显示在卡片上。

If you want to generate reverse cards for only some of your material (perhaps you only want to take the time to study reverses for the most important material, or some of your cards don’t make sense reversed), you can select the “Basic (optional reversed card)” note type. This note type generates a forward-only card when you fill in only the first two fields; if you additionally enter something in the “Add Reverse” field (like a 'y'), Anki will generate a reverse card as well. The contents of this field will never be displayed on a card.

卡片生成与删除

Card Generation & Deletion

Anki 不会创建正面为空的卡片。因此,如果“My Field”为空,并且一张卡的正面模板只包含该字段,则不会创建该卡。

Anki will not create cards with empty front sides. Thus if “My Field” was empty, and one card’s front template included only that field, the card would not be created.

当你编辑之前添加的笔记时,如果以前是空白但现在添加了内容,Anki 将自动创建额外的卡片。但是,如果你的编辑使一些卡片在以前不是空白的情况下变为空白,Anki 不会立即删除它们,因为这可能会导致意外的数据丢失。要移除空卡,请转到 工具清理空卡片。你将看到一个空卡列表,并可以选择删除它们。

When you edit a previously added note, Anki will automatically create extra cards if they were previously blank but no longer are. If your edits have made some cards blank when they previously were not, however, Anki will not delete them immediately, as that could lead to accidental data loss. To remove the empty cards, go to Tools → Empty Cards in the main window. You will be shown a list of empty cards and be given the option to delete them.

由于卡片生成的工作方式,不可能手动删除单个卡片,因为它们最终会在下次编辑笔记时被重新创建。相反,你应该将相关的条件替换字段设为空,然后使用“清理空卡片”选项。

Because of the way that card generation works, it is not possible to manually delete individual cards, as they would just end up being recreated the next time the note was edited. Instead, you should make the relevant conditional replacement fields empty and then use the Empty Cards option.

Anki 不考虑特殊字段或非字段文本作为生成卡片的条件。因此,如果你的正面模板如下所示,则如果 Country 为空,则不会生成卡:

Anki does not consider special fields or non-field text for the purposes of card generation. Thus if your front template looked like the following, no card would be generated if Country was empty:

Where is {{Country}} on the map?

选择性生成卡

Selective Card Generation

有时你可能只想为你的一些材料生成额外的卡片,比如测试你回忆一组最重要单词的能力。你可以通过在笔记中添加一个额外的字段,并在你想要额外卡片的笔记上添加一些文本(如“1”)来实现这一点。然后在卡片模板中,你可以使卡片的创建取决于该字段是否为非空。有关这方面的更多信息,请参阅下面的有条件替换部分。

Sometimes you may want to generate extra cards for only some of your material, such as testing your ability to recall the most important words of a set. You can accomplish this by adding an extra field to your note, and adding some text into it (such as "1") on the notes you want the extra card. Then in the card template, you can make the card’s creation depend on that field being non-empty. For more information on this, please see the conditional replacement section below.

有条件替换

Conditional Replacement

只有当字段为空或不为空时,才可以在卡片上包含某些文本、字段或 HTML。例如:

It is possible to include certain text, fields, or HTML on your cards only if a field is empty or not empty. An example:

This text is always shown.

{{#FieldName}}
    This text is only shown if FieldName has text in it
{{/FieldName}}

{{^FieldName}}
    This text is only shown if FieldName is empty
{{/FieldName}}

如果字段不为空,则仅显示标签:

A real life example is only showing a label if the field is not empty:

{{#Tags}}
    Tags: {{Tags}}
{{/Tags}}

或者说,如果卡片背面有额外的笔记,你想在卡片正面用蓝色显示一个特定的字段(也许有笔记的事实提醒你应该花更多的时间思考答案)。可以按以下方式设置字段样式:

Or say you want to display a specific field in blue on the front of your card if there are extra notes on the back (perhaps the fact that there are notes serves as a reminder that you should spend more time thinking about the answer). You can style the field as follows:

{{#Notes}}
    <span style="color:blue;">
{{/Notes}}

{{FieldToFormat}}

{{#Notes}}
    </span>
{{/Notes}}

你还可以使用条件替换来控制生成哪些卡。这是因为 Anki 不会生成正面空白的牌。例如,考虑一张正面有两个字段的卡片:

You can also use conditional replacement to control which cards are generated. This works since Anki will not generate cards which would have a blank front side. For example, consider a card with two fields on the front:

{{Expression}}
{{Notes}}

通常情况下,如果 expression 或 Notes 字段中有文本,就会生成一张卡片。如果你只想在 expression 不为空的情况下生成卡片,那么你可以将模板更改为:

Normally a card would be generated if either the expression or notes field had text in it. If you only wanted a card generated if expression was not empty, then you could change the template to this:

{{#Expression}}
    {{Expression}}
    {{Notes}}
{{/Expression}}

如果你想同时需要这两个字段,可以使用两个条件替换:

And if you wanted to require both fields, you could use two conditional replacements:

{{#Expression}}
    {{#Notes}}
        {{Expression}}
        {{Notes}}
    {{/Notes}}
{{/Expression}}

请记住,只有当你将有条件的替换代码放在卡的正面时,这才有效;如果你在背面这样做,你只会得到背面空白的卡片。同样,由于这是通过检查 front 字段是否为空来实现的,因此确保在条件替换中包裹“整个”front side 是很重要的;例如,以下内容将无法按预期工作:

Keep in mind that this only works when you place the conditional replacement code on the front of the card; if you do this on the back, you will simply end up with cards with a blank back side. Similarly, since this works by checking if the front field would be empty, it is important to make sure you wrap the 'entire' front side in the conditional replacement; for instance, the following would not work as expected:

{{#Expression}}
    {{Expression}}
{{/Expression}}
{{Notes}}

背面空白

Blank Back Sides

卡片生成只关注卡片的正面。例如,如果你有一个正面模板:

Card generation only looks at the front side of the card. For example, if you have a front template:

{{Field 1}}

背面的模板:

and a back template:

{{Field 2}}

如果“Field 1”不为空,则会生成一张卡片。如果“Field 2”为空,则卡片仍将生成,并且你将得到一个空白的背面。

Then a card will be generated if Field 1 is non-empty. If Field 2 is empty, the card will still be generated, and you will get a blank back side.

如果你想避免空白的背面,你需要在前面的模板上放置一个必填字段作为条件,如下所示:

If you wish to avoid a blank back side, you will need to place a required field on the front template as a conditional, like so:

{{#Field 2}}
    {{Field 1}}
{{/Field 2}}

这将确保只有当“Field 2”和“Field 2”都不为空时才生成卡片。

This will ensure the card is generated only if both Field 2 and Field 1 are non-empty.

Anki 老版本的限制

Limitations in Older Anki Versions

下面的这些限制不适用于 Anki 2.1.28+ 和 AnkiMobile 2.0.64+。

The following limitations do not apply to Anki 2.1.28+ and AnkiMobile 2.0.64+.

旧的 Anki 版本不能使用否定条件生成卡片。例如,在 Anki 2.1.28 上,如果名为 AddIfEmpty 的字段为空,并且 Front 为非空,则以下内容将添加一张卡:

Older Anki versions cannot use negated conditionals for card generation. For example, on Anki 2.1.28, the following would add a card if a field called AddIfEmpty is empty, and Front is non-empty:

{{^AddIfEmpty}}
    {{Front}}
{{/AddIfEmpty}}

在早期的 Anki 版本中,否定的条件被忽略,并且卡的生成将仅取决于 Front 是否为非空。

On earlier Anki versions, the negated conditional is ignored, and card generation will depend only on Front being non-empty.

混合 ANDOR 条件在老版本中也会有问题。举例,下面的是可以的(如果 A,B,C 有一个不为空就添加卡片)。

Mixing AND and OR conditions can also cause problems on older versions. For example, the following ("add the card if A OR B OR C is non-empty") is fine:

{{A}}
{{B}}
{{C}}

下面的也是可以的(A,B,C 都不为空则添加卡片):

And the following ("add the card if A AND B AND C are non-empty") is fine:

{{#A}}
    {{#B}}
        {{#C}}
            {{A}}
        {{/C}}
    {{/B}}
{{/A}}

但是下面的不能正常工作(如果 A 不为空或者 B 和 C 都不为空时添加卡片):

But the following ("add the card if A OR (B AND C) are non-empty") will not work properly:

{{A}}
{{#B}}
    {{#C}}
        {{B}}
    {{/C}}
{{/B}}

添加空笔记

Adding Empty Notes

当你在 Anki 2.1.28+和 AnkiMobile 2.0.64+中添加新笔记时,如果卡片模板和笔记字段组合在一起不生成卡片,则将使用第一个模板创建一张空白卡片。这样,即使材料不完整,也可以添加材料,并在以后对其或模板进行修改以使其有效。如果你不想保留一个空笔记,你可以使用“清理空卡片”功能将其删除。

When you add a new note in Anki 2.1.28+ and AnkiMobile 2.0.64+, if the card templates and note fields combine to produce no cards, a blank card will be created using the first template. This allows you to add material even if it's incomplete, and modify it or the template later to make it valid. If you don't wish to keep an empty note, you can remove it with the Empty Cards function.

在旧的 Anki 版本中,如果没有生成卡片,Anki 将拒绝添加或导入笔记。

On older Anki versions, Anki refuses to add or import a note if no cards would be generated.

挖空模板

Cloze Templates

请参阅挖空部分了解背景信息。

Please see the cloze deletion section for background info.

挖空笔记模板类型的作用不同于常规笔记模板类型。它没有自定义数量的卡片类型,而是有一个由笔记上所有挖空共享的单一类型。

The cloze note type functions differently from regular note types. Instead of a customizable number of card types, it has a single type which is shared by all cloze deletions on a note.

如上面卡片生成部分所述,常规卡片的生成取决于问题上的一个或多个非空字段。挖空笔记的生成方式不同:

As mentioned in the card generation section above, generation of regular cards depends on one or more fields on the question being non-empty. Cloze deletion note types are generated differently:

  • Anki 在正面的模板上查找一个或多个挖空替换项,如{{cloze:FieldName}}

    Anki looks on the front template for one or more cloze replacements, like {{cloze:FieldName}}.

  • 然后,它在 FieldName 字段中查找所有挖空引用,如{{c1::text}}

    It then looks in the FieldName field for all cloze references, like {{c1::text}}.

  • 对于每个单独的数字,都会生成一张卡片。

    For each separate number, a card will be generated.

因为卡片生成对于挖空卡片的作用不同,{{cloze:…​}} 标记不能与常规笔记模板类型一起使用,只有与挖空笔记模板类型一起时,它们才能正常工作。

Because card generation functions differently for cloze deletion cards, {{cloze:…​}} tags can not be used with a regular note type - they will only function properly when used with a cloze note type.

条件生成提供了一个特殊字段,以便你可以检查正在渲染的卡。例如,如果你想在第一个挖空显示“hint1”字段,在第二个挖空显示“hint2”字段,你可以使用以下模板:

Conditional generation provides a special field so you can check which card you are rendering. If you wanted to display the "hint1" field on the first cloze, and "hint2" field on the second cloze for example, you could use the following template:

{{cloze:Text}}

{{#c1}}
    {{Hint1}}
{{/c1}}

{{#c2}}
    {{Hint2}}
{{/c2}}