Hey there. I’d like some assistance from someone who’s familiar with coding. I myself know very little, so I’m having trouble figuring this out. Is there any way to make these two cards look the exact same?
When I say I want them to look the ‘same’, I mean that:
both have their bulletpoints aligned to the left
question at the top centred in the middle
their font is the same size
One is using the Anking Cloze Overlapping note type (the one with the clozes) and the other one is the Default card type. I’ve looked at the ‘styling’ section on the Anking Overlapping card but it’s quite complicated and I’m not sure what to change. I could send the code for the styling of both the normal card and the cloze overlapping card if anyone is down to help, but it would be a pretty big wall of text.
It’s more important that you would provide the source code for the contents of your card itself. It is revealed by clicking <> in the top right corner of a field, when being viewed in the editor. You can post it here, wrapping in ``` from both ends to keep the correct formatting.
Explain how livestock farming practices increase efficiency of energy transfer (9)<br><br>• {{c1::Reduce respiratory losses within a human food chain so more energy to create biomass e.g:}}<br><br>• {{c2::Restrict movement and keep warm}}<br>→ {{c3::Less energy lost as heat from respiration}}<br><br>• {{c4::Slaughter animal while still growing / young}}<br>→ {{c5::When most of their energy is used for growth}}<br><br>• {{c6::Treat with antibiotics}} <br>→ {{c7::Prevent loss of energy due to pathogens}}<br><br>• {{c8::Selective breeding}} <br>→ {{c9::To produce breeds with higher growth rates}}
For the back of the normal card:
• Reduce respiratory losses within a human food chain so more energy to create biomass e.g:<br><br>• Restrict movement and keep warm<br>→ Less energy lost as heat from respiration<br><br>• Slaughter animal while still growing / young<br>→ When most of their energy is used for growth<br><br>• Treat with antibiotics <br>→ Prevent loss of energy due to pathogens<br><br>• Selective breeding <br>→ To produce breeds with higher growth rates
I couldn’t replicate your first screenshot with the card content you provided using the Basic Note Type. It looks like this (which is expected, since your backfield consists of regular text lines with line breaks and not formatted as a unified list):
I assume you already modified your basic Note Type, or mean something different by the “default” card type. In either case your actual source code for the back and the styling will be needed to come up with a solution.
To change the size of the font on the Cloze Overlapping note type you’ll need to find the following part in its styling:
So, basically, this is the modification that was used to set the desired alignment in your default card type. If you want to replicate it for the Cloze Overlapping Note type, you just need to substitute the same left value into the same piece of styling I referenced previously:
However, this won’t center the question line. Since in the Cloze Overlapping case, instead of being split into a separate field, the question is part of the same text block as the rest of the card, a different alignment can’t be set for it using styling alone. Depending on the type of a solution you are looking for, there are several ways of going about it:
Make a new dedicated field for the question and move its content there. Then adjust the template accordingly. It would be the cleanest method, but would require some work reformatting the cards (although it can be automated to an extent).
Apply the centering option in the Anki editor to the question line:
The simplest method because of the GUI, but might require quite a bit of manual work and doesn’t result in a very clean note structure.
Use a bit of JS to separate the question during card display. Require the least amount of setup, but may result in a flicker each time a card is flipped during review. Also might fail on cards with questions formatted in a non standardized way.
Also, note that this part of your styling is not a proper css code:
This would be valid SCSS, but to my knowledge Anki interprets styles as plain CSS, which does not support nested selectors. It might still work occasionally due to automatic error correction by the CSS interpreter, but it won’t do so reliably. To correct it, this should either be changed to
depending on what it was originally intended for (or the .front {} and .back {} rules could be deleted entirely, since I didn’t see them being utilized anywhere anyway).
I think this solution is good, but I’m wondering how you’d automate it. Is it complicated? I guess instead of automating it I could just move the question to the separate field any time I come across a cloze overlapping card. I’d only have to move it once for each set of cloze overlapping cards because they are part of the same note, so it isn’t that inconvenient. But some days I may have to review all the cards on my ipad, and editing is kind of tedious on there. Let’s say we go with the new field method. Will the cards not work properly if there is an empty field in them, assuming that i haven’t put the question in them? (i.e will they display an error?)
Before you try any adjustments suggested below, a reminder to make a backup File → Create Backup in case anything won’t work as expectec.
There are many add-ons that can help with a task like that. From the top of my head, the Advanced Copy Fields can be used to duplicate the content of your Text field into the Question field (that you should add to the note type beforehand). With all the relevant notes being selected in the browser go to Notes → Advanced Copy and choose the settings:
Action: Replace
Source Field: Text
Replace: Question
After, you can remove all the redundant parts by using the standard Anki Notes → Find and Replace feature. Settings for removing everything but the question from the Question field:
Find: ^(.*?)<br>.*$ (captures everything before the first linebreak)
Replace with: $1 (leaves only the captured part)
In: Question
Treat input as regular expression
Similarly, for deleting the question from the Text field:
Find: ^.*?(?:<br>)+(.*)$
Replace with: $1
In: Text
Treat input as regular expression
Yes, this is also an option.
They should work just fine. Just add
<center>{{Question}}</center><br>
before the <div ... id="text" ... (on both the front and the back template) and the only difference between the “processed” and “unprocessed” notes would be the displayed alignment of the piece of text being moved into the Question field.
However, one more thing to be concerned about is the possibility of a conflict between the changes and updates that AnKing add-on might introduce in the future. I’m not familiar with how exactly it functions, but is has a potential to overwrite any non-standard modifications to its Note Types.
It worked, thank you so much. I managed to separate the questions. However, the only issue is that the ‘Question’ field doesn’t show up when I preview the card:
Nevermind, I think I fixed it. Forgot to add the <center>{{Question}}</center><br" to the front and back. Should work fine now. Thank you so much dude, you’re a legend!
nevermind, I think it’s just an illusion, i copmared the text and they are the exact same size. I know what the issue is. The ‘basic’ note type has a border seperating the question and text, but the cloze overlapping card doesn’t. Is there any way to add one to the cloze overlapping note type? (between the ‘question’ and the ‘text’ field)
You should have left Selected note only toggled. Without it replacements affect all notes in the collection. If there aren’t any other Note Types in your Anki that have either Question or Answer fields, this is fine too. But if you do, you’d better check them to see if they are ok.
How the text is displayed in the editor fields is independent from how it is presented on the cards themselves, which is what all the previous instructions were about. If you want to adjust the font size here as well, you need to click the Fields button right above the screenshot area → select Text in the list → change the number “16” across from Editing Font to “20”.
Say I have a bulletpointed list like the one shown below: is there any way to shift the bulletpointed list to the left in the ‘ClozeOverlapping’ notetype? Or, does the nature of the bulletpointed list override the existing text alignment which is already set to left? I’ve included a snapshot of both the ‘clozeoverlapping’ and my ‘basic’ note type down below.
Hey Eltaurus, thanks for all the help. I noticed something about the questions on each of my cards - for the ‘basic’ note type, there’s no indentation for the question whereas for the ‘ClozeOverlapping’ note type there is one. Is there any way to make these the same? I would like both of them to have the identation. I’ve attached an image below to visualise what I mean - the top is the basic note type and the bottom one is the clozeoverlapping note type.
I don’t see what you might refer to as indentation in the screenshots. There are different margins on the question part, but those are present on the basic note type and missing on the CloseOverlapping, not the other way around. There is also slight difference in the left margin of the list, but that is the answer section, not question.
yes, what I meant to say were the different margins on the question part but I worded it badly, apologies. How do I make them present on the cloze overlapping note type? And also, how do I make the left margin of the list the same?
Can you share the current code for your basic card? The aren’t any margins on it by default either, so I assume there were more changes to it not mentioned in this thread yet.