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

\lec does not work well #406

Open
kohlhase opened this issue Oct 3, 2023 · 5 comments
Open

\lec does not work well #406

kohlhase opened this issue Oct 3, 2023 · 5 comments
Assignees

Comments

@kohlhase
Copy link
Contributor

kohlhase commented Oct 3, 2023

I am using the \lec (line end comment) macro all the time in my slides. It is defined by

\ExplSyntaxOn
\def\__omtext_lec#1{\textcolor{green}{#1}}
\cs_new_protected:Npn \lec #1 {
  \strut\hfil\strut\null\hfill(\__omtext_lec{#1})
}
\cs_new_protected:Npn \nlex #1 {
  \textcolor{green}{{\sl #1}}  
}

\cs_new_protected:Npn \nlcex #1 {
  *\;\textcolor{green}{{\sl #1}}  
}
\ExplSyntaxOff

in MiKoMH/meta-inf/lib/mikoconvenience.sty.

But in the slides we do not see the line end behavior we get
Screenshot 2023-10-03 at 11 22 09
from

... in class.\lec{you need practice}

I understand that \hfill and friends are problematic in non-paginated documents, ... But all of the \lec are in slides which are fixed-width.
\lec is not even polite enough to leave a blank, ...
I think we need to fix this, possibly by re-implementing \lec in TeX.

@Jazzpirate
Copy link
Contributor

"But all of the \lec are in slides which are fixed-width." <- they are not in HTML (responsiveness and all that) :) And even if they were, the offset to the rest of the text depends on the length of the corresponding line, which is dependent on the line-breaking mechanism of the browser... so I don't see any way to get \lec to actually be right-aligned.

We can of course reimplement it, but I don't have a good idea of what it should do

@kohlhase
Copy link
Contributor Author

kohlhase commented Oct 3, 2023

well, can't it just be a <span style="float:right">....</span>? That would solve the problem.

@Jazzpirate
Copy link
Contributor

I'll have to try, but I'm almost sure that "float" does not work with display:inline... (if it does, that would solve a few of my other problems with \hfill et al as well, so I'd be very surprised if I didn't try everything in that direction...)

@kohlhase
Copy link
Contributor Author

kohlhase commented Oct 4, 2023

I think that if float: is given, the display:inline is change to display:block automatically or so.

@kohlhase
Copy link
Contributor Author

kohlhase commented Oct 4, 2023

At breakfast we discussed that maybe the best way forward is to reconceptualize \lec into one short macro (\lec) and a long one, the first on is for the case where we know that there is enough space (in the PDF) and the second one takes a dimension argument and just makes a minipage of that width of the contents.
That might work better with the float:right in the html

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

No branches or pull requests

2 participants