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

Investigate Inconsistent Table (Cursor) Highlighting in LaTeX Backend #663

Open
Mornix opened this issue Jun 14, 2018 · 6 comments
Open

Comments

@Mornix
Copy link
Collaborator

Mornix commented Jun 14, 2018

Continuation of #51 from CaseStudies but brings the investigation to the generated docs as they exhibit the issues as well, and aren't implemented in the same way as the manual versions.

@Mornix Mornix self-assigned this Jun 14, 2018
@JacquesCarette JacquesCarette mentioned this issue May 11, 2020
2 tasks
@peter-michalski
Copy link
Collaborator

I am looking at this issue now and I could not reproduce the problem after running (compiling the PDF) the GamePhysics_SRS.tex Drasil generated document. Once compiled, if I highlight a row of a table in the PDF only the desired row was highlighted. As I understood the issue, highlighted rows / text would cause additional text from the column to be highlighted. Please confirm.

Caveat: In order to compile the PDF with my compiler I had to insert "% !TeX program = lualatex" at the top of the document. Without this line I got an error:
"Fatal fontspec error: "cannot-use-pdftex" The fontspec package requires either XeTeX or LuaTeX. You must change your typesetting engine to, e.g., "xelatex" or "lualatex"instead of "latex" or "pdflatex". For immediate help type H ."
I don't think this is related, but I did need to add this line into the generated document.

@smiths
Copy link
Collaborator

smiths commented Jul 24, 2020

@peter-michalski, I have looked into this a little bit. The Makefile that is generated for Drasil uses lualatex. I was able to compile the generated tex file (for game physics) in the stable folder. (I have lualatex installed on my machine.) When I open the file with Preview (on my Mac) and select text within the tables the odd behaviour originally observed by @Mornix is reproduced. Interestingly, when I open the pdf file with google chrome, the rows are selected the way you would expect. That is, with the google chrome pdf viewer, the problem is not present.

I'm not sure why, but we have decided with Drasil to use lualatex for our generated files. You should use lualatex, rather than using pdflatex.

As far as the problem with selecting text in tables, I'm prepared to say that this is a product of the lualatex compiler. I don't think this is caused by our generated LaTeX code. @JacquesCarette, how much effort do you think we should spend on this inconsistency with some pdf viewers and selecting text in tables? I'd be fine if we didn't solve this issue.

@JacquesCarette
Copy link
Owner

We decided to use lualatex because it deals with unicode best of all of them.

@smiths I really have no idea what is involved regarding selectability, so I can't really estimate the effort needed to fix it. It doesn't feel like a high-priority issue.

@smiths
Copy link
Collaborator

smiths commented Jul 24, 2020

@JacquesCarette, thanks for the info. I knew there was a reason for lualatex, I just didn't remember what the reason was. :-) I'm going to mark this issue as low priority.

@balacij
Copy link
Collaborator

balacij commented Jul 21, 2024

I think that copy-pasting and general highlighting from PDFs is pretty broken in general, at least in my experience. If tables are important to keep exportable, perhaps we can go with a .csv-based approach to building them instead of directly rendering table contents inside the TeX? \usepackage{csvsimple} would be helpful for this. Alternatively, we can try to use another library for building better scientific tables (\usepackage{pgfplotstable}).

@JacquesCarette
Copy link
Owner

I agree that selectability from PDF output is not really important. If some data displayed in tables should also be available, I think a .csv would be a good idea. (We should look at embedded meta-data in the PDF - is that what csvsimple allows?)

And yes, upgrading our tooling (such as pgfplotstable) instead of doing things in a rather 'raw' form is also a good idea.

I'd say we should spin off some actionable issues from this one, and then close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants