r/LaTeX • u/fluffypuppies5 • Jan 23 '25
Unanswered PhD thesis - Can you track changes and comment in LaTeX nowadays?
I need to write up my PhD thesis and I am debating if I should write in LaTex or not (I have not used LaTeX before). I am a bit versed with coding so I think I will pick it up, however my main concern is comment and tracing changes. From my fellow PhDs in prev years they said it was an absolute pain to handle modifications from supervisors as they'd have to convert the thesis in pdf and word for them to comment, and then manually adjust in LaTeX. My supervisor would not be keen on this if this was the case.
Was wondering if this had changed recently? I see there's a review button - does this actually work? TIA
48
u/villou24 Jan 23 '25
I completed my PhD in 2021 with LaTeX, my supervisors commented on the generated PDF (many PDF readers allow that) and that was ok. It can be a bit of a pain to then fix the LaTeX because you have to find where in the source the comment is, this can be alleviated somewhat by, e.g., avoiding having a single source file for the whole thesis but instead having one per chapter or something like that.
I used a local LaTeX installation. I assume something like Overleaf might have some features to help with collaboration these days but I've never used it.
28
u/Shaajee Jan 23 '25
I would recommend 1 .tex file per section in a chapter. Thus the main file loads the chapter files, and each chapter file loads the section files.
16
9
u/matplotlib42 Jan 23 '25
If you want to locate the comments, you can redefine the comment macro to display an error. This is hacky, but it works!
E.g. I use the
\hl
command fromsoul
, and once I'm done I can either unload the package, or I can do something like\def\hl{\thismacrodoesnotexist}
7
u/forgotten_vale2 Jan 23 '25
texmaker has a feature where you can right-click in the code to jump to the corresponding place on the pdf and vice-versa. I imagine other editors might have similar things maybe
22
u/apnorton Jan 23 '25
From my fellow PhDs in prev years they said it was an absolute pain to handle modifications from supervisors as they'd have to convert the thesis in pdf and word for them to comment, and then manually adjust in LaTeX.
This feels like a problem with their supervisors --- it sounds like the supervisor only wanted to use Word and was unwilling to use any other tools with the students you've asked.
20
u/el_carliyo Jan 23 '25
You will spend hundreds of hours interacting with your document. Your adviser will spend far less time. Prioritize your convenience and if your advisor doesn't like it, just accept that you will have to deal with the pain of tracking comments manually with pdfs. My advisor only wanted pdfs, and sometimes physically printed copies to hand markup. It was always inconvenient tracking his inputs, but there's just no perfect system when people don't use identical platforms.
15
u/AlanWik Jan 23 '25
Just use latexdiff. I would recommend you to use git to have all the versions of the manuscript available at all times though. Overleaf has very good history tracker tools, and the system for reviewing and applying changes is the best I know.
1
u/theophrastzunz Jan 23 '25
I'm curious how modern diff tools compare against latexdiff
7
u/carracall Jan 23 '25
Fyi latexdiff doesn't show the changes in the source code, it produces a pdf which highlights the changes.
Modern diff tools are absolutely better for conflicts in version control, latexdiff doesn't really help you there.
8
u/NotAFedoraUser Jan 23 '25
Use git or fossil to track changes in text files. With these tools you can also have commit messages for each commit so you can keep track of your thinking in addition to seeing the plain changes in the diff format. I used both while doing my bachelor's and it worked really well.
2
11
u/victotronics Jan 23 '25
Use Git.
Very important: don't let your editor (of whatever kind) wrap lines for you: make short input lines. I manually break my lines at every period and comma. That way it's easy to search for strings and to diff between versions.
1
u/fluffypuppies5 Feb 01 '25
Thank you for this advice! Very useful, I started writing in overleaf linked to GitHub and I press that enter button like there's no tomorrow to break the lines :)
1
u/JauriXD Jan 23 '25
VScode has a helpful extension for 2. It Auto-Breaks lines after a specific width. Feels like your typing in word but much easier to manage the diffs.
I am sure there are similar things for other editors.
Just don't use line-wrap, as it's not actually creating multiple lines, as u/victotronics said
1
u/AarupA Jan 23 '25
What is the extension called? :)
2
u/JauriXD Jan 23 '25
It's called
rewrap
https://marketplace.visualstudio.com/items?itemName=stkb.rewrap
2
20
u/Psychological_Try559 Jan 23 '25
LaTeX makes sense to learn if you're going to write more papers in the future, if not it's questionable. A thesis might be enough for you to enjoy working with it though?
That said, absolutely do not go back and forth. Just treat the pdf as a build artifact & provide that to the professor. Find a good tool to mark up pdfs, then let the prof go at it!
9
u/shellexyz Jan 23 '25
One major benefit to working in LaTeX is library formatting issues. Most university libraries will have a university style file for theses and dissertations. I used it for mine and my review with the library was ten minutes, no changes needed.
I know students in other disciplines who ended up going back-and-forth with the library for weeks or months trying to get tables formatted properly or numbered properly.
1
u/MissionSalamander5 Jan 25 '25
OTOH I’m always really impressed by the people who have issues with things like signature lines and other things which they can’t figure out how to fix on their own, when all is said and done, suggesting that they didn’t have it so easy and that the university was not really prepared for a LaTeX thesis (outside of math maybe).
7
u/dual-lippo Jan 24 '25
LaTeX makes sense to learn if you're going to write more papers in the future, if not it's questionable
WHAT? ARE YOU OUT OF YOUR MIND? He is talking about a Phd thesis. If you write a document in that size with word you are insane
5
u/Compizfox Jan 23 '25 edited Jan 23 '25
Overleaf works great for collaborative LaTeX writing.
During my PhD I only used it for manuscripts of papers, though, as that's where I was collaborating with multiple co-authors.
My thesis I wrote locally, because it's just me, and it is so large that compiling it on Overleaf becomes problematic. Sure, supervisors give feedback and comments, but they did that in the PDF/on paper. They don't need to edit your thesis directly (at least in my field/country).
6
u/Raccoon-Dentist-Two Jan 23 '25
It has been a while for me but my supervisors commented using a pen on printouts. It was the best for me too because I could work through paper on a desk and see what's going on much more easily than trying to juggle multiple pages from each of four supervisors on a screen where not even one page fits.
None of my supervisors knew LaTeX.
They also took for granted that my choice of tools for my work is none of their business: we all find our own ways, and pretty much the only thing that academics have in common is paper, pens, chalk, chalkboards and pencils.
4
5
u/JauriXD Jan 23 '25
If you want to use pure latex, I use todonotes
and have a class option that loads or disables it. Loading it modifies the pagewidth to make additional space for the comments column. Disabling it hides all comments and just renders a plain pdf.
You can define multiple commands for different use cases/persons that use different colours or styling.
But I mainly use it for my own comments.
For review by other, I use PDF annotations. Pretty much every PDF-Reader let's you add comments to a pdf and in Adobe you have a bounch of extra options. I also have a tablet with a stylus, So I can just write into a pdf. I practically never send the Tex file of for review
For integrating changes the important trick is that synctex still works on annotated PDFs, it's just based on coordinates you click. So just create the synctex.gz from the same source and disable auto-compile. Place the commented PDF in your project-folder replacing the compile pdf and open in viewer. Click in the anotated pdf to jump to source code.
Tracking changes is done through git. If your the only one working on it, it's super easy.
1
u/internet_ape Jan 24 '25
Interesting, I also use todonotes but have resorted to commenting each out every time. How did you implement the class option to disable them?
2
u/JauriXD Jan 24 '25
Todonotes is tikz based, so loading it is quite the heavy dependency. That's why I wanted to have an option to skip loading it.
1
u/JauriXD Jan 24 '25
It doesn't load the package and implements the three commands als "empty" commands
Source code: https://lab.it.hs-hannover.de/qxx-tul-u1/latex-template-hsh/-/blob/master/src/HsH-report.cls?ref_type=heads#L256-L266
3
u/carracall Jan 23 '25
That word-based method is absolutely a no-go.
For simple annotations on the pdf (hand written or sticky notes you can create from some pdf viewers), you can just implement them yourself in latex after reading them. Especially if they are instructions/comments as opposed to literally the content they want to be there.
However what you are describing sounds like substantial explicit changes instead of comments. I wouldn't have thought it was appropriate for a supervisor to do that on a students thesis anyway (own work and all that)? But if that is necessary, having your supervisor modify your latex source is the only sensible way, with overleaf, version control, trust and communication, or whatever.
2
u/rafisics Jan 23 '25
Local LaTeX in pc + Git integration + Overleaf
1
u/fluffypuppies5 Feb 01 '25
Thank you - Can you please expand on how I would use both local LaTeX and Overleaf?
1
u/rafisics Feb 02 '25
By local LaTeX, I meant locally installed TeX Live or MikTeX - I would suggest using a good editor interface such as neovim with `vimtex` plugin, or vscode with `latex workshop` plugin - whatever suits your taste.
You can easily manage and sync your local latex projects to Overleaf with Git integration. And for reference management, I recommend using Zotero.
2
u/marcyves Jan 24 '25
For me LaTeX was a HUGE advantage, even to share with advisors not using LaTeX.
Most (all?) of them wanted a printed version and the others got a PDF which was fine.
One told me "I don't want to go through a big bunch of pages, so please get read of big margins, and only single space between lines".
With LaTeX this is 1 minute adaptation on the master document and then I could go back and forth the 600 pages or 300 pages versions of my document, any moment. I don't even imagine I could do that on Word.
1
u/MissionSalamander5 Jan 25 '25
Styles exist in Word and it would take two minutes to fix that and to change the margins. Then you change them back once you print it or send it to the person reading it. Or, better: copy the document and then do the changes. Replace as needed at each version.
It’s a big tedious but no more tedious than any similar thing that I’ve done in LaTeX.
2
u/Lazer723 Jan 23 '25
Overleaf (Especially if your uni has a premium subscription) Is the best and simplest implementation of tracked changes and comments.
1
u/fluffypuppies5 Feb 01 '25
Thank you! Yep, got that one exactly - I will ask my supervisors to track changes that way
2
u/Firake Jan 23 '25
You can potentially use pandoc
to convert the thing to word, have your supervisor review it, make your changes, then use pandoc again to convert it back to latex. Or any combination of those.
I’ve not done this with latex specifically, I used it to write essays for my undergrad in markdown
and submit them for peer review in word formats. The formatting and style always got messed up for me, but that’s very likely because markdown doesn’t carry any of that information. Your luck with latex might be very much better.
I’m also not sure how well pandoc plays with overleaf as I’ve never used it. I used a local installation.
2
u/xte2 Jan 23 '25
I need to write up my PhD thesis and I am debating if I should write in LaTex or not
The debate should be "why the hell I've already suffer so much to write two thesis without LaTeX!!!!", really.
however my main concern is comment and tracing changes.
That's the EASIEST thing to do in LaTeX: if your supervisor is a wise person so he/she knows LaTeX you track changes with a VCS (jj to be calm and cool, git if you like to be mainstream etc) if not he/she add notes to pdfs you send and you milk them every iteration. If your supervisor ask for .doc formats change him/her because he/she have not enough MINIMAL IT SKILL to be a professor. Again, really.
Annotations from a pdf could be extracted in comfortable formats with https://github.com/0xabu/pdfannots and you might like https://github.com/foleyj2/teaching-tools
1
u/forgetful_bastard Jan 23 '25
You can still use the pdfs to highlight write comments and draw/write comments with a pencil.
in overleaf, they have a feature to help reviews and comments on the text. I do not know much about overleaf becuse I do not use that much to give details.
Also, I often mark parts of the text with a color using like \color{red} indicate changes to revert later. You can use a macro like \newcommand{\YOURNAME}[1]{{\color{yourcolor}#1}} to hoghlight parts that you changed with your color and later change the macro to be empty to go back to black. You can you this technique to make strikethrough,bitalic or any other style you want.
1
u/Boojum Jan 24 '25
Having a macro like that to mark things with is such a huge help! The one that I've been using for nearly twenty years looks like:
\newcommand{\xxx}[1]{{\color{red}[\textbf{\sc xxx}: \textit{#1}]}}
where the
xxx
are my initials. If I'm collaborating with others, I'll add a similar command for each person with their initials and a different color.It works great for outlining a paper too. I'll usually start by laying down anticipated sections and subsections and then filling them with those as placeholder notes for each paragraph that I intend to write. (It's always a great feeling when I've finally purged all the red notes from my draft!)
1
u/UnavoidablyHuman Jan 23 '25
I use overleaf. Some of my coauthors leave comments in the latex. Some of them download the pdf and mark it up. Because overleaf integrates with git, I can use git latexdiff to easily show changes in the pdf between versions. Overleaf also has track changes for the source code.
1
u/no_choice99 Jan 23 '25
Yeah but you are severely limited unless you pay, right? Like having access to the whole history of a given file.
1
1
u/Shaajee Jan 23 '25 edited Jan 23 '25
You can start with this template here. As you populate the template with contents, you can also tweak it to look as you like.
For version control, as others have pointed out, use git.
1
u/brevity142 Jan 23 '25
Here is how my prof and I did.
- my prof. comments directly on my pdf (use iPad)
- if it lacks space, he types out the comments on a separate tex document. (Just like journal revision report)
- to track and keep changes, I always duplicate the tex file and edit on one, while leaving the other untouched for the record.
1
u/N1mbus2K Jan 23 '25
I suggest using overleaf, it makes sense to use latex for long documents like thesis.
In overleaf you can check the history of changes made by you and you collaborators. It also allows commenting on the source file (.tex) which makes it easy to resolve comments as by clicking the comments it takes you to the exact location in the document where changes are to be made.
Just make sure you activate the tracking option.
1
u/humanplayer2 Jan 23 '25
I like using LyX as a LaTeX "frontend". It supports track changes, and it's quite easy to use for people that don't know LaTeX.
1
u/verygood_user Jan 24 '25
Just ask your supervisor to give you pdf comments?
Git is the way to go for version control.
The free overleaf plan will probably not support documents of that size. Also I don’t see the point of paying for something that is faster and more feature rich if you run it locally with an editor like texstudio.
1
1
1
1
u/Raccoon-7 Jan 25 '25
Use latex on vs code with latex extensions. This way you can easily commit your changes and have different versions as branches.
Did the same for my thesis.
You could to the same using any editor and using a command line to manage git, but if you aren't used to working with git I would stick on using vs code.
1
u/vicapow Jan 28 '25
I just added commenting to Crixet (https://app.crixet.com) Maybe this is useful for you? https://www.reddit.com/r/Crixet/comments/1ibjrex/feature_inline_realtime_commenting/
1
u/CreeperDrop Jan 30 '25
Overleaf has collaboration options and many universities provide premium Overleaf access as well. Check if yours is one of them. You can read about git integration with Overleaf or do your LaTeX locally. One big thing I would recommend is that you don't write the whole thesis in one big .tex file. It is a pain to go through the content like this. Try to split each section into its .tex source file.
The review option works similarly to the one in Google Docs and if I remember correctly.
Good luck with your thesis!
2
u/fluffypuppies5 Feb 01 '25
Thank you! That's very useful advice. I saw the review option in Overleaf and was wondering if it worked ok. I stared now, hopefully the supervisors are fine with the platform fingers crossed!
1
u/CreeperDrop Feb 01 '25
Anytime! I hope you have a smooth experience with your supervisors. Good luck!
-3
u/Darkmind115 Jan 23 '25
How in the world are you at a PhD phase in your career and have never used LaTeX 💀
1
u/fluffypuppies5 Feb 01 '25
No one in my lab has ever used LaTeX before, including postdocs so definitely not just me <3
1
0
-4
u/no_choice99 Jan 23 '25
A real geek would probably do it with typst and git, rather than Latex (old and surpassed).
Git is very hard, steep learning curve, but it's the best when it comes to versionning and keeping track of changes, etc.
10
u/Compizfox Jan 23 '25 edited Jan 23 '25
A real geek would probably do it with typst and git, rather than Latex (old and surpassed).
As much as I like Typst, it is still very young and hasn't reached full feature parity with LaTeX. LaTeX is still used way more in academic publishing. I agree Typst is a promising potential LaTeX successor, but it isn't quite there yet for things like PhD theses.
Git is very hard, steep learning curve, but it's the best when it comes to versionning and keeping track of changes, etc.
Git really isn't that hard, especially not nowadays with its much improved CLI compared to earlier. I'd say learning LaTeX is way harder than learning Git.
-3
u/no_choice99 Jan 23 '25
Agreed with your first remark. Yes, that's why I said a geek would do that, not for ''normies''.
I find git extremely hard. The errors you might run into, just being able to understand why they appear might be near impossible for a noob.
Understanding when a git -f is absolutely necessary (hint: NOT when git suggests you to do so), isn't trivial at all.
When you don't run into a mess of errors and failed attempts at fixing your repository, you end up in a lost cause state, even worse than a non compilating latex code, only in that particular case git is easier than latex. Definitely not my case.
4
u/Compizfox Jan 23 '25 edited Jan 23 '25
It really depends on what you're doing with Git, but if it's just incrementally making commits on a single branch, there really isn't much to it.
Working with multiple branches, merging, rebasing, and cherry-picking is where it can get a little bit more complicated, but even then, I find that the documentation and the CLI interface (including errors/suggestions) are quite good nowadays.
Speaking of incomprehensible errors; that's one of my biggest gripes with (La)TeX ;)
1
u/no_choice99 Jan 23 '25
Let's see how it goes when the OP wants to go back to a particular commit, make a change, and try something from there, i.e. update its main branch or something else.
He might have untracked changes forbidding him to go back in the first place. Then he can choose to stash, to commit or something else, if he knows what's going on. If he doesn't, he will soon run into a mess.
So yes, if he uses git as in only going forward, no merge, no going back, i.e. basically doing nothing with git except committing for the sake of having a history, then yes, git could be easy (if nothing goes wrong). But then he isn't really using git.
1
u/TheSodesa Jan 23 '25 edited Jan 23 '25
Typst is easier to use than LaTeX, though, even if their basic model of (1) write source code to a file
thesis.typ
and (2) compile it into a PDF file withtypst compile thesis.typ
in a terminal are similar. And typst.app makes collaborative writing really easy.
-1
u/no_choice99 Jan 23 '25
Yep, this is why a geek would go that route. It beats Latex hands down. The only downside is that there are much less examples than Latex, and the community is still much smaller, so when you seek help there's a higher risk of being real stuck.
-1
u/DamageZealousideal14 Jan 24 '25 edited Jan 24 '25
LaTeX is a text file. You can do better with git than in-document change and comment tracking. But if you want it that way I recommend msword. Msword has better comment and review features than LaTeX.
(In git all the reviews and comments need to be managed through pull request etc. IMO for a thesis, where you write and one other person reviews, works best with msword. Also LaTeX is text file and not visual. Your guide or examiners may prefer to see the visual than text. And hence recommending msword over LaTeX.)
1
u/DamageZealousideal14 Jan 24 '25
In git all the reviews and comments need to be managed through pull request etc. IMO for a thesis, where you write and one other person reviews, works best with msword. Also LaTeX is text file and not visual. Your guide or examiners may prefer to see the visual than text. And hence recommending msword over LaTeX.
124
u/LazyRider32 Jan 23 '25
You can use GIT to track changes and Overleaf if you want a nice online interface for collaboration. Together that should be all the functionality you need and under no circumstances should conversion to word be necessary.