-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/side by side objects #52
Conversation
Dear Chris, Looks like a great start and I like all the smiling faces. ;-) Most important: I think the markup in the sample article looks real good. David Mild cruise through the code, not exhaustive: Is "\DeclareFloatingEnvironment" from the "float" package? I'd guess so. Your When you are ready, see if you can save with all spaces for indentation, there's I'll apologize for the obtuse theorem-numbering code. Some day (summer?) I'll As usual, thanks for the contributions! Rob On 02/15/2015 06:38 AM, cmhughes wrote:
|
Hi Rob, Is "\DeclareFloatingEnvironment" from the "float" package? I'd guess so. Your replacement hard-codes "Figure". In fact, Please incorporate that "type-name" template which allows for some degree of internationalization, such as when you use the "autoname" feature. Thanks for pointing this out, sorry for not catching it myself. When you are ready, see if you can save with all spaces for indentation, there's a small mix of tabs. This is critical for chunks of Python/Sage code, so I have tried to therefore just be consistent throughout the source. I've re-spaced my chunk of code from I plan to test this code a bit more before continuing--for example, you might not like the alignment of the multi-line captions as it currently stands. I'm particularly curious about the Best |
Thanks, Chris. When you are done, let me know if any float stuff can be Sorry - I forgot your query about the divs and did not look at them carefully. Also, hard-coding "style=" is perfectly fine while developing. Long-term we On 02/15/2015 12:34 PM, cmhughes wrote:
|
I got the message "Your browser is unable to render this SVG image", but I was still able to test it. In the last example I tried replacing the middle figure by text in "p" tags. It didn't recognize width="33%" on the "p" tag, But if I put the "p" inside a "figure" tag, then it actually looked reasonable. So it looks like a good start to me. Need to decide what things can go side-by-side: Some thought is needed on reasonable defaults, such as in the likely case that the widths I don't think I understand the intent of children="subfigure", or how that would generalize. |
Hi David, I got the message "Your browser is unable to render this SVG image", but I was still able to test it. You need to run the In the last example I tried replacing the middle figure by text in "p" tags. It didn't recognize width="33%" on the "p" tag, But if I put the "p" inside a "figure" tag, then it actually looked reasonable. Currently that is expected, but I plan to add support for the So it looks like a good start to me. Need to decide what things can go side-by-side: These are the only things that I can think of, but am open to other ideas. The Some thought is needed on reasonable defaults, such as in the likely case that the widths Yes, that's a good point; I should be able to add up the I don't think I understand the intent of children="subfigure", or how that would generalize. This allows the David, Rob says that you're the person to critique my @rbeezer @davidfarmer I plan to update this with support for Best |
Dear Chris, It may take some iteration to figure out the right way to do the You have each side-by-side group wrapped in a figure (in both For the components in the side-by-side, we are going to have Your suggestion of inline-block sounds reasonable, but .sidebyside figure { vertical-align: top; } to give reasonable defaults to the components. So you will only output a small amount of styling information What to you think of the following: < div class="sidebyside"> ... < /div> wrapping the whole thing. On each component: class="left" or class="middle" or class="right" (with no middle in the case of two things side-by-side). Note: if the side-by-side only contains figures, then I guess That should be enough markup to write CSS with reasonable defaults? .sidebyside p.right { } I can write a first draft of that CSS if people are agreeable to Regards, David On Mon, 16 Feb 2015, cmhughes wrote:
|
David had hinted at vertical alignment. I can see tables of varying height, all with header rows, and it makes sense Does it make sense for the consituents (image, tabular, p) to react to a Rob On 02/16/2015 12:30 PM, davidfarmer wrote:
|
Hi David, Rob, You have each side-by-side group wrapped in a figure (in both the xml and the html). That may be reasonable when all the components are figures, but in general we want something else in the XML, and probably a div with class="sidebyside" in the html (or whatever class we decide). Yes, indeed--this was as a result of the discussion in https://groups.google.com/forum/#!topic/mathbook-xml-support/-ZWrb-i8ZTE. Are we saying that we want three separate cases:
and
and
What to you think of the following: < div class="sidebyside"> ... < /div> wrapping the whole thing. On each component: class="left" or class="middle" or class="right" Yep, that sounds reasonable. I'm guessing the Does it make sense for the consituents (image, tabular, p) to react to a "valign" attribute? I will almost certainly use "valign" in "tabular", and I'd love to be get as much reuse/consistency as we can out of names like this. I certainly think that there is a need for an The only thing I'm struggling with on this collaboration is the |
I have some guesses for default alignments in CSS: table: top Okay, now I realize that CSS does not let you select every possibility. But maybe you are talking about what to put in the XML to On Mon, 16 Feb 2015, Rob Beezer wrote:
|
We/you need a CSS file you can use as part of your testing. We can do that however you want. My suggestion is that you or I Let me know if you want me to do the first version. As to the XML markup, I have thought less about that, but why In other words, your 3rd case contains the first two. On Mon, 16 Feb 2015, cmhughes wrote:
|
On 02/16/2015 10:30 AM, cmhughes wrote:
"figure" and "table" have captions of their own, and (will) contain "image" and Might it be possible to recognize the absence/presence of "caption" and "title" Conversely, allow "sidebyside" to also include "image", "tabular", and some I'm not being 100% clear, but am trying to see how much we can infer from an Is the "children" attribute something we can deduce from the organization of the The more inspection/computation we can do, the easier the author's job becomes. Rob |
It's probably best if you make the first version.
Yes, this was my initial thought (as you'll see from my first post in the
|
|
On 02/16/2015 01:26 PM, cmhughes wrote:
I was guessing that these would be the first and last of "sidebyside" and would
"valign" would be the MBX attribute (along with "halign"). We get to make them
MBX is the new elemens and attributes, and how they are organized. I want to be David (rightly) wants to create very stylable HTML. And I agree entirely. So Rob |
On 02/16/2015 01:39 PM, cmhughes wrote:
I must not have been clear, or was misunderstood. ;-) I've been thinking of "sidebyside" as an outer wrapper. Feel free to show me where I messed up. |
I realize that I should have said that the objects which can p, paragraph, image, figure, tabular, table Most of my personal use cases involve the first of each pair, Rob's sample MBX markup in the Side-by-side thread, on Feb 8, almost On Mon, 16 Feb 2015, cmhughes wrote:
|
On 02/16/2015 01:26 PM, davidfarmer wrote:
Yes, in the XML. |
On 02/16/2015 01:39 PM, cmhughes wrote:
Maybe I was suggesting "sidebyside" as a wrapper of any variety of items, but Rob |
On 02/16/2015 01:57 PM, davidfarmer wrote:
It was really to emphasize that multiple paragraphs could be construed as a |
Thanks for the follow-ups. I'd like to try and clarify where we're at with this after the very fruitful discussion above--please do feel free to correct me :) Rob, I apologise if I misunderstood you here or in the other thread. We want the
All this being said, is it true to say that the examples I have in the As far as next steps go, @davidfarmer could you put together a bare-bones
With this in place, presumably I would remove |
These comments refer to the html: There can be class="sidebyside" as an attribute to a div or figure Usually it is a div unless you want a caption on the group. Your list of possible objects is correct, except that "paragraph" These comments refer to the MBX: The "sidebyside" tag wraps the 2 or 3 objects to be side-by-side. The sidebyside tag is a paragraph level object: it cannot be wrapped I don't see why the sidebyside tag needs to specify its children We need to get straight which layout properties may need to be The HTML output will use style="..." to convey the layout information On Tue, 17 Feb 2015, cmhughes wrote:
|
I sent the following in an email, but it didn't appear on this thread. Not sure why. On this page: http://aimath.org/~farmer/print/sbs/ I have made a mockup of some content and the associated CSS. Just |
On 02/17/2015 12:11 PM, cmhughes wrote:
No problem whatsoever - bound to happen (and I'm surprised it is not more often).
Yes, that will be part of tables. "tabular" will be the guts, perfect for More on David's post. Rob |
Right, sounds good.
I actually think it could be more than 2 or 3; we could potentially have more than that number of figures or tables.
Let's say that you have two figures side by side, with a global caption. You're saying you want the xml to look as follows
Can you confirm? I'm happy to go implement this; Rob, can you confirm this is how you envisage?
I guess we could do a check to see if With this in mind, I can see that we could get rid of
Ok, that makes sense, and should be fine to implement. Awesome, thanks, I'll take a look, make some changes, and report back. |
On 02/17/2015 01:18 PM, davidfarmer wrote:
"paragraph" is an inconsistent thing. We mark it up in HTML output like an
Lots of things are "peers" of paragraphs and direct descendants of sectioning
I think this was the source of my not-well-stated question earlier. Is children Could we distinguish three "figure" inside a "sidebyside" versus three "image" In any event, I think David and I both need a clearer idea of what "sub-*" |
On 02/17/2015 01:42 PM, cmhughes wrote:
I think that looks/sounds good.
Are you thinking...: Global caption gets a number, subitems get an (a), (b), etc with or without a This leaves a subitem that is several paragraphs to be dealt with somehow. The
I think that would be good. Rob |
Yes, this was the intention. However, bearing in mind the comment below, I can now see that there is no need for it:
Yes, exactly. I am confident that
I don't have an opinion on this :) I hope to get to work on this before the weekend, thanks again to you both the feedback, and for the examples. I think I have a clear vision of what you both would like. |
On 02/17/2015 02:26 PM, cmhughes wrote:
Very good!
Where is the fun in that? ;-) It is David's construct, so he can have the last
And I hope it accomplishes what you set out to do in the first place. Thanks Rob |
In a totally separate thread is was asserted that "paragraph" provides At the time, "paragraph" served its intended purpose, which was to I still think that makes sense in the current context, and we don't Rob took my original side-by-side markup and put a paragraph with So, I say 'no' to numbers on paragraphs. But we do need better html
|
I can provide more html examples, and/or my guess at the corresponding MBX markup. |
What happens when the user specifies widths that total to more than 100 Maybe just adjust down to 95 percent if the total is more than that? On Wed, 11 Mar 2015, cmhughes wrote:
|
Thanks for the idea; the |
Looks good. I don't have any other comments. On Wed, 11 Mar 2015, cmhughes wrote:
|
1279eae
to
da2a72f
Compare
Thanks for your time in helping to get the html side working. I don't have anything else to add to this, but am happy to implement other On Wednesday, March 11, 2015, davidfarmer notifications@github.com wrote:
|
I'm going to give it a look as soon as I can carve out the time, but have Spring On 03/12/2015 10:24 AM, cmhughes wrote:
|
Thanks very much, Chris. Nicely done. This will be a valuable addition. And Merged, with some minor editorial work on the commit messages. I should have What next? ;-) Rob On 03/12/2015 10:24 AM, cmhughes wrote:
|
Awesome, thanks very much for accepting it :) I hope it will be a useful Best On Fri, Mar 13, 2015 at 4:51 AM, Rob Beezer notifications@github.com
|
Two small issues have come to light with this feature: one of them is LaTeX is related (which can be fixed easily) and one of them is html related (which will rely upon David's CSS magic).
The following snippet demonstrates both of these, which can be pasted into
My question is: now that |
Dear Chris, No problem. Just make a branch with the necessary changes off wherever the tip If the extensive examples in th sample document don't flex these items, feel Thanks, On 03/16/2015 03:10 PM, cmhughes wrote:
|
Finished up basic tables today and put tiny placeholder tables into the side-by-side. That seems to have exposed some bugs. In a template for The last four tabulars seem to throw several warnings each (commenting them out right now), and then so do some of the others. Using "apply-imports" definitely helps, but still there are some warnings. Put an xsl:message inside the generic "tabular" template to get a feel for what's going on. Try making the other tabulars into one-row one-cell tables and some more warnings will arise. I figure you have a better idea of what should be happening, but let me know if you want me to pursue this some more. |
da2a72f
to
a92ad58
Compare
@rbeezer @davidfarmer I've updated this branch to account for the (now present) A couple of CSS vertical alignment issues remain in Sections |
Dear Chris, Thanks for doing all the tables (I was prepared to do that myself). Definitely bad practice for both of us to let side-by-side tables go in before tables were done, but I knew the risks. I'm not done looking, but had one big question for now. No rush, I may come back and tinker some more later and get it straight in my head myself. I see
and a call/use at
Can you educate me on that device? And what happens if we later have
Every place a generic Earlier I could get Rob |
Hi Rob,
My understanding is that the latest template (in the |
The vertical alignment in 22.11 and 22.12 (which I think are now 22.10 and 22.11) is being completely I agree that things are not appearing as intended, and my current theory is that this is due to For example, in the table - text - text example, where the table is short and the text in the Not sure there is anything to do about it now, except maybe put a warning in the sample |
Dear Chris, Yes, I think you are right about the order. I've been trying to avoid having template order have anything to do with which template gets used, that sounds like a nightmare maintenance problem long-term. (Though there may be a place where I did this long ago.) I do regularly use "apply-imports" to override base templates in specialized converters based on importing general stylesheets into specific ones - that works like a charm. I re-read the post about apply-imports, so I think I was mistaken about being able to use that here. (XSLT 2.0 has "next-match" which would be perfect, I think.) If the following sounds feasible would you be willing to give it a try?
In short, I use modal templates a lot like I am doing object-oriented programming. Rob |
0a42bc7
to
1025973
Compare
1025973
to
48a222c
Compare
Hi Rob, I believe that I have incorporated the feedback you provided above into my branch; I can see why you like this approach, it is really quite clean. I hope I have implemented as you would like and I'm happy to make further modifications if you'd like. Best |
Hi Chris, I'm still working on the implementation of This code should be making three side by side blank graphs, but instead it is making 6. The
|
I tested Chris' new work and the old stuff was giving me duplicates and the new Rob On 04/02/2015 04:21 PM, Alex Jordan wrote:
|
Never any rush, at all. Code looks good. I'm going to have another look right now. Seems we have one small problem, I think. If so, my fault. A "tabular" can Am I right? Any ideas for a fix? Rob On 04/01/2015 09:56 AM, cmhughes wrote:
|
Merged. Much cleaner. Thanks for working through that. Alex - try now. |
I can confirm it's working without the earlier repetition. Thanks! |
Thanks for reviewing and merging this, I'm glad it has fixed the Regarding the halign issue; I'm not sure that the sidebyside value has On Friday, April 3, 2015, Alex Jordan notifications@github.com wrote:
|
Hi Rob,
This pull request is subsequent to the discussion started here: https://groups.google.com/forum/#!topic/mathbook-xml-support/-ZWrb-i8ZTE
I'm submitting this quite early for review--it does not yet do all of the things that I want it to do, but before I go too far down the rabbit hole, I'd like to know your thoughts on what I've done so far :)
If you process
examples/sample-article.xml
with bothmathbook-html.xsl
andmathbook-latex.xsl
you'll see the following output:html
(The coloured boxes are simply to help me make sure the widths are as I would intend--they'll be removed once this feature is finished.)
LaTeX
I'd mainly like to know if this looks ok to you; I've loaded a couple of packages on the
LaTeX
side, both from the same author as the excellentcaption
package (loaded in one of my other pull requests). Thehtml
side usesdiv
boxes.I'll happily receive all feedback, and look forward to adding more to this once I've heard back :)
Best
Chris