Skip to content
Snippets Groups Projects
Commit bd9e09cf authored by tuhe's avatar tuhe
Browse files

Citation script fix after port from coursebox

parent e7c3391c
No related branches found
No related tags found
No related merge requests found
......@@ -134,14 +134,10 @@ Next, we load the python file containing the reference code and fix all referenc
The middle command is a convenience feature: It allows us to specify a special citation command `\nref{..}` which always compiles to `\cite[\ref{...}]{herlau}`. This is useful if e.g. `herlau` is the bibtex key for your lecture notes. The result is as follows:
```python
"""
{{copyright}}
References:
[Ber07] Dimitri P. Bertsekas. Dynamic Programming and Optimal Control, Vol. II. Athena Scientific, 3rd edition, 2007. ISBN 1886529302.
[Her21] Tue Herlau. Sequential decision making. (See 02465_Notes.pdf), 2021.
"""
[Her21] Tue Herlau. Sequential decision making. (See 02465_Notes.pdf), 2021."""
def myfun(): #!s
"""
To solve this exercise, look at eq. (1) in Section 1.
......
"""
{{copyright}}
References:
[Ber07] Dimitri P. Bertsekas. Dynamic Programming and Optimal Control, Vol. II. Athena Scientific, 3rd edition, 2007. ISBN 1886529302.
[Her21] Tue Herlau. Sequential decision making. (See 02465_Notes.pdf), 2021.
"""
[Her21] Tue Herlau. Sequential decision making. (See 02465_Notes.pdf), 2021."""
def myfun(): #!s
"""
To solve this exercise, look at eq. (1) in Section 1.
......
No preview for this file type
......@@ -61,13 +61,13 @@ def fix_bibtex(lines, bibtex):
s = s[:i] + rtxt + s[j+1:]
i = i + len(rtxt)
cpr = "{{copyright}}"
cpr = ""
if not s.startswith(COMMENT):
s = f"{COMMENT}\n{cpr}\n{COMMENT}\n" + s
if len(all_refs) > 0:
i = s.find(COMMENT, s.find(COMMENT)+1)
all_refs = [" " + r for r in all_refs]
s = s[:i] + "\nReferences:\n" + "\n".join(all_refs) + "\n" + s[i:]
all_refs = [" " + r.strip() for r in all_refs]
s = s[:i] + "References:\n" + "\n".join(all_refs) + s[i:]
# s = s.replace(cpr, info['code_copyright'])
return s.splitlines()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment