Comments (2)
Ok. I think I have a robust solution for this (but it is very, very ugly). Basic idea:
- Preflight - scan through LaTeX source and find all labeled equation environments (could alternatively pick up all numbered eqs, but if the point here is cross-referencing, then why number unreferenced eqs?). Could maybe make this a user toggle (number all vs. only referenced). In any case, scan through all equation, eqnarray, align (other?) envs and make dictionary of labels vs eq number.
- In the pandoc-generated HTML, at the same time as we're replacing the codecogs url with the canvas url, for each equation to be numbered, update as follows:
<span style="margin: 1ex auto; display: table; text-align: center; width: 100%; vertical-align: middle;">
<img class="equation_image" style="display: block; text-align: center; margin: 0.5rem auto;" [orig eq. content] />
<span style="display: table-cell; text-align: left; vertical-align: middle;">([equation nmber])</span>
</span>
- Update any references elsewhere in the HTML to the equation number instead of the label name (just a global replace like the others already in use).
Caveats: block math environments (eqnarray and align) can only have a single link as they are going to appear as a single image in the rendered html. The internal dict should basically just map all relevant eq. numbers to a single reference. I don't think this will be a major issue, but if people hate this, then just don't use these envs for eqs you want to reference in the text.
from grading.
Addressed by v2.9.0.
from grading.
Related Issues (12)
- pandoc subprocess fails when running in same directory as code
- canvas html mangles code blocks HOT 3
- change "download assignment" to "download PDF" in latex2page
- upload images when not wrapped in figures
- Default hidden=True in dir2page HOT 1
- populate quiz retakes based on previous answers
- ability to set consistent settings among groups of elements
- bulk sharing of canvas elements with course staff
- automatic setting of section-dependent due dates
- bulk adjust canvas assignments on one page, or one spreadsheet, or one python interface
- multiple-answer question bank upload
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grading.