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

Work-around for latexml bug for MyLicense.txt #3661

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

HansOlsson
Copy link
Collaborator

No description provided.

@HansOlsson
Copy link
Collaborator Author

Test of work-around for #3660

@HansOlsson HansOlsson changed the title Test Work-around for latexml bug for MyLicense.txt Mar 26, 2025
@HansOlsson HansOlsson requested a review from henrikt-ma March 26, 2025 19:20
@HansOlsson HansOlsson marked this pull request as ready for review March 26, 2025 19:20
@HansOlsson HansOlsson added the Generated HTML The generated HTML-code label Mar 26, 2025
@HansOlsson HansOlsson linked an issue Mar 27, 2025 that may be closed by this pull request
@@ -2277,7 +2277,7 @@ \subsection{Annotations for External Functions}\label{annotations-for-external-l
The preceding one is the default and need not be specified; but another location could be specified by using an URI name for the source directory, see \cref{external-resources}.
It is not specified how they are built.
\item
The {\lstinline!annotation(License="modelica:/ModelicaLibraryName/Resources/Licenses/MyLicense.txt")!}\annotationindex{License}, gives the license text file for the function.
The {\lstinline!annotation(License="modelica:/ModelicaLibraryName/Resources/Licenses/$\mathit{license.txt}$")!}\annotationindex{License}, gives the license text file for the function.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried a couple of variants, and this one gave the best results:

Suggested change
The {\lstinline!annotation(License="modelica:/ModelicaLibraryName/Resources/Licenses/$\mathit{license.txt}$")!}\annotationindex{License}, gives the license text file for the function.
The
\ifpdf
\lstinline!annotation(License="modelica:/ModelicaLibraryName/Resources/Licenses/MyLicense.txt")!%
\else
% TODO: Make sure this LaTeXML problem (that is, a % being generated before ".txt") has been reported,
% and add a link to the issue here.
\lstinline!annotation(License="$\text{modelica:/ModelicaLibraryName/Resources/Licenses/MyLicense.txt}$")!%
\fi\annotationindex{License},
gives the license text file for the function.

This is the corresponding fix for annotations.tex:

For a top-level class the
\ifpdf
\lstinline!annotation(License="modelica:/ModelicaLibraryName/Resources/Licenses/MyLicense.txt")!%
\else
% TODO: Make sure this LaTeXML problem (that is, a % being generated before ".txt") has been reported,
% and add a link to the issue here.
\lstinline!annotation(License="$\text{modelica:/ModelicaLibraryName/Resources/Licenses/MyLicense.txt}$")!%
\fi\annotationindex{License},
gives a license text file for the class.

Copy link
Collaborator

@henrikt-ma henrikt-ma left a comment

Choose a reason for hiding this comment

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

Providing a better fix with no impact on PDF generation, and minimal – if any – impact on HTML generation.

@henrikt-ma
Copy link
Collaborator

I tried finding an issue for this in the LaTeXML tracker, but couldn't find one. Has anyone else been able to find the issue, or should I report it?

@HansOlsson
Copy link
Collaborator Author

I tried finding an issue for this in the LaTeXML tracker, but couldn't find one. Has anyone else been able to find the issue, or should I report it?

I haven't seen it reported either.

@HansOlsson HansOlsson requested a review from henrikt-ma April 2, 2025 09:21
@HansOlsson
Copy link
Collaborator Author

I have now updated to use ifpdf, but with comment separated and link to modelica-issue, so that we don't have to update it when reported and fixed for Latexml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Generated HTML The generated HTML-code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spurious percentage in HTML-text
2 participants