-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matching CLRS 4th Edition Styles #33
Comments
If you want, you can add "procname" to this array. Line 364 in 567fa31
Then, before your pseudocode you can use procname:
Making comments red can be achieved via CSS: span.ps-comment {
color: rgb(150, 22, 25);
} You can remove the border lines in CSS like so: div.ps-algorithm {
border-top: none !important;
border-bottom: none !important;
} Set background color: div.ps-root {
background-color: #FEF2D6;
} insert Lines 827 to 836 in 27d1cc7
Add some thick spaces to the lineNumberPunc: for (const pre of [...document.getElementsByTagName("pre")])
pseudocode.renderElement(pre, {
lineNumber: true,
noEnd: true,
lineNumberPunc: '\u205f\u200a\u205f\u200a\u205f\u200a'
}); (alternatively, and perhaps more cleanly, you could use CSS to move things instead of inserting thick space characters) /* Move the lines that are not in the main code section */
div.ps-root > div.ps-algorithm > div.ps-algorithmic.with-linenum > p.ps-line {
text-indent: -0.3em !important;
padding-left: 1.8em !important;
} If you want to use Times New Roman, you add a new font family in this table: Lines 49 to 83 in 27d1cc7
and then stick whatever you named it in here ( Lines 464 to 496 in 567fa31
I stopped here because I don't need Times New Roman for my purposes, but with a little tweaking you can make your pseudocode look exactly how you want it to! |
Thanks for the whole effects ! It's quite useful |
Thanks again @Validark for the neat hacks! Pinning this issue so others may discover it easily, and resolving this. |
Of course! I hope everyone got their pseudocode to look how they like it. And thank you for making this library! |
CLRS 4th is available now, so as its LaTeX style, in "Reader Resources" -> "CLRS code.sty". https://mitpress.mit.edu/books/introduction-algorithms-fourth-edition
Numbering only starts after procedure declaration.
Is there any work on porting it here?
The text was updated successfully, but these errors were encountered: