Skip to main content
added 1176 characters in body
Source Link
Najib Idrissi
  • 5k
  • 3
  • 26
  • 46

SyncTeX. SyncTeX is something that can be used to jump quickly from the LaTeX source to the corresponding location in the PDF file and vice versa. So for example if you are editing a paragraph in LaTeX and you want to see how it actually look, you press a shortcut or something and your PDF reader takes you to the paragraph, or you are rereading your paper and you want to edit a paragraph, you double click on it or something and your editor takes you directly to the emplacement of the paragraph in the source.

I have found this extremely useful but it requires some amount of configuration: both your editor and your PDF reader need to support it. One basic thing you need to do is pass the --synctex=1 to latex so that it produces the appropriate .synctex.gz file. After that, due to the large variation of possible editors/PDF viewers, I can't give you specifics. If you want to look up online how to do it for your editor/viewer, note that it is sometimes called "forward/inverse search".

You can take a look at how I did it for Emacs (look for the "source-correlate" options).

latexmk. If you are not using an editor/IDE that manages compilation for you, you should definitely use latexmk. This is a script that automatically calls (pdf/xe/lua)latex, bibtex, biber... as many times as needed. It's as simple as launching latexmk -pdf article and it will do its magic. It reads the output of latex and checks if external files have been modified.

latexmk. If you are not using an editor/IDE that manages compilation for you, you should definitely use latexmk. This is a script that automatically calls (pdf/xe/lua)latex, bibtex, biber... as many times as needed. It's as simple as launching latexmk -pdf article and it will do its magic. It reads the output of latex and checks if external files have been modified.

SyncTeX. SyncTeX is something that can be used to jump quickly from the LaTeX source to the corresponding location in the PDF file and vice versa. So for example if you are editing a paragraph in LaTeX and you want to see how it actually look, you press a shortcut or something and your PDF reader takes you to the paragraph, or you are rereading your paper and you want to edit a paragraph, you double click on it or something and your editor takes you directly to the emplacement of the paragraph in the source.

I have found this extremely useful but it requires some amount of configuration: both your editor and your PDF reader need to support it. One basic thing you need to do is pass the --synctex=1 to latex so that it produces the appropriate .synctex.gz file. After that, due to the large variation of possible editors/PDF viewers, I can't give you specifics. If you want to look up online how to do it for your editor/viewer, note that it is sometimes called "forward/inverse search".

You can take a look at how I did it for Emacs (look for the "source-correlate" options).

latexmk. If you are not using an editor/IDE that manages compilation for you, you should definitely use latexmk. This is a script that automatically calls (pdf/xe/lua)latex, bibtex, biber... as many times as needed. It's as simple as launching latexmk -pdf article and it will do its magic. It reads the output of latex and checks if external files have been modified.

added 822 characters in body
Source Link
Najib Idrissi
  • 5k
  • 3
  • 26
  • 46

latexmk. If you are not using an editor/IDE that manages compilation for you, you should definitely use latexmk. This is a script that automatically calls (pdf/xe/lua)latex, bibtex, biber... as many times as needed. It's as simple as launching latexmk -pdf article and it will do its magic. It reads the output of latex and checks if external files have been modified.

The script also has a "watch" mode (-pvc option), where you tell it to compile the article, and recompile it whenever there's a change. Then you can just forget about compilation, modify your article, and check in the PDF reader from time to time. This may not be very convenient if your file takes a long time to compile, though, and there may be some annoying issues if you modify your article when it's in the middle of being compiled.

Many TikZ figures. TikZ has an "externalization" feature. It will automatically copy the figure to an external file and compile it. If the figures doesn't change between runs, it will not recompile the file, saving a lot of time. This is basically an automated version of what is suggested in the OP. You don't even need to change your document: all you need to do is write

Many TikZ figures. TikZ has an "externalization" feature. It will automatically copy the figure to an external file and compile it. If the figures doesn't change between runs, it will not recompile the file, saving a lot of time. This is basically an automated version of what is suggested in the OP. You don't even need to change your document: all you need to do is write

