Then, it just calls the pdflatex command (which is installed on your system when you install MacTex) on that file in the same manner as before we made this script.ģ) Go into TeXShop and go to Preferences and then under the Engine tab again. This script just: Takes the last parameter passed in when it is called by TeXShop (this the the parameter which equals the name of the tex file, so, e.g., main.tex). Pdflatex -file-line-error -synctex=1 $texfile Let us start by moving the “pdflatex” call from inside TeXShop to our own bash script we will write shortly and then let TeXShop call our own script.ġ) Create the script “myscript.sh” in this folder:Ģ) Put the following code in -1}" #Get last parameter passed from shell Importantly, this gives us full control of our project! We could also make a python script (and use the “system” module), or anything else really. Therefore, we can make our own bash script called, in lack of a better name, “myscript.sh” which we can tell TeXShop to run whenever we typeset. Whatever we type in this box is what is run in the shell behind the scenes for us when we typeset the raw. Since I am using the pdftex->LaTeX typeset we see that the command which is run by TeXShop whenever I typeset the document is found in the left side under “pdfTeX” and then in the second box with title “Latex”: So, you just started a new project and you are typing it up in LaTeX. But, if there are files in your Misc folder before you typeset you want to use those (as they contain the referencing system etc.)! Finally, you want the generated “.pdf” file (again: if this is indeed what you typeset) moved back into the “Project” folder. Also, you want all the aux, log, and other “trash” files to go into the Misc folder automatically after typesetting. In other words, TeXShop will look for the figure file inside your Latex folder where main.tex itself resides but it wont find them unless we somehow circumvent that. You have some figures in the “Figures” folder but you are not referring to them inside your LaTeX main script (in an “includegraphics” command) via the path: “./Figures/Fig1.eps”, assuming the figure name is Fig1.eps, but rather just with “Fig1.eps”. It also generates a “.pdf” file (if that is what results in your particular typeset). (particular files being created depends on how you typeset). When you typeset main.tex this will generate a bunch of files such as the “.aux”, “.log”, etc. tex file you are working in to produce some nice output file (e.g., a. The idea is then that you are running the main LaTeX file (called main.tex later) in the “Latex” folder. Thisįolder contains the figures for your project. + You also have a folder called “Figures”. + You also have a folder called “Misc” which will contain You might have a “main.tex”įile which “includes” or “inputs” other files, e.g.: file1.tex + You have a folder called “Latex” where all your As a TeX editor I assume you are using TeXShop which comes as default with MacTex (installed via the first option described in the link above).Īssuming you have a working installation of TeXShop on your Mac I am going to show you one example of how to gain full control of files and folders in your LaTeX project. To install it on a Mac computer simply follow the steps in this link. I have been using LaTeX (“lay-tek”) for technical writing for many years. (note: at the end I explain how it works with bibtex as well)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |