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

align rules to baseline #2061

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Conversation

teepeemm
Copy link
Contributor

This aligns rules to the baseline, resolving #1995. It also provides default dimensions (otherwise, vrules end up with a width of text-indent). Some other notes:

  • hrule should be in vertical mode but isn't. (I think that's the correct terminology: TeX put the hrule on its own line and subsequent text on another line; LaTeXML put everything on the same line.)
  • I don't appear to have html.sty, so I'm not sure what html.sty.ltxml is trying to emulate.
  • TeX.pool.ltxml claims that hrule and vrule can appear as rules within an alignment/table. I was unable to see this behavior in LaTeXML: all tabular rules were rendered via a ltx:td/@Ltx:border attribute, not a ltx:rule element. Did I overlook some construction that would have resulted in ltx:rule?

The tex code I was using to test this out:

\documentclass{article}
\usepackage[lined]{algorithm2e}
\usepackage{xcolor}
\usepackage{latexml}
\iflatexml\usepackage{html}\fi
\begin{document}
A\rule{1cm}{.4pt}A
B\vrule height 1cm\relax B

C\hrule width 5cm\relax C

D\boxframe{5cm}{.1pt}{1cm}D

\begin{algorithm}[H]
  \If{understand}{go to next section\;}
\end{algorithm}

\iflatexml
E\htmlrule E
F\htmlrule*F
G\HTMLrule G
H\HTMLrule*H
\fi

\end{document}

Align rules to baseline.  Also provide default height and width to rules.
@brucemiller
Copy link
Owner

Works a charm; Thanks!

BTW: Yes, the \hrule & '\vrule` in tables are handled specially (and are complicated); basically they disappear into attributes on the table cells, eventually ending up as specific CSS classes.

@brucemiller brucemiller merged commit dbef02e into brucemiller:master Jul 21, 2023
@teepeemm teepeemm deleted the baseline-rule branch July 21, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants