Librarian
Space Marine psyker. Less likely to be fucked inside out by daemons though, due to being a superhuman and all. Often overheard punishing xenos and heretics alike while screaming cheesy one-liners like "Your book is overdue, BITCH!".
History
Back during the Great Crusade, when the Primarchs were reunited with their legions, the Space Marines began discovering some of their new recruits had psychic potential. Wanting to utilize this and prevent them from falling to Warp corruption, Magnus the Red, Sanguinius, and Jaghatai Khan proposed the creation of Librariums, divisions of the Legions which would take in psyker Space Marines and train them to use their powers for the good of the Imperium of Man. Seeing the possible good, the Emperor agreed, authorizing the go ahead and presumably getting all teary-eyed at how independent and grown-up his kids had gotten (while being awesome and manly of course). When the Librariums proved effective, they spread to other Legions. However, a number of Primarchs, namely Mortarion, Rogal Dorn, Corax, and Leman Russ opposed the training of Librarians and wanted the program shut down, believing that the powers of the Warp could not be controlled (Russ maintained that Rune Priests were not actually Librarians, given the Space Wolves insistent maintaining that they drew power from Fenris, not the Warp). Further concern was raised with Magnus's constant peering into the Warp to learn more about his powers, which Russ and Mortarion felt warranted censure.
Then Nikaea Happened
Following the Emperor's departure from the Great Crusade, a conclave was called to determine whether or not Librarians should continue to be used. With representatives summoned to the Council of Nikaea (often remembered as the Trial of Magnus the Red) both sides pleaded their cases. In the end, the Emperor, fearing that Magnus was too close to learning the existence of the Chaos Gods, decided that Librarians posed too great a risk and ordered the Legions to disband their Librariums, return to their battle companies, and never use their psychic powers in battle again. An edict Magnus ignored. Well, actually, an edict that quite a lot of them either totally ignored or later broke. But Magnus broke it harder.
Unfortunately, this was one of those decisions that the Emperor didn't really think through. It added yet another layer of bullshit on top of his fear of the warp and psykers in general, a group of people who, had they been able to ply their mind-bullets freely would have been an awesome weapons against the traitors (I mean presumably) when Heresy time came around. Thing is... This is something that the books and stuff seem to say a lot but it's kinda... Well... It's hard to say how true that actually is/was.
First off a couple of the loyalist legions just totally ignored the edict and so still had their psykers when the heresy arrived, and they didn't make a difference:
- The White Scars just kinda shrugged and twiddled their mustaches and did their own thing same as ever, including keeping their Storm Seers around. Since it was also suggested that the Khan himself was a psyker (later revealed to be false), on top of his total disregard for authority and support for the librarians this shouldn't be that much of a surprise. If nothing else, he could fall back on the excuse that he wasn't at Nikea at the time the edict was made and could therefore plead ignorance.
- The Space Wolves supported the banning of librarians, but kept their own afterwards. They totally denied that their Rune Priests actually were pyskers at all, and that their power came from Fenris, as opposed to the warp. Which was totally wrong, of course, and they may or may not have known this. They might just have been jerks, or perhaps more likely the Big E made a decision to tolerate their beliefs, seeing it was important for his 'executioners' to be able to deal with other warp-users.
At Istvaan psykers wouldn't have made any difference (3 legions vs 9 is a bad day for the good guys) and the balance of forces was so extreme that just knowing ahead of time wouldn't have helped. At Calth they might have made a difference. All of the former Ultramarine librarians has bad dreams in the days before the treachery, so maybe they might has seen what was coming. But if they could ever have convinced Roboute Guilliman of impending treachery (remember this was happening just after Isstvan V and communication was moving slowly thanks to the Warp Storms, on top of the fact that Marines fighting each other was totally alien to them (fluff writers expect you to disregard the fact that the Wolves had already massacred two other legions and tried to do the same to the World Eaters)). Even if they could, they would have really been struggling to deal with the scrap-code/magic stuff because it was totally new and a weird combination of technology and warpstuff. Oh, and of course practically no-one who wasn't on Guilliman's flagship or with the 4th company even knew what the problem was. So it seems really unlikely that Librarians would have magically made the Heresy all better.
In any case, the edict of Nikaea stood for a year or so at most, and it was ignored or abandoned by nearly all the legions. Of the loyalists:
- In one of his brighter ideas, Roboute Guilliman himself stated during the Battle of Calth that the Edict of Nikea needed to be overturned as soon as possible. Thus, when he thought that Terra and the Emperor had already fallen he decided to build the Imperium Secundus in a manner he thought sensible and kept his Chief Librarian around as an advisor (much to the chagrin of a Space Wolves detachment deployed on Macragge to "ensure" Guilliman's loyalty.)
- (Without a Primarch, the remaining Iron Hands mostly fell in with the Ultramarines and so basically did whatever they were doing.)
- Lion El'Jonson re-introduced the Librarians as soon as he discovered that the traitors were using daemons, presumably knowing what shit was going down from his experiences on Caliban. Even going so far as to kick the living fuck out of a Chaplain who reminded him that it was going against the Emperor's edict. As in, literally punched his head off.
- Rogal Dorn locked all his Librarians up in the Phalanx and refused to even let them rejoin their battle brothers as line-troopers. However, when Nathaniel Garro stealthed his way on board to try and rescue them, they seemed happy enough where they were. Apparently all the Imperial Fists need to feel happy is thick walls around them. With the Primarch explaining that they were exactly where they needed to be. Presumably for keeping them in reserve for when the Imperium really need them. What happened to them afterwards is (as of yet) unexplained so we're forced to assume that were just left there to rot for a millenia or so until they died of old age or went rogue and warp-walked their way out.
- While Sanguinius desperately tried to uphold the Emperor's word, his own former Librarians met in secret and proved their worth by saving the entire Legion from the daemonic precursor of the Black Rage at Signus. So he kept them afterwards.
- There were barely any Salamanders left after Isstvan, though by M41 they looked back upon Nikaea as an ancient and archaic edict that had no place any more.
- Corax was a latent psyker but voted against at Nikea. We don't know if they reinstated their librarians but it seems extremely likely that they did after the Alpha Legion attack to disrupt/steal their cloning tech (which Librarians could have detected).
So by the Siege of Terra all but two of the loyalist legions definitely had active librarians, and one of the other two probably did.
Of the traitors (who all but one of were loyal at the time of Nikaea) the outlook was equally bullshit:
- Lorgar and his Word Bearers were already planning evil, so they just ignored the prohibition.
- Magnus The Red decided being a ninja space wizard was too cool, and ignored the decree.
- The World Eaters (somewhat puzzlingly) apparently ignored the decree as well, still having official Librarians (not Sorcerers, actual honest to goodness Librarians) during the Heresy, and there's no way in hell they reinstated them since they would be glad to get rid of them. As best we know they weren't represented at Nikaea (for reasons that may become obvious) and it's easy to see that Angron just didn't give a fuck because the decision didn't involve RAGE. However, the World Eaters hated their librarians all the while they existed and frequently didn't even tolerate them being around. This was nothing specifically personal, it was just that psykers made the Butchers' Nails a bit...twitchy and could not themselves be implanted themselves without becoming brain-dead. Which is not a good thing for brain implants that are already turning you into a psychotic, rage-filled murder machine. By the time of the Shadow Crusade the Librarians weren't even considered full members of the Legion anymore, and Angron killed them all shortly after he became a Daemon Prince.
- Mortarion was actually just about the biggest psyker hater in the universe, and was one of the decree's strongest supporters. Hilariously, this backfired badly on him when he eventually realised that getting the edict pushed through only weakened the loyalists psykers; his allies were (mostly) letting their psykers run rampant with a whole new set of freakshow abilities. Things got so bad for him that he tried to get the librarian supporting Jaghtai Kahn on his side. Jaghtai countered by attempting to carve the hypocrite out of Mortarion's pustuled arse.
- The Alpha Legion also ignored the edict, like they did almost everything else.
- The rest we don't know about.
In M41 the Edict technically still stands (no-one could overrule the emperor) but it stopped being enforced after the heresy and the marines could please themselves.
"Modern" 40k
There is obviously a bit of historical revisionism going on, because most accounts from the 41st Millenium look back at Nikaea and suggest that the Emperor actually said "yes" to Librarians, so long as they were trained in a controlled and careful manner. Which is what the White Scars and Blood Angels (not so much the blood angels, Sanguineous followed the edict and put the former librarians in as ordinary battle brothers, only after saving the whole legion(!) were they allowed back in, this happened after the Horus heresy begun (but before it finished)) were doing at the time anyway, it was only the Thousand Sons who ruined it for everyone by thinking there should be no limits
By M41 it has been left it up to individual Chapters whether or not to use Librarians, and most Chapters have Librarians to some degree or another, with the noticeable exceptions of the Black Templars and the Marines Malevolent.
Ranks
Among Codex compliant Chapters, the ranks of the Librarium are based on their level of training and advancement. They are as follows:
- Chief Librarian: The head of the Librarium, and the most powerful psyker in the Chapter. He is also one of the masters of the Chapter and usually a senior adviser to the Chapter Master.
- On the tabletop they are usually represented by named special characters of psychic mastery level 3, (or level 2 if they occasionally have some other unique ability) If you don't have a special character in your chosen chapter then you'll just have to settle for a cool Epistolary.
- Epistolary: The highest rank below Chief Librarian, Epistolaries serve as the main communication aides on the battlefield, sending psychic messages through the Warp to their brothers in the Librariums, similar to Astropaths, but without having their eyes burned out.
- While no longer explicitly stated in the 6th edition codex, Epistolaries have traditionally been psychic mastery 2 on the tabletop with the ability to know and cast two powers per turn.
- Codicier: Mid-level Librarians, who evaluate reports from campaigns and document them in their Librariums.
- Supposedly represented on the tabletop as the common variety "Librarian", only at level 1.
- Lexicanum: Entry-level Librarians, they are responsible for compiling battlefield reports for the Codiciers. Interestingly, they don't wear psychic hoods, or even helmets unless in dangerous environments.
- Haven't been represented on the tabletop since 2nd edition, when they were WS/BS4 W1 A1 Ld8 and a psychic power, could be interesting to see return in 6th though, just for fluff sake.
- Acolytum: Librarians in training. Brought in from the battle companies before or shortly after they leave the Scout company, they're tested for psychic potential. It's possible that the Acolytum may be killed in the process, but that's life in a Space Marine Chapter for you.