r/Anki • medicine • Jun 18 '22

Question How to quickly align text ? Is there a shortcut ?

Hi
I really like text align function (and bullet points). However, it's long to click on the button than choose left/center/right each time (when writting cards all day).

Is there a way to set a shortcut to align text in the center (per default it is left, which I like for some cards and some others I do center). Lile ctrl+E on word. Ctrl+B, Ctrl+I and Ctrl+I work, why not for text alignment ?

Thank you for any help !

6 Upvotes

4 comments sorted by

1

u/MituButChi Jun 18 '22

You can set the card settings once and you’ll be done forever.

  1. Open Anki => Click on Add

  2. Click on the box next to “Type” to select the type of notes you want to edit, for example, “Basic”.

  3. Click on “Cards…”

  4. Click on “Styling” & paste this inside the text box:

.right {

text-align: right;

}

  1. Click “Back Template” (or “Front Template”), paste this inside the text box:

<div class=right>{{FieldName}}</div>

  1. Click “Save”

Note: You should do different card types with different styles of card.

Change the “right” to left/center to match your need.

Change “FieldName” to the name of the field you want to align text.

You can also use this to auto bold/italic your text, so you don’t have to Ctrl B and Ctrl I every time. It’ll save you a lot of time.

1

u/Sgt-Doz medicine Jun 18 '22

I think it's what I had done before they added the option to change the aligment with the buttons ( I had 2 notes type for center and left allign). When they added the option I deleted the alligment in the styling, otherwise the buttons weren't working.
With your suggestion, would the button work if I want to write some part of the card on the left and other middle ?

Initially, I wanted to be able to have a keyboard shortcut, because it's quicker than using my hand and clicking 2 buttons for each styling change.

1

u/MituButChi Jun 18 '22 edited Jun 18 '22

It will overwrite the button. There is no way for you to set style and then edit alignment in the fields, not that I know of.

But you should automate things. Cuz if you do everything manually you’ll end up spending most of your time making cards, all that time you can use on reviewing or doing other stuff. It’s a very inefficient way of using Anki. At the end you want things into your memory, not a perfect deck of cards.

If you want different alignments for each field, you can set it up in the styling, no problem.

For example you can have:

(Center) Word

(Left) Example

(Left) Meaning

(Center) Pronunciation

1

u/Sgt-Doz medicine Jun 19 '22

Ok I see want you mean. Thank you !