pretextbook / pretext Goto Github PK
View Code? Open in Web Editor NEWPreTeXt: an authoring and publishing system for scholarly documents
Home Page: https://pretextbook.org
License: Other
PreTeXt: an authoring and publishing system for scholarly documents
Home Page: https://pretextbook.org
License: Other
I am implementing horizontal partial lines across tables, of variable thickness. The minimal working example from tex.se is the basis of the implementation. Add in the extensible arrow package extpfeil
and it silently breaks. The horizontal lines just become their default thickness. Have not decided what to do about this conflict (tables should win, I think), but a fix would be even better. I cannot see how the conflict arises.
\documentclass{book}
% \usepackage{extpfeil}
\newlength{\Oldarrayrulewidth}
\newcommand{\Cline}[2]{%
\noalign{\global\setlength{\Oldarrayrulewidth}{\arrayrulewidth}}%
\noalign{\global\setlength{\arrayrulewidth}{#1}}\cline{#2}%
\noalign{\global\setlength{\arrayrulewidth}{\Oldarrayrulewidth}}}
\begin{document}
\begin{tabular}{ccc}
a & b & c \\\Cline{2pt}{2-3}
d & e & f \\\Cline{5pt}{1-2}
\end{tabular}
\end{document}
Put the title, or other useful things, in the title tag of the head of the html.
There is no tooltip for the <url href="...">text</url>
tag. That is against good accessibility guidelines as well as normal <a>
tag practice. At least one should be able to do so, but it doesn't seem to work.
There are several examples of <c><</c>
for obvious reasons. I think this is necessary in Sage cell code too.
In the default presentation, there is a little book symbol on the upper left which does nothing useful (keeps you on the same page but reloads) and the word "Contents" does not give you the front TOC page as one might expect. In effect, it becomes impossible to go up to the top without clicking "up" several times when drilled far down into a <book>
.
See the first and last posts at:
https://groups.google.com/forum/#!topic/mathbook-xml-support/Qk-2LIbBb_A
Should test again when MacPorts upgrades. From last post:
"I have version 0.2.2 on Ubuntu Linux 14.04 and the shading comes through to the SVG version.
http://packages.ubuntu.com/trusty/pdf2svg
And it would appear that on a Mac Tom gets 0.2.1.
https://www.macports.org/ports.php?by=library&substr=pdf2svg
"
I seem to recall that the Sage notebook intercepts script tags in worksheet source. This has required disabling
And there will be more. I am pretty sure there is a workaround - this is a reminder to go find it.
Some sections of "code" in source have critical alignment properties, and even if not, the current "sanitize-sage-code" template gets confused with tabs. So we should check first for a tab character and issue a warning.
<m>0\leq x <percent /> m <m</m>
If I leave it as %
, it works fine in html but not latex. If I leave it this way, it doesn't show up in HTML. Exactly the thing that <percent />
was supposed to avoid... sigh. It's my fault for putting non-math in there, I know, but anyway thought it was worth reporting. I have a feeling some other such things will also not render properly in math mode. My workaround was to get the %
out of the math and put it in a code tag for now.
I'm doing the spacing for environment and section headings in the CSS, as mentioned in BooksHTML/mathbook-assets/issues/25. Part of it was broken before, but it's fixed now, so it will be important that you remove the whitespace from between the <span>
elements so that the browser doesn't interpret it as a single space.
There are a couple of different ways to do this:
<span class="type">Proof</span><span class="codenumber">1.2.3</span><span class="title">Loch Ness Monster Proof</span>
<span class="type">Proof</span
><span class="codenumber">1.2.3</span
><span class="title">Loch Ness Monster Proof</span>
<span class="type">Proof</span><!-- no whitespace
--><span class="codenumber">1.2.3</span><!-- no whitespace
--><span class="title">Loch Ness Monster Proof</span>
There also might be some XSLT specific ways to handle whitespace. This looks promising.
HTML multicolumn lists with semi-complicated MathJax seem to sometimes put just one item on a line (or otherwise skip over certain items).
Two known examples: Judson's AATA Exercises 1.17 and 4.4.
Likely beyond our control and one to report to MathJax.
If I put an <appendix>
element inside a <chapter>
or <section>
, it looks great in HTML. However, in latex it becomes its own chapter. Not good for maintaining the same numbering scheme!
It should be possible to set a document-wide switch from the XML source, and perhaps have it "overideable" by the "param" passing on the command-line or in extensions of the XSL.
Like fact, theorem, statement, etc. This is common enough in things like discrete math textbooks. (I didn't find it in the sample article, anyway.)
Example of bad behavior is in Chater 4 summary page of Judson.
In a web interface it makes more sense to have a shorter list on the left of just chapters (say, or to whatever depth you want since you provide some configuration) but then allow either mouseover or clicking to expand that particular thing. Say that it looks like
and then you want to see the list of subsections in 3.2, you could click or mouseover it, just like in zillions of very well-designed web pages like Amazon, nested javascript menus or whatnot.
Clearly this would need to be an option only, and maybe it should be tagged "wish list" or something, but figured I'd put it out there.
As requested in #31, here is a ticket with a list of things that need to be documented. I'll keep changing this list as things are done.
<p>
or other stuff outside the few legal containers in them.<p>
, for instance apparently inside remarks.<acro>
tag is for (?)makeindex filename
for filename.tex
<md>
, <me>
, <mdn>
, <men>
. (And using number="no"
.) Eventually I figured it out, but because the d
doesn't convey "rows" to me, I wasn't sure at first exactly what was going on.The little mini-toc on the left of a typical MBX output is not collapsible by chapter. Likewise, it is not "uncollapsible" in the sense that if one clicks on a subsection with sub subsections, that one would want to see a list of the subsubsections on the left.
The enumitem
package appears to only load if there are exercises or references. But it is also needed for lists, since currently the enumitem
optional argument is used in things like \begin{itemize}[label=\textbullet]
.
I can fix this. Just making a note here. I may work on a pull request to handle a bunch of these issues later, with a commit for each one.
Process LaTeX output (optionally) with Chris Hughes' package:
https://www.ctan.org/pkg/latexindent
to make the source even prettier (like for an archival copy of some publication). Will likely require adding the right code to the mbx script, but I have not looked carefully.
Captions get a bold font, so the math should do the same.
Wrapping each element's contents in \mathbf{} would appear to look perfect.
@mxdubois: is the style (font weight) for captions stable?
Opening and closing exercise lists unnecessarily leads to empty lists, which latex compilation does not like.
https://groups.google.com/d/msg/mathbook-xml-support/VOzyCjmaFiQ/5VPzEmwYMk8J
This may be solved by conditioning on expressions like not(preceding-sibling::exercise) and not(following-sibling::exercisegroup)
This is sort of hidden in the scripts directory, and I didn't even know about it, and I still am not quite sure what it does - presumably helps with conversion to sws? A readme or some other mention of it would be great, as time allows. See also #16.
Image-like elements could benefit from a description tag to put in alt test. Possibly as a tooltip in pdf. For <image>
, <tikz>
, <sageplot>
, <asymptote>
.
For now, workaround is
<program>
<input>
stuff
</input>
</program>
at least I think that should work, but maybe that's not ideal.
Hi Rob,
This is a great project! We met last year (June 2013) in Vancouver at the WeBWorK coding camp.
I've been playing with the mathbook, and it works very nicely. I have noticed that when viewing the html version, if I enable Zoom factor for MathJax, then the displayed math mode gets cut off when zoomed in. I'm using the sample-article.xml
; I've posted a screenshot here:
http://spot.pcc.edu/~chughes/nozoom.png
It seems like the issue stems from:
http://aimath.org/mathbook/mathbook-modern-3.css
Do you have any insight on this?
Chris
Hey Rob,
You may have fixed this somewhere and not yet merged it into "dev", but when I generated the sample-article off the "dev" branch, I got markup like this:
<div id="toc-navbar-item" class="navbar-item">
<h2 class="navbar-item-text icon-navicon-round ">Table of Contents</h2>
<nav id="toc"><h2 class="link"><a href="section-1.html">1 Introduction</a></h2>
{{ all good in here }}
</nav>
</div>
It looks like the old ToC markup. You can remove the <div id="toc-navbar-item">
and <h2 class="navbar-item-text icon-navicon-round">
elements. We just need the <nav id="toc">
now.
You can view it here.
Thanks!
As requested in #21, I am asking for a <comment>
tag. In this case, it should not be something numbered - that would be a <remark>
. Ideally it could be marked up in some way with a custom style sheet. Comments are just asides that need to be clearly marked as asides; that is not really possible in the usual <p>
format, as parentheses around a paragraph is not a strong indication.
(Alternately, one could have a switch on various things allowing them to not be numbered; an unnumbered remark is a comment, in my current thinking, though probably not universally.)
Asymptote makes SVG images, but when the image is lots of pixels not amenable to SVG, it includes some PNG images. These migrate to the DATA+'/images' directory, but teh SVG include mechanism seems to be confused by Sage's redirection on the data directory.
For kcrisman and kkedlaya.
Design question: should the distinction between a book and an article simply be based on which sections are present?
I've brought this up in a couple of email chains, but I'm going to make an issue for it, so it doesn't get lost in the shuffle.
I think some comprehensive test pages would make it a lot easier to ensure styling and markup is working as intended across all features. They'd also double as great examples for prospective authors.
We need...
Here's an example from a premium wordpress theme. It's not exactly like what we need, but it gives you an idea of how this could be extremely useful both as a test page and a demo.
Here's another example that also displays the code for generating each item right above the item. Something like that might make it a handy guide for authors.
This is probably not the ideal intro to MBX for those who haven't already seen you give lots of presentations on it. Yes, I am on the dev branch.
$ xsltproc xsl/mathbook-html.xsl examples/sample-article.xml
examples/sample-article.xml:1068: element biblio: validity error : ID biblio-strang-article already defined
<biblio type="raw" xml:id="biblio-strang-article">Gilbert Strang
^
URL: demonstration-1.html
MBX:WARNING: could not translate string with id "note" into language for code "en-US"
MBX:WARNING: could not translate string with id "note" into language for code "en-US"
MBX:WARNING: could not translate string with id "note" into language for code "en-US"
MBX:WARNING: could not translate string with id "note" into language for code "en-US"
MBX:WARNING: <cite provisional="just-a-test"> is deprecated, convert to <xref provisional="just-a-test">
MBX:WARNING: <cite ref="biblio-only-a-test> is deprecated, convert to <xref ref="biblio-only-a-test">
MBX:WARNING: unresolved <xref> due to ref="pointer-to-nowhere-as-test"
MBX:WARNING: Cross-reference (xref) with no ref or provisional attribute, check spelling
MBX:WARNING: could not translate string with id "note" into language for code "en-US"
MBX:WARNING: could not translate string with id "note" into language for code "en-US"
MBX:WARNING: could not translate string with id "note" into language for code "en-US"
MBX:WARNING: could not translate string with id "note" into language for code "en-US"
MBX:WARNING: could not translate string with id "backmatter" into language for code "en-US"
Such as definition. Wasted 10 minutes trying to get the definition to actually show up!
On a "per-subdivision" basis. Suggested by kcrisman.
For example, right now if I'd use xref
in Exercise 2 to refer to Exercise 1, the output string is something like "Exercise 1.1.1.1". It would be nice if it would just be "Exercise 1". See https://groups.google.com/forum/#!topic/mathbook-xml-support/kXCrMcmVCCk.
Just a note that the CSS for a byline at the level of a section might get some attention. A byline at the level of a chapter stands out as separate from the text, but not so much with a section.
For example, in a preface
element, with a title, the title comes out with space before it. I think the space is meant to be there between a section number and the title, but since there is no number, the title looks oddly indented.
Would be good to use <time class="publication-date" pubdate datetime="2011-07-03">
for dates like the published date on the frontmatter.
Here's the reference page: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time
The pubdate
and datetime
attributes are from the HTML spec.
The publication-date
class would be good for styling. I could make it bold if you like or bold and light gray. Up to you.
Not high priority, but good practice for SEO and such.
It doesn't seem to just magically turn up in frontmatter. In scla it is in the "colophon" but frankly you should be able to put it wherever you want to, and not everyone wants a "colophon". It's also not mentioned in the article, even though transferring copyright of articles is this annoying thing we have to deal with for many publishers.
Hi Rob,
I've been wondering about the tgroup
tag.
Referencing sample-article.xml
, I see that you have code such as
<table xml:id="table-euler1">
<tgroup cols="4" align="center">
This puts all 4
columns as centered.
I've been working on a feature that allows the following mark-up:
<table>
<caption/>
<coltypes>
<col align="center"/>
<col align="left"/>
<col align="right"/>
<col align="decimal" format="4.4"/>
<col align="decimal" format="6.6"/>
</coltypes>
which produces tables such as the following
Note that each column has different alignment, and that it also allows decimal alignment.
I have another feature (called multobjects
) that allows multiple tables, multiple figures, figures and tables, subfigures, subtables, to be placed next to each other.
Both of the features that I have developed do not use the tgoup
element. Before I submit these features for your review, I wondered if I could know your thoughts on the tgroup
tag--other than column types, what does it do? :) If I've misunderstood its use, I'm sure I can work it back into my features.
Thanks for your time
Chris
! You can't use `macro parameter character #' in horizontal mode.
l.991 ...thon, comments on them are given after '#
' signs.%
Replacing it by <c>#</c>
works, but maybe sometimes I don't WANT to make it code.
See this thread for experiences and some code descriptions for making tooltip/alt-text equivalents in PDFs.
https://groups.google.com/forum/#!topic/mathbook-xml-support/MrSPP-bwJWU
See
for examples of image descriptions.
It would be nice to be able to specify some extra packages when using the <tikz>
tag. The packages would be loaded in the template before the \begin{document}
.
For instance, right now I'd like to use the forest
package to make a tikz-based tree diagram. I think there are a lot of packages out there that would work similarly.
I'm happy to make modifications to extract-tikz.xsl
and submit a pull request, but I'm interested if you have a suggestion for the right way to do this.
Summary introductions are output inside the <nav class="summary-links">
element.
They should be output in a <section class="introduction">
element before the <nav>
.
Thanks Rob!
It would be convenient, especially for testing, to be able to send a string through MBX to the Sage (or otherwise) XSL converters in their command-line invocations.
It will tokenizing them by spaces for the Python subprocess command I think.
Just like in LaTeX, theorem
versus theorem*
. See discussion in #39, including some (very) preliminary thoughts on possibly author tools.
I'm ready to merge feature/refactor into develop, but it will break the content styling unless you add the class "mathbook-content" to the <div id="content">
element. If you want to test that it works, you can use http://mathbook.staging.michaeldubois.me/feature/refactor/stylesheets/mathbook-modern-3.css
.
This refactor will have a mathbook-content.css
for external use (Python Notebooks, etc). As you've probably guessed, that file will add content styling for everything inside of an element with the class "mathbook-content".
You will not have to add mathbook-content.css
to the standard mathbook html, though. It's all included in mathbook-modern.css
.
When you're ready for it, I'll complete the merge.
I just noticed this in class right now - could be pretty helpful!
Develop a way for an author to specify a CSS file that extends the stock style provided for HTML. This would likey be a param
as part of processing, since adding it to <docinfo>
does not seem entirely right (the default files are given as param's).
It seems impossible to predict a link from worksheet to another. So we have killed all linking in Sage worksheets.
It should be possible (generally) to manufacture intra-page links (href="#foo") and then recognize them for use.
This would be wise for single worksheet documents.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.