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

Remove eqN #1778

Open
samm82 opened this issue Jul 31, 2019 · 12 comments
Open

Remove eqN #1778

samm82 opened this issue Jul 31, 2019 · 12 comments
Labels
artifacts easy At quick glance, it should be 'easy,' but you never know what'll happen! needs-design

Comments

@samm82
Copy link
Collaborator

samm82 commented Jul 31, 2019

eqN is a big hack and should be replaced by an actual reference to the equation block. This means that the equation blocks must be LabelledContent. This should be done by using eqUnR and/or automatically creating a reference for an equation in another helper function.

@muhammadaliog3

This comment has been minimized.

@muhammadaliog3
Copy link
Collaborator

I have 2 quick questions for @smiths

I was fixing the equation labels for this issue, so things like "Equation (3)". I encountered 2 problems.

In the factor of safety derivation for the SSP example, what is equation 4 and what is equation 5? Right now I am assuming that equation 4 is the 4th equation listed in the derivation, and likewise the equation 5 is the 5th equation.

Secondly, while the pdf version of the generated SRS in my branch matches stable

image

But the tex differs. The reference in the stable SRS is Equation (1). The reference in the generated SRS is \hyperref[(1)]{Equation (1)}.

In theory the generated SRS should not match stable, that is the reference to equation 1 should be clickable and be colored red.
So my question is what is needed in latex other than an href to generate a proper clickable reference?

@JacquesCarette

This comment has been minimized.

@muhammadaliog3

This comment has been minimized.

@JacquesCarette

This comment has been minimized.

@muhammadaliog3

This comment has been minimized.

@JacquesCarette

This comment has been minimized.

@smiths
Copy link
Collaborator

smiths commented Jul 24, 2020

I'm joining in this discussion late, but @muhammadaliog3, in answer to your question, (#1778 (comment)), in LaTeX references to equations are not done with href but with a \label, \ref paper. The label is given with the equation and then the the ref will find the equation number. This requires two compilation passes. The equations are also usually automatically numbered in LaTeX.

I'm glad you noticed this issue @muhammadaliog3 because the LaTeX for the equations is not proper LaTeX. It could be that, since we generate the documentation, we are also keeping track of the equation numbers, but that won't automatically give us the hyperlinks.

@JacquesCarette

This comment has been minimized.

@muhammadaliog3
Copy link
Collaborator

@smiths carrying on from could you give a quick example here about how to create a equation reference, in "not proper latex"? It can be really simple, like F=ma.

@muhammadaliog3
Copy link
Collaborator

With the end of summer approaching, I have decided to provide a summary of the comments above that have now been marked as resolved, if you wish you may unresolve them, but I have provided a summary of the issue in this comment.

Essentially in this issue we want to reference equations. But equations are Expr's, these cannot be referenced in drasil.

Our first approach was to make them labelled contents, however contents are probably not the appropiate data type becasue these are used mainly for printing, not knowledge storage/capture.

In other words we would change derivations to store the appropiate types, roughly like the following

data DerivEqn = DerivEqn Expr | DerivEqn ReferableExpr
data DerivInfo = DerivSentBlock [Sentence] | DerivEqnBlock [DerivEqn]
data Derivation = Derivation Sentence [DerivInfo]

@JacquesCarette ultimately decided that the datatype for ReferableExpr to be

"a wrapper, potentially thin, around Expr that is more focused than Contents that is referable

A referable expression really ought to have a name (aka a UID). One associates a UID to a chunk.

So a referable expression should be somewhat akin to a QDefinition, but without the external name (i.e. just the defining expression, without a new external name to assign it to); there's probably something within the hierarchy of chunks that fits that already? That definitely needs to be thoroughly investigated first. "

Eventually we reached:

"
What's needed is to find a Chunk "above" ConceptInstance that does this. So, if need be, something beside QDefinition that uses ConceptInstance instead of ConceptChunk.
"
As you can see we are still not clear what the chunk is going to be.

Secondly the problem we encountered was how do we reference equations in latex code, as the "LaTeX for the equations is not proper LaTeX.". This means that when a reference to equations is made, drasil needs to generate the appropiate label (which will most likely be different then regular referencing). Unfortunately, we have not yet decided what referencing label we are going to use \hyperref, \equation, or some other means such as latex internal numbering of equations. Once it is decided, then changing the generated label is actually an easy, if I remember correctly it was fairly low level where the labels are generated, drasil-printers/Language/Drasil/TeX/Print.hs and drasil-printers/Language/Drasil/TeX/Helpers.hs.

@smiths
Copy link
Collaborator

smiths commented Aug 5, 2020

@muhammadaliog3, with respect to your question above (#1778 (comment)), the way that I do equation referencing in LaTeX is to use a label/ref paper. The equation is given a label, like: \label{eqname} and when the number if needed, it is referenced via \ref{eqname}. A summary of this is given here:

https://www.overleaf.com/learn/latex/Cross%20referencing%20sections,%20equations%20and%20floats#Referencing_equations.2C_figures_and_tables

@balacij balacij added artifacts easy At quick glance, it should be 'easy,' but you never know what'll happen! needs-design labels Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifacts easy At quick glance, it should be 'easy,' but you never know what'll happen! needs-design
Projects
None yet
Development

No branches or pull requests

6 participants