diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-16 18:48:23 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-16 18:48:23 +0200 |
commit | b31ebef3db3765eef8e0492897e870a9fa4cd32b (patch) | |
tree | 6ac5f83fe766bd947009ed0bc578ffb5bd2a52e7 /scripts | |
parent | dd2db2b7f62106e6c6c2abdaed73c5f608c690c6 (diff) |
fix cross-reference links to external file
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/reqs2tex.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/scripts/reqs2tex.py b/scripts/reqs2tex.py index c5ab3dd..667eeb6 100755 --- a/scripts/reqs2tex.py +++ b/scripts/reqs2tex.py @@ -69,18 +69,15 @@ def convert(data): return reqs def req2aux(req): - # TODO: this is a dead-end solution, newlabel only works for in-document anchors, not external links + ref = tex.label2ref(req['label']) out = [ - tex.scmd('newlabel', f"req:{req['label']}:id", tex.group(req['id'], req['id'], '', './requirements.pdf', '')), - tex.scmd('newlabel', f"req:{req['label']}:id@cref", tex.group(f"[requirement][][]{req['id']}", '')), + tex.cmd('newlabel', f"{ref}", tex.group(req['id'], req['id'], 'ggg', 'hhh', 'iii')), + tex.cmd('newlabel', f"{ref}@cref", tex.group(f"[requirement][aaa][bbb]{req['id']}", '[ccc][ddd][eee]fff')), ] - return "\n".join([tex.auxout(line) for line in out]) + return "\n".join(out) def fmt_aux(data): - out = "" - out += tex.cmd('makeatletter') - out += "\n".join([req2aux(req) for req in data]) - out += tex.cmd('makeatother') + out = "\n".join([req2aux(req) for req in data]) return out def fmt_tex(data): |