Skip to content
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

Support \hdashline #1407

Merged
merged 8 commits into from
Jun 7, 2018
Merged

Support \hdashline #1407

merged 8 commits into from
Jun 7, 2018

Conversation

ronkok
Copy link
Collaborator

@ronkok ronkok commented Jun 4, 2018

Support \hdashline from package arydshln. This PR acts as a complement to PR #1395.

Similarly to #1395, the dashed line is rendered as border-bottom-style: dashed;. That does not exactly match the dashsegment and dashgap lengths in arydshln, but it does render black lines with sharp edges.

Support `\hdashline` from package `arydshln`. This PR acts as a complement to PR #1395.

Similarly to #1395, the dashed line is rendered as `border-bottom-style: dashed;`. That does not exactly match the `dashsegment` and `dashgap` lengths in `arydshln`, but it does render black lines with sharp edges.
@codecov
Copy link

codecov bot commented Jun 4, 2018

Codecov Report

Merging #1407 into master will decrease coverage by 0.02%.
The diff coverage is 41.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1407      +/-   ##
==========================================
- Coverage    82.3%   82.28%   -0.03%     
==========================================
  Files          77       77              
  Lines        4324     4330       +6     
  Branches      750      752       +2     
==========================================
+ Hits         3559     3563       +4     
- Misses        663      665       +2     
  Partials      102      102
Impacted Files Coverage Δ
src/environments/array.js 45.71% <41.37%> (+0.52%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89e180c...f4a2602. Read the comment docs.

@kevinbarabash
Copy link
Member

@ronkok thanks for including \hline as well as \hdashline in the screenshot:
hdashline

@ronkok
Copy link
Collaborator Author

ronkok commented Jun 5, 2018

@kevinbarabash You're welcome. Since \hline and \hdashline are now in the array screenshot, maybe we could delete the \hline screenshot?

Copy link
Member

@edemaine edemaine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. I have one main comment about the representation.

I also wonder whether we should have a comment somewhere saying that the boolean stores whether it's dashed.

parser.consume();
n++;
hlineInfo.unshift(nxt === "\\hdashline");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this unshift instead of push? In particular, why is the order reversed?

Efficiency wise, it'd be better to push and then reverse e.g. while returning. Though I can't inagine anyone having more than a few consecutive \hlines.

if (n > 1) {
totalHeight += 0.25;
}
hlines.push({pos: totalHeight, isDashed: hlinesInGap.pop()});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, here you are processing in reversed order. I'd find it more intuitive to store them in order, then use a for loop or map here.

@ronkok
Copy link
Collaborator Author

ronkok commented Jun 6, 2018

somewhere saying that the boolean stores whether it's dashed.

That's on line 53 of array.js. I couldn't think of a more prominent place to put it.

I'm picking up rhe other comments in the upcoming commit.

Copy link
Member

@edemaine edemaine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing so quickly. Looks good!

@edemaine edemaine merged commit 93904c5 into KaTeX:master Jun 7, 2018
@ronkok ronkok deleted the hdashline branch June 7, 2018 02:13
edemaine added a commit to edemaine/KaTeX that referenced this pull request Jun 7, 2018
edemaine added a commit that referenced this pull request Jun 7, 2018
* \newcommand, \renewcommand, \providecommand

* Tests

* Add comment

* Add symbols to the set of already defined things

* Add implicitCommands, catch \hline outside array

* Add \relax

* Move isDefined to be a method of MacroExpander

* Namespace.has

* Reword error messages

* Add \hdashline given #1407
@ylemkimon ylemkimon mentioned this pull request Aug 18, 2018
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants