Prerequisites: Basic LaTeX and Git knowledge
Time to complete: 30-35 minutes
Difficulty: Intermediate to Advanced
What you’ll learn: Git workflows, cloud collaboration, change tracking, review processes, and team coordination
Time to complete: 30-35 minutes
Difficulty: Intermediate to Advanced
What you’ll learn: Git workflows, cloud collaboration, change tracking, review processes, and team coordination
Collaboration Overview
Collaboration Methods
Version Control
Git-based workflows for technical teams
Cloud Platforms
Real-time editing with LaTeX Cloud Studio
Change Tracking
Built-in LaTeX revision tools
Review Systems
Comments and annotations for feedback
Choosing the Right Approach
- Technical Teams
- Academic Teams
- Mixed Teams
Best for: Developers, researchers, technical writers
- Git/GitHub workflow
- Pull request reviews
- CI/CD automation
- Maximum control
Best for: Professors, students, researchers
- Cloud platforms
- Real-time collaboration
- Built-in commenting
- Easy onboarding
Best for: Cross-functional teams
- Hybrid approach
- Cloud editing + Git backup
- Multiple review channels
- Flexible workflows
Git-Based Collaboration
Repository Structure
# Initialize collaborative LaTeX project
git init latex-project
cd latex-project
# Create standard structure
mkdir -p {chapters,figures,styles,build}
touch .gitignore README.md CONTRIBUTING.md
# .gitignore for LaTeX
cat > .gitignore << 'EOF'
# LaTeX temporary files
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
# Bibliography
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
# Build artifacts
build/
*.pdf
!figures/*.pdf
!templates/*.pdf
# Editors
.vscode/
*.swp
*~
.DS_Store
# LaTeX editors
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
EOF
# Initial commit
git add .
git commit -m "Initial project structure"
# Collaborative LaTeX Project
## Project Structure
.
├── main.tex # Main document
├── chapters/ # Chapter files
│ ├── ch1-intro.tex
│ ├── ch2-methods.tex
│ └── ch3-results.tex
├── figures/ # Images and diagrams
├── styles/ # Custom styles
│ └── project.sty
├── references.bib # Bibliography
└── Makefile # Build automation
## Collaboration Guidelines
### Branch Strategy
- `main` - Stable, reviewed content
- `develop` - Integration branch
- `feature/*` - New content
- `fix/*` - Corrections
- `review/*` - Under review
### Commit Messages
type(scope): description
### Pull Request Process
1. Create feature branch
2. Make changes
3. Push and create PR
4. Request review
5. Address feedback
6. Merge when approved
## Building
```bash
make # Build PDF
make clean # Clean artifacts
make watch # Auto-rebuild
</CodeGroup>
### Branching Strategies
<CodeGroup>
```bash git-workflow.sh
# Feature branch workflow
git checkout -b feature/methodology-chapter
# Make changes to chapters/methodology.tex
git add chapters/methodology.tex
git commit -m "feat(methodology): Add data collection section"
git push -u origin feature/methodology-chapter
# Create pull request for review
gh pr create --title "Add methodology chapter" \
--body "This PR adds the complete methodology chapter including:
- Data collection procedures
- Analysis methods
- Validation approach
Closes #15"
# Reviewer checks out PR
git fetch origin
git checkout -b review/methodology origin/feature/methodology-chapter
make # Build and review PDF
# After approval
git checkout main
git merge --no-ff feature/methodology-chapter
git push origin main
# Multiple authors working simultaneously
# Author A: Introduction
git checkout -b feature/introduction
# Edit chapters/introduction.tex
git add chapters/introduction.tex
git commit -m "feat(intro): Add research background"
# Author B: Results
git checkout -b feature/results
# Edit chapters/results.tex
git add chapters/results.tex figures/results/*
git commit -m "feat(results): Add experimental data"
# Integration manager
git checkout develop
git merge feature/introduction
git merge feature/results
# Resolve any conflicts
make # Test build
git push origin develop
Merge Conflict Resolution
% Common conflict scenario
<<<<<<< HEAD
\section{Results}
Our experimental results show a 95\% accuracy rate.
=======
\section{Experimental Results}
The experiments demonstrate 94.8\% accuracy.
>>>>>>> feature/results
% Resolution approach
\section{Experimental Results}
Our experimental results show a 94.8\% accuracy rate.
% Best practices:
% 1. Communicate about sections
% 2. Use semantic line breaks
% 3. One sentence per line
% 4. Regular integration
% Bad: Hard to merge
\section{Introduction}
This research investigates machine learning applications in healthcare. We propose a novel approach that combines deep learning with traditional statistical methods. Our results show significant improvements.
% Good: Easy to merge
\section{Introduction}
This research investigates machine learning applications in healthcare.
We propose a novel approach that combines deep learning with traditional statistical methods.
Our results show significant improvements.
% Each sentence on its own line
% Easier diffs and merges
% Clear change history
Cloud Collaboration
LaTeX Cloud Studio Features
LaTeX Cloud Studio provides real-time collaboration features:
- Simultaneous editing
- Live preview updates
- Integrated chat
- Version history
- Comment threads
- Change suggestions
Real-time Collaboration Setup
% Project structure for cloud collaboration
% main.tex
\documentclass{article}
% Enable collaboration features
\usepackage{changes} % Track changes
\usepackage{todonotes} % Comments and todos
% Define authors
\definechangesauthor[name={Alice}, color=blue]{AA}
\definechangesauthor[name={Bob}, color=red]{BB}
\definechangesauthor[name={Carol}, color=green]{CC}
\begin{document}
\title{Collaborative Research Paper}
\author{Alice A. \and Bob B. \and Carol C.}
\maketitle
% Include sections maintained by different authors
\input{sections/introduction} % Alice
\input{sections/methodology} % Bob
\input{sections/results} % Carol
\input{sections/conclusion} % All
\end{document}
% sections/methodology.tex
\section{Methodology}
% Bob's addition
\added[id=BB]{We employed a mixed-methods approach combining
quantitative analysis with qualitative interviews.}
% Alice's comment
\todo[inline, author=Alice]{Should we mention the sample size here?}
% Carol's suggestion
\replaced[id=CC]{participants}{subjects}
% Highlighting changes
\deleted[id=AA]{The old methodology was limited.}
\added[id=AA]{Our comprehensive methodology addresses previous limitations.}
Managing Permissions
- View Only
- Can Edit
- Can Comment
% For reviewers and readers
% - Can view document
% - Can add comments
% - Cannot edit content
% - Can download PDF
% For co-authors
% - Full editing rights
% - Can add/remove content
% - Can modify structure
% - Can invite others
% For reviewers
% - Can view document
% - Can add comments
% - Can suggest changes
% - Cannot directly edit
Change Tracking
The changes Package
\documentclass{article}
\usepackage{changes}
% Setup authors
\definechangesauthor[name={John}, color=blue]{JD}
\definechangesauthor[name={Jane}, color=red]{JS}
% Configure display
\setaddedmarkup{\textcolor{#1}{\uline{#2}}}
\setdeletedmarkup{\textcolor{#1}{\sout{#2}}}
\begin{document}
\section{Introduction}
% Track additions
\added[id=JD]{This new section provides important context.}
% Track deletions
\deleted[id=JS]{Remove this outdated information.}
% Track replacements
\replaced[id=JD]{modern approach}{old method}
% Comments
\comment[id=JS]{Need citation here}
% Highlight text
\highlight{Important finding that needs review}
\end{document}
% Accept/reject changes workflow
\usepackage[final]{changes} % Accept all changes
% or
\usepackage[draft]{changes} % Show all changes
% Selective display
\setauthormarkup{JD}{\textcolor{blue}{#1}}
\setauthormarkup{JS}{\textcolor{red}{#1}}
% List all changes
\listofchanges
% Summary statistics
\begin{tabular}{lcc}
\toprule
Author & Added & Deleted \\
\midrule
John & 247 words & 89 words \\
Jane & 192 words & 134 words \\
\bottomrule
\end{tabular}
Manual Change Tracking
% Simple revision tracking with colors
\usepackage{xcolor}
\usepackage{soul}
% Define revision commands
\newcommand{\rev}[1]{\textcolor{blue}{#1}}
\newcommand{\del}[1]{\textcolor{red}{\sout{#1}}}
\newcommand{\note}[1]{\marginpar{\textcolor{orange}{\footnotesize #1}}}
% Usage
\rev{This text was added in revision 2.}
\del{This text should be removed.}
\note{Check this reference}
% Version-specific content
\newif\ifdraft
\drafttrue % or \draftfalse
\ifdraft
\newcommand{\draftonly}[1]{#1}
\else
\newcommand{\draftonly}[1]{}
\fi
% Showing differences between versions
\usepackage{listings}
\usepackage{xcolor}
\lstdefinestyle{diff}{
basicstyle=\ttfamily\small,
morecomment=[f][\color{blue}]{+},
morecomment=[f][\color{red}]{-},
morecomment=[f][\color{gray}]{@}
}
\begin{lstlisting}[style=diff]
@@ -15,7 +15,7 @@
The experiment used the following parameters:
-Temperature: 25°C
+Temperature: 27°C
Pressure: 1 atm
-Duration: 60 minutes
+Duration: 90 minutes
\end{lstlisting}
Review Workflows
Comment Systems
\usepackage[colorinlistoftodos]{todonotes}
% Configure todo notes
\setuptodonotes{
inline,
color=yellow!40,
size=\footnotesize
}
% Different comment types
\newcommand{\alice}[1]{\todo[color=blue!40, inline]{Alice: #1}}
\newcommand{\bob}[1]{\todo[color=red!40, inline]{Bob: #1}}
\newcommand{\review}[1]{\todo[color=green!40, inline]{Review: #1}}
% Usage in document
\section{Results}
Our findings indicate significant improvement.
\alice{Need to add specific percentages here}
The control group showed no change.
\bob{Should we include the p-value?}
\review{This section needs more detail about methodology}
% List all todos
\listoftodos[Notes for revision]
% Margin comments for review
\usepackage{marginnote}
\usepackage{xcolor}
% Review commands
\newcounter{commentnum}
\newcommand{\comment}[2]{%
\stepcounter{commentnum}%
\marginnote{%
\tiny\textcolor{red}{[\thecommentnum] #1: #2}%
}%
\textsuperscript{\textcolor{red}{\thecommentnum}}%
}
% Usage
The results \comment{Reviewer1}{Clarify which results} demonstrate
our hypothesis was correct.
% Alternative: pdfcomment package
\usepackage{pdfcomment}
\pdfcomment[author={Jane Doe}, color=yellow]{
This paragraph needs supporting evidence.
}
Code Review for LaTeX
# .github/pull_request_template.md
## LaTeX Document Review Checklist
### Content Review
- [ ] Content is accurate and complete
- [ ] All sections are properly structured
- [ ] References are correctly cited
- [ ] Figures and tables are referenced
### Technical Review
- [ ] Document compiles without errors
- [ ] No undefined references
- [ ] No overfull/underfull boxes
- [ ] Images are optimized
### Style Review
- [ ] Consistent formatting throughout
- [ ] Proper use of environments
- [ ] Correct math notation
- [ ] Clear and concise writing
### Bibliography
- [ ] All citations have entries
- [ ] BibTeX entries are complete
- [ ] Citation style is consistent
### Final Checks
- [ ] Spell check completed
- [ ] Grammar check completed
- [ ] PDF output looks correct
- [ ] Version number updated
# .github/workflows/latex-build.yml
name: Build LaTeX document
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Compile LaTeX
uses: xu-cheng/latex-action@v2
with:
root_file: main.tex
- name: Check for errors
run: |
! grep -E "(Warning|Error|Undefined)" main.log
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: document
path: main.pdf
Communication Tools
Project Documentation
# Contributing Guidelines
## Communication Channels
- **Slack**: #latex-project for daily communication
- **GitHub Issues**: Bug reports and feature requests
- **Weekly Meetings**: Thursdays 2 PM UTC
## Writing Style Guide
1. **Voice**: Active voice preferred
2. **Tense**: Present tense for methods
3. **Terminology**: See glossary.tex
4. **Citations**: Author-year format
## LaTeX Conventions
### File Naming
- Chapters: `ch01-introduction.tex`
- Figures: `fig-chapter-description.pdf`
- Tables: `tab-chapter-description.tex`
### Labels
- Sections: `sec:chapter:section`
- Figures: `fig:chapter:name`
- Tables: `tab:chapter:name`
- Equations: `eq:chapter:name`
### Code Style
```latex
% Good
\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{figure}
\caption{Clear description}
\label{fig:chapter:example}
\end{figure}
% Bad
\begin{figure}[h]
\includegraphics{figure}
\caption{Fig}
\end{figure}
Review Process
make check before committing
```latex project-glossary.tex
% glossary.tex - Shared terminology
\usepackage{glossaries}
\makeglossaries
% Define common terms
\newglossaryentry{ml}{
name=machine learning,
description={A subset of AI that enables systems to learn from data}
}
\newglossaryentry{api}{
name=API,
description={Application Programming Interface}
}
% Usage in documents
We use \gls{ml} techniques to process the data through our \gls{api}.
% Print glossary
\printglossary[title=Terminology]
Meeting Templates
# LaTeX Project Meeting - [Date]
## Attendees
- [ ] Alice (Lead Author)
- [ ] Bob (Methods)
- [ ] Carol (Analysis)
- [ ] Dave (Review)
## Agenda
1. Progress updates (10 min)
2. Blockers and issues (10 min)
3. Review assignments (15 min)
4. Next steps (10 min)
## Progress Updates
### Alice
- Completed introduction revision
- TODO: Address Bob's comments
### Bob
- Methodology section 80% complete
- Blocked: Need data from Carol
## Action Items
| Task | Owner | Due Date |
|------|-------|----------|
| Revise introduction | Alice | Friday |
| Provide data tables | Carol | Wednesday |
| Review methodology | Dave | Next Monday |
## Next Meeting
Date: [Next week same time]
Focus: Results section review
Conflict Resolution
Handling Disagreements
- Content Conflicts
- Style Conflicts
- Technical Conflicts
% Document alternatives
\usepackage{comment}
% Version A
\begin{comment}
Alice's version:
The results clearly demonstrate...
\end{comment}
% Version B
Bob's version:
The results suggest...
% Resolution meeting needed
\todo[inline]{DISCUSS: Strong vs cautious language}
% Create style guide
% styles/project-style.sty
\ProvidesPackage{project-style}
% Agreed conventions
\newcommand{\term}[1]{\textit{#1}}
\newcommand{\important}[1]{\textbf{#1}}
\newcommand{\citation}[1]{\citep{#1}}
% Enforce consistency
\let\it\undefined % Disable \it
\let\bf\undefined % Disable \bf
% Use feature flags
\newif\ifusemethod
\usemethodtrue % or false
\ifusemethod
% Method A implementation
\input{methods/approach-a}
\else
% Method B implementation
\input{methods/approach-b}
\fi
Best Practices
Collaboration Guidelines
✅ Successful collaboration checklist:
- Clear role assignments
- Regular communication schedule
- Documented conventions
- Version control setup
- Automated builds
- Review process defined
- Conflict resolution plan
- Backup strategy
- Deadline tracking
- Progress monitoring
Common Pitfalls
Avoid these collaboration mistakes:
- No clear ownership - Assign section owners
- Infrequent integration - Merge daily
- Poor communication - Regular check-ins
- Inconsistent style - Document conventions
- Missing reviews - Mandatory peer review
- No backup plan - Multiple backups
- Deadline confusion - Shared calendar
Complete Collaboration Example
#!/bin/bash
# Complete collaboration setup
# 1. Initialize repository
git init latex-collaborative-paper
cd latex-collaborative-paper
# 2. Create structure
mkdir -p {chapters,figures,reviews,builds}
mkdir -p .github/workflows
# 3. Setup Git hooks
cat > .git/hooks/pre-commit << 'EOF'
#!/bin/bash
# Check for LaTeX errors before commit
make check
EOF
chmod +x .git/hooks/pre-commit
# 4. Create main document
cat > main.tex << 'EOF'
\documentclass[12pt]{article}
\usepackage{changes}
\usepackage{todonotes}
% Define authors
\definechangesauthor[name={Alice}, color=blue]{AA}
\definechangesauthor[name={Bob}, color=red]{BB}
\title{Collaborative Research Paper}
\author{Alice \and Bob}
\begin{document}
\maketitle
\input{chapters/introduction}
\input{chapters/methods}
\input{chapters/results}
\input{chapters/conclusion}
\bibliographystyle{plain}
\bibliography{references}
\end{document}
EOF
# 5. Create Makefile
cat > Makefile << 'EOF'
.PHONY: all clean check watch
all: main.pdf
main.pdf: main.tex chapters/*.tex
pdflatex main
bibtex main
pdflatex main
pdflatex main
check:
@echo "Checking for errors..."
@! grep -i "error\|warning\|undefined" main.log
clean:
rm -f *.aux *.log *.out *.toc *.bbl *.blg
watch:
latexmk -pvc -pdf main.tex
EOF
# 6. Setup CI/CD
cat > .github/workflows/build.yml << 'EOF'
name: Build and Check
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: xu-cheng/latex-action@v2
with:
root_file: main.tex
- uses: actions/upload-artifact@v2
with:
name: PDF
path: main.pdf
EOF
echo "Collaboration environment ready!"
Next Steps
Continue with advanced LaTeX workflows:Using Templates
Create reusable document templates
Fixing Errors
Debug compilation issues
Large Documents
Manage complex projects
Research Papers
Write academic papers
Remember: Good collaboration is about communication, consistency, and clear processes. Establish conventions early and document everything. Regular integration and reviews prevent major conflicts.
