conic-toan:0.3.4 - #5607
Open
Thutran1891 wants to merge 3 commits into
Open
Conversation
…i-cau theo the loai; kham-pha/trai-nghiem/thao-luan; fig-pos center
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update of
conic-toanfrom 0.3.3 to 0.3.4. No breaking API changes; the minimum compiler version stays at 0.13.0. All existing figures and layouts are unchanged — every new parameter defaults to the previous behaviour.New
giao-duong-thang-duong-tron((A, B), (O, r))returns the intersection of a line and a circle as an array ordered alongA -> B:()when they miss,(P,)when tangent,(P1, P2)when secant. It works by projectingOonto the line, so it is exact rather than sampled.tiep-tuyen-tai-diem(ctx, O, r, M)draws the tangent throughMperpendicular to the radiusOM(the direction is taken from the actualOM, soMneed not sit precisely on the circle).daiis the half-length of the segment (auto =1.4·r, in math coordinates).dung-diem(A, B, goc, r)returns the pointMsuch that rayAMis rayABrotated aboutAby the signed anglegoc(degrees, positive counter-clockwise) withAM = r.nhan-goc(ctx, ..items)labels several points at once, choosing each label's side by a signed angle instead of a named direction. Each item is a tuple(P, text, angle), optionally extended with a radius and/or colour in either order.dut:forduong-tron-ngoai-tiepandduong-tron-noi-tiep— draws the circle with a dashed stroke. Defaults tofalse, so existing figures are unchanged.an/hien-khoang— exit animations for slides. The mirror image oflo:#an(n)[…]shows content from the start and hides it from stepnonward (collapsing the following material by default,giu-cho: trueto keep its space).#hien-khoang(tu, den)[…]shows content only during steps[tu, den). Pairing#an(n)[old] #lo(n)[new]replaces an element in place on the same step. In the printed (non-beamer) profile everything is shown, as withlo/chi.fig-pos: "center"— a figure centred between the prompt and the options. The four existing placements are"right"/"left"(figure in a side column with text wrapping),"top"(above the whole prompt) and"bottom"(below all four options). None of these suit a wide figure such as a variation table, a statistical chart or a large graph."center"puts the figure on its own centred line, between the prompt and the options / sub-questions. Available for#tn,#ds,#tln(fig-pos:), for figures attached to a solution (fig-giai-pos:) and for#voi-hinh(..., vi-tri: "center"). An invalidfig-posnow raises an error listing the valid values instead of silently falling back to"right".fig-pos:/fig-width:on all eight question types.#vd,#tl,#hd,#lt,#vdtt(and#cau-tl/#cau-hd/#cau-lt/#cau-vdtt) previously accepted onlyfig-giai-pos:for a figure attached to the solution; a figure on the prompt was always forced into the right column, with no parameter to change it, even though the manual described it as "every question type". These five now take the samefig:/fig-pos:/fig-width:as#tn/#ds/#tln. Omitting them keeps the default"right", so existing questions keep their layout.kham-pha/trai-nghiem/thao-luan. The "Khám phá."/"Trải nghiệm."/"Thảo luận." activities of the Vietnamese textbooks are one-off, not numbered — unlikehd/lt/vdtt— so they carry no counter. Each has its own colour, plus an inline builder (cau-kham-pha/cau-trai-nghiem/cau-thao-luan) for use as a step inside a#slide(the top-level form creates its own slide and so cannot be nested).Changed
bptlabels rotate along the line.bpt(...)gainsnghieng-ten: true(the default), which rotates the label to follow the line and hugs it along the normal;huong-tenthen only selects the side with"above"/"below", andcach-ten: 3pttunes the gap.nghieng-ten: falserestores the previous horizontal label, which still accepts any direction. Eachbptalso takes its owngoc-gach:/buoc-gach:instead of sharing the values frommien-nghiem.dat-lai-causplit per category.dat-lai-cau()now resets only the "Câu" counters (tn/ds/tln/tl); the newdat-lai-cau-vd/-hd/-lt/-vdtteach reset a single counter, anddat-lai-cau-tat-ca()keeps the old behaviour of resetting all five groups. Exam files calling#dat-lai-cau()are unaffected, as they only use the "Câu" counters.so-do-cayprobability labels sit below descending branches. An edge's probability label was always placed above the line; on a branch going down to a lower child this pushed the label into the fork. Labels on descending branches now go below their edge (ascending and level branches are unchanged), mirroring the top branches for a cleaner tree.Fixed
ctxno longer panics insidemeasure. Drawing helpers may be called without an explicitctx— the_voi-ctxwrapper picks up the current#hinhframe from astatestack. But content built insidemeasure(...)is never laid out, so that state reads back empty and the wrapper used topanic. This aborted the whole compile in the beamer profile (its automatic slide-breaking measures a trial slide) and incot: autofor multiple-choice options containing a figure. An empty stack inside a measure is now skipped silently — the measured size is unchanged, since#hinhis a fixed-size box whose strokes are allplaced — while a helper genuinely called outside any#hinhleaves a small red marker instead of aborting. Printed output is unchanged.