latexmk. If you are not using an editor/IDE that manages compilation for you, you should definitely use latexmk. This is a script that automatically calls (pdf/xe/lua)latex, bibtex, biber... as many times as needed. It's as simple as launching latexmk -pdf article and it will do its magic. It reads the output of latex and checks if external files have been modified.

The script also has a "watch" mode (-pvc option), where you tell it to compile the article, and recompile it whenever there's a change. Then you can just forget about compilation, modify your article, and check in the PDF reader from time to time. This may not be very convenient if your file takes a long time to compile, though, and there may be some annoying issues if you modify your article when it's in the middle of being compiled.

Many TikZ figures. TikZ has an "externalization" feature. It will automatically copy the figure to an external file and compile it. If the figures doesn't change between runs, it will not recompile the file, saving a lot of time. This is basically an automated version of what is suggested in the OP. You don't even need to change your document: all you need to do is write

added 488 characters in body
Source Link
Najib Idrissi
  • 5k
  • 3
  • 26
  • 46

Many TikZ figures. TikZ has an "externalization" feature. It will automatically copy the figure to an external file and compile it. If the figures doesn't change between runs, it will not recompile the file, saving a lot of time. This is basically an automated version of what is suggested in the OP. You don't even need to change your document: all you need to do is write

\usetikzlibrary{external}
\tikzexternalize

in the preamble of your file, and run latex with the -shell-escape option. For more information, read Chapter 55 of the TikZ manual.

Note: There is currently an issue with tikz-cd, if you use that. You'll have to tweak things a little.

Documentation. LaTeX packages are widely documented. If you have installed e.g. TeX Live in a normal way, you can simply run texdoc <package> in a terminal to get the documentation of the package. No need to search for it on CTAN or anything. So if you'd like to read the TikZ manual I mentioned before, simply run texdoc tikz and go wild!

Large documents. In the same vein (this is probably well known), when you have a very large document, you may want to split it in several files. When you do, use \include rather than \input for the content files. Then, in the preamble, use \includeonly. Only the files specified there will be recompiled and included in the PDF, but \include is smart enough to keep the auxiliary files for the other sub-files so that references and page numbers will still work correctly. More info: https://en.wikibooks.org/wiki/TeX/includeonly

Citing arXiv preprints. This is shameless self-promotion: I wrote a web app to automatically extract .bib information from an arXiv search. I encourage you to read the help before using it. As I explain there, I found issues with all the tools available online, especially when it comes with using BibLaTeX. If you are still using legacy bibliography support, you may run into issues.

Note that I literally started on it three weeks ago so it's not exactly polished (the "DIY" feature is incomplete, too). It's available there: https://a2b.idrissi.eu/

Writing responses to referees & external references. From time to time, you need to write a response to a referee and talk about what you changed in the new version. So for example you need to cite Lemma 3.14 to explain that its hypothesis have to be tweaked or whatever. But since you may be changing other things, the lemma's number may change, and since you cannot use \ref to automatically get the number, you have to track changes down manually. This can get painful quickly.

Fear not! Using a package that provides external references, you can reuse the references from your article in your letter to the editor, and things will automatically work. No need to change your article; just include

\usepackage{nameref,zref-xr}
\zxrsetup{toltxlabel}
\zexternaldocument*{article}[article.pdf]

in your letter, where you replace article by your article's file name. Then you can use \ref{key-lemma} in your letter, compile the article first, then compile the letter, and voilà! The lemma number is correct. If you use hyperref, the reference will even be clickable if <article pdf> is in the same folder as the letter's PDF.

Many TikZ figures. TikZ has an "externalization" feature. It will automatically copy the figure to an external file and compile it. If the figures doesn't change between runs, it will not recompile the file, saving a lot of time. This is basically an automated version of what is suggested in the OP. You don't even need to change your document: all you need to do is write

\usetikzlibrary{external}
\tikzexternalize

in the preamble of your file, and run latex with the -shell-escape option. For more information, read Chapter 55 of the TikZ manual.

