SlideShare a Scribd company logo
1 of 9
Download to read offline
LaTeX with Git
Demo in Debian
By sppmg
Basic of git(incomplete)
git init
git add *.tex
git commit -m "msg"
edit your tex file.
edit your tex file.
git add -u
git commit -m "msg"
add all tracked file.
new file will not add . git commit -a -m "msg"
git push origin push(sync.) to remote
Compare two versions of tex
use latexdiff
$ latexdiff draft.tex revision.tex > diff.tex
$ latex diff.tex
https://www.inf.unibz.it/dis/wiki/doku.php?id=latex:diff
Combine git and latexdiff
$ git log --oneline --all --decorate --graph --color
$ git latexdiff --latexmk --latexopt "-xelatex"
--main main.tex master dev
$ git latexdiff --latexmk --latexopt "-xelatex"
--main main.tex 981a665 dev
Version history (GUI & CLI)
Compare last in 2 branch (master & dev) Compare 2 commit (981a665 & last)
LaTeX compiler
use xelatex
Tool list
1.git → VCS(Version Control System)
2.xelatex → LaTeX compiler, Chinese(if use unicode) need.
3.latexdiff → Compare two versions of tex.
4.latexpand → Expand input{} or include{} in tex.
5.git-latexdiff →It is a wrapper around git and latexdiff.
6.latexmk →It is a perl script for running LaTeX the
correct number of times to resolve cross references.
And use it bridge git-latexdiff and xelatex.
You should have it already. Or choose what you like.
Install tools in debian
# apt-get install latexdiff latexmk
$ git clone https://gitlab.com/git-latexdiff/git-latexdiff.git
$ cd git-latexdiff/
$ sudo make install-bin
git-latexdiff
latexdiff & latexmk
latexpand
debian 8(jessie)
texlive(2014.20141024-1) +
# apt-get install
texlive-extra-utils
debian 7(wheezy)
texlive(2012)
Download from ctan, put
under $PATH (eg. ~/bin)
git and xelatex
use apt, I don't
write here.
Try it now :D
Note, list difference in big project
In big project has many tex file, maybe you only want to know
which file changed.
So you can use below command:
$ git diff master dev --name-only
main.bib
main.tex
$ git diff master dev --name-status
A main.bib
M main.tex
Reference
●
http://stackoverflow.com/questions/6188780/git-latex-workflow
●
https://gitlab.com/git-latexdiff/git-latexdiff

More Related Content

What's hot

Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
Brian K. Vagnini
 

What's hot (19)

Command cheatsheets mac
Command cheatsheets macCommand cheatsheets mac
Command cheatsheets mac
 
Git cheat-sheet
Git cheat-sheetGit cheat-sheet
Git cheat-sheet
 
Git
GitGit
Git
 
GNU Make, Autotools, CMake 簡介
GNU Make, Autotools, CMake 簡介GNU Make, Autotools, CMake 簡介
GNU Make, Autotools, CMake 簡介
 
kikstart journey of Golang with Hello world - Gopherlabs
kikstart journey of Golang with Hello world - Gopherlabs kikstart journey of Golang with Hello world - Gopherlabs
kikstart journey of Golang with Hello world - Gopherlabs
 
Windows Cheatsheet
Windows CheatsheetWindows Cheatsheet
Windows Cheatsheet
 
Hg version control bioinformaticians
Hg version control bioinformaticiansHg version control bioinformaticians
Hg version control bioinformaticians
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
 
Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Hg for bioinformatics, second part
Hg for bioinformatics, second partHg for bioinformatics, second part
Hg for bioinformatics, second part
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with git
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Git 101
Git 101Git 101
Git 101
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
 
Mac Linux Commands cheatsheet
Mac Linux Commands cheatsheetMac Linux Commands cheatsheet
Mac Linux Commands cheatsheet
 
Essential Git and Github commands
Essential Git and Github commandsEssential Git and Github commands
Essential Git and Github commands
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 

Similar to Latex with git

Similar to Latex with git (20)

Git real slides
Git real slidesGit real slides
Git real slides
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
 
Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and Connectivity
 
Git it on (includes git hub)
Git it on (includes git hub)Git it on (includes git hub)
Git it on (includes git hub)
 
Exprimiendo GIT
Exprimiendo GITExprimiendo GIT
Exprimiendo GIT
 
Git basic
Git basicGit basic
Git basic
 
Presentation of sexy.rgtk
Presentation of sexy.rgtkPresentation of sexy.rgtk
Presentation of sexy.rgtk
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
DrupalCafe5 VCS
DrupalCafe5 VCSDrupalCafe5 VCS
DrupalCafe5 VCS
 
Git cheat-sheet 2021
Git cheat-sheet 2021Git cheat-sheet 2021
Git cheat-sheet 2021
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git
GitGit
Git
 
Git and github
Git and githubGit and github
Git and github
 
Git and Github
Git and GithubGit and Github
Git and Github
 
HackMTY - GitHub Workshop
HackMTY - GitHub WorkshopHackMTY - GitHub Workshop
HackMTY - GitHub Workshop
 
Atlassian git cheatsheet
Atlassian git cheatsheetAtlassian git cheatsheet
Atlassian git cheatsheet
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOps
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Latex with git

  • 1. LaTeX with Git Demo in Debian By sppmg
  • 2. Basic of git(incomplete) git init git add *.tex git commit -m "msg" edit your tex file. edit your tex file. git add -u git commit -m "msg" add all tracked file. new file will not add . git commit -a -m "msg" git push origin push(sync.) to remote
  • 3. Compare two versions of tex use latexdiff $ latexdiff draft.tex revision.tex > diff.tex $ latex diff.tex https://www.inf.unibz.it/dis/wiki/doku.php?id=latex:diff
  • 4. Combine git and latexdiff $ git log --oneline --all --decorate --graph --color $ git latexdiff --latexmk --latexopt "-xelatex" --main main.tex master dev $ git latexdiff --latexmk --latexopt "-xelatex" --main main.tex 981a665 dev Version history (GUI & CLI) Compare last in 2 branch (master & dev) Compare 2 commit (981a665 & last) LaTeX compiler use xelatex
  • 5. Tool list 1.git → VCS(Version Control System) 2.xelatex → LaTeX compiler, Chinese(if use unicode) need. 3.latexdiff → Compare two versions of tex. 4.latexpand → Expand input{} or include{} in tex. 5.git-latexdiff →It is a wrapper around git and latexdiff. 6.latexmk →It is a perl script for running LaTeX the correct number of times to resolve cross references. And use it bridge git-latexdiff and xelatex. You should have it already. Or choose what you like.
  • 6. Install tools in debian # apt-get install latexdiff latexmk $ git clone https://gitlab.com/git-latexdiff/git-latexdiff.git $ cd git-latexdiff/ $ sudo make install-bin git-latexdiff latexdiff & latexmk latexpand debian 8(jessie) texlive(2014.20141024-1) + # apt-get install texlive-extra-utils debian 7(wheezy) texlive(2012) Download from ctan, put under $PATH (eg. ~/bin) git and xelatex use apt, I don't write here.
  • 8. Note, list difference in big project In big project has many tex file, maybe you only want to know which file changed. So you can use below command: $ git diff master dev --name-only main.bib main.tex $ git diff master dev --name-status A main.bib M main.tex