Skip to content

Commit 3540b55

Browse files
jeremymanningclaude
andcommitted
Remove add-name task and fix HTML margin note spacing
LaTeX: - Remove "add your name to Lab members" TASK (now handled by onboarding bot) HTML margin notes: - Fix margin notes inside <dd> elements causing large gaps in left text and overlapping when multiple notes are adjacent - toc.js repositions dd margin notes to article level on window load, using absolute positioning at their original vertical offset - lab-manual.css adjusts margin-right/width for dl-nested notes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3b224e7 commit 3540b55

4 files changed

Lines changed: 37 additions & 19 deletions

File tree

lab-manual.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ dd dl {
153153
width: 100%;
154154
}
155155

156-
/* Margin notes inside definition lists need adjusted positioning */
156+
/* Margin notes inside definition lists need wider offset since
157+
dd elements are narrower than article-level paragraphs.
158+
These notes are repositioned by JavaScript (see toc.js) to
159+
prevent them from expanding dd height or overlapping. */
157160
dl .marginnote, dl .sidenote {
158161
margin-right: -80%;
159162
width: 40%;

lab_manual.pdf

-677 Bytes
Binary file not shown.

lab_manual.tex

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,23 +174,7 @@ \chapter{Introduction}\label{ch:intro} % Adding an asterisk leaves out this chap
174174

175175
\newthought{Who is this lab manual for?}
176176

177-
\noindent \marginnote{\texttt{TASK:} Upon reading through this lab
178-
manual for the first time, please update the document to include
179-
your name in the \hyperref[sec:curr_members]{Lab members}
180-
section. Importantly, be sure to fork the
181-
\href{https://github.com/ContextLab/lab-manual}{GitHub repository},
182-
make your edit on your personal fork, and submit a pull request with
183-
your update. Be sure to recompile the \texttt{.tex} file after you
184-
make your changes so that the \texttt{.pdf} file is updated and the
185-
\LaTeX~compiler catches any errors you may have made. Also, feel
186-
free to make any additional changes you think would benefit other
187-
current or future lab members. You could correct a typo, clarify
188-
something that’s unclear, add a comment or reference to a useful
189-
tool, etc. If you'd like to get feedback on your idea first, create
190-
a \href{https://github.com/ContextLab/lab-manual/issues}{GitHub
191-
issue} describing your proposed change; you can use the existing
192-
issues to help decide what to focus on for your own edits if you'd
193-
like.} Every new lab member should read the latest version of this
177+
\noindent Every new lab member should read the latest version of this
194178
lab manual in detail and reference it later as needed. Periodically
195179
throughout the document, you will see margin notes with listed
196180
\texttt{TASK} items. Completing your read through entails: (a)

toc.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ document.addEventListener('DOMContentLoaded', function() {
44
if (!toc) return;
55

66
// Clear existing TOC items (tex4ht generates broken links)
7-
toc.innerHTML = '';
7+
while (toc.firstChild) toc.removeChild(toc.firstChild);
88

99
var headings = document.querySelectorAll('h2.chapterHead');
1010
headings.forEach(function(h, index) {
@@ -26,3 +26,34 @@ document.addEventListener('DOMContentLoaded', function() {
2626
toc.appendChild(li);
2727
});
2828
});
29+
30+
// Fix margin notes inside definition lists.
31+
// Floated margin notes inside dd elements expand the dd height,
32+
// causing large gaps in the left-side text. We reposition them
33+
// as absolutely positioned elements relative to the article.
34+
// Runs on window load (after layout) so getBoundingClientRect is accurate.
35+
window.addEventListener('load', function() {
36+
var article = document.querySelector('article');
37+
if (!article) return;
38+
39+
article.style.position = 'relative';
40+
41+
var ddNotes = document.querySelectorAll('dd .marginnote, dd .sidenote');
42+
var articleRect = article.getBoundingClientRect();
43+
44+
ddNotes.forEach(function(note) {
45+
var parent = note.parentElement;
46+
var anchorRect = parent.getBoundingClientRect();
47+
var topOffset = anchorRect.top - articleRect.top;
48+
49+
note.style.position = 'absolute';
50+
note.style.top = topOffset + 'px';
51+
note.style.right = '0';
52+
note.style.width = '25%';
53+
note.style.marginRight = '0';
54+
note.style.float = 'none';
55+
note.style.clear = 'none';
56+
57+
article.appendChild(note);
58+
});
59+
});

0 commit comments

Comments
 (0)