Note: There is currently an issue with tikz-cd, if you use that. You'll have to tweak things a little.

Documentation. LaTeX packages are widely documented. If you have installed e.g. TeX Live in a normal way, you can simply run texdoc <package> in a terminal to get the documentation of the package. No need to search for it on CTAN or anything. So if you'd like to read the TikZ manual I mentioned before, simply run texdoc tikz and go wild!

Large documents. In the same vein (this is probably well known), when you have a very large document, you may want to split it in several files. When you do, use \include rather than \input for the content files. Then, in the preamble, use \includeonly. Only the files specified there will be recompiled and included in the PDF, but \include is smart enough to keep the auxiliary files for the other sub-files so that references and page numbers will still work correctly. More info: https://en.wikibooks.org/wiki/TeX/includeonly

Citing arXiv preprints. This is shameless self-promotion: I wrote a web app to automatically extract .bib information from an arXiv search. I encourage you to read the help before using it. As I explain there, I found issues with all the tools available online, especially when it comes with using BibLaTeX. If you are still using legacy bibliography support, you may run into issues.

Note that I literally started on it three weeks ago so it's not exactly polished (the "DIY" feature is incomplete, too). It's available there: https://a2b.idrissi.eu/

Many TikZ figures. TikZ has an "externalization" feature. It will automatically copy the figure to an external file and compile it. If the figures doesn't change between runs, it will not recompile the file, saving a lot of time. This is basically an automated version of what is suggested in the OP. You don't even need to change your document: all you need to do is write

\usetikzlibrary{external}
\tikzexternalize

in the preamble of your file, and run latex with the -shell-escape option. For more information, read Chapter 55 of the TikZ manual.

Note: There is currently an issue with tikz-cd, if you use that. You'll have to tweak things a little.

Documentation. LaTeX packages are widely documented. If you have installed e.g. TeX Live in a normal way, you can simply run texdoc <package> in a terminal to get the documentation of the package. No need to search for it on CTAN or anything. So if you'd like to read the TikZ manual I mentioned before, simply run texdoc tikz and go wild!

Large documents. In the same vein (this is probably well known), when you have a very large document, you may want to split it in several files. When you do, use \include rather than \input for the content files. Then, in the preamble, use \includeonly. Only the files specified there will be recompiled and included in the PDF, but \include is smart enough to keep the auxiliary files for the other sub-files so that references and page numbers will still work correctly. More info: https://en.wikibooks.org/wiki/TeX/includeonly

Citing arXiv preprints. This is shameless self-promotion: I wrote a web app to automatically extract .bib information from an arXiv search. I encourage you to read the help before using it. As I explain there, I found issues with all the tools available online, especially when it comes with using BibLaTeX. If you are still using legacy bibliography support, you may run into issues.

Note that I literally started on it three weeks ago so it's not exactly polished (the "DIY" feature is incomplete, too). It's available there: https://a2b.idrissi.eu/

Writing responses to referees & external references. From time to time, you need to write a response to a referee and talk about what you changed in the new version. So for example you need to cite Lemma 3.14 to explain that its hypothesis have to be tweaked or whatever. But since you may be changing other things, the lemma's number may change, and since you cannot use \ref to automatically get the number, you have to track changes down manually. This can get painful quickly.

Fear not! Using a package that provides external references, you can reuse the references from your article in your letter to the editor, and things will automatically work. No need to change your article; just include

\usepackage{nameref,zref-xr}
\zxrsetup{toltxlabel}
\zexternaldocument*{article}[article.pdf]

in your letter, where you replace article by your article's file name. Then you can use \ref{key-lemma} in your letter, compile the article first, then compile the letter, and voilà! The lemma number is correct. If you use hyperref, the reference will even be clickable if <article pdf> is in the same folder as the letter's PDF.

added 488 characters in body
Source Link
Najib Idrissi
  • 5k
  • 3
  • 26
  • 46
Loading
Source Link
Najib Idrissi
  • 5k
  • 3
  • 26
  • 46
Loading
Post Made Community Wiki by Najib Idrissi