[OS X TeX] How to make a original latexmk.engine for TeXShop

Herbert Schulz herbs at wideopenwest.com
Fri Oct 19 16:05:52 CEST 2018



> On Oct 19, 2018, at 8:58 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:
> 
> 
> 
>> On Oct 19, 2018, at 8:49 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:
>> 
>> 
>> 
>>> On Oct 19, 2018, at 8:28 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:
>>> 
>>> 
>>> 
>>>> On Oct 19, 2018, at 7:14 AM, 军其 胡 <junqihu at me.com> wrote:
>>>> 
>>>> Bonjour, all in the list,
>>>> 
>>>> I always call latexmk provided by MacTeX to compile my TeX-format file in Emacs.
>>>> Moreover, a latexmkrc would be created in every TeX projects by myself. It works well all times.
>>>> Today, I try to use latexmk.engine in TeXShop, I move latexmk.engine from ~/Library/TeXShop/Engines/Inactive/Latexmk/latexmk.engine to ~/Library/TeXShop/Engines/.
>>>> After restarting TeXShop, I found it works but not like works as called in Emacs, even after I change platexmkrc to latexmkrc in  latexmk.engine.
>>>> The latexmk mechanism in TeXShop is different from directly calling latexmk.
>>>> Does anyone know how to create a neat latexmk.engine for TeXshop which only calls the original latexmk and read latexmkrc from the root directory of the TeX project?
>>>> 
>>>> Bien à vous,
>>>> 
>>>> Jun-Qi HU
>>> 
>>> Howdy,
>>> 
>>> TeXShop's latexmk engines read rc files for each particular version of the engines. Those files are located in the ~/Library/TeXShop/bin/tslatexmk folder and should NOT be changed since an update to TeXShop could overwrite them. In addition, after the very first run of any of the latexmk engines there is an editable file, latexmkrcedit, created in the ~/Library/TeXShop/bin folder, which can be edited and will NOT be overwritten. That file is read by all of the latexmk engines. Finally, every project can have a platexmkrc file in the same folder as the project's files. It will be used for the typesetting of any .tex file in that folder using one of the latexmk engines. The order of reading the files is latexmkrcedit, the specific latexmkrc for that engine and finally the platexmkrc file if it exists in the folder containing the typeset document. The order is important because the rc files can overwrite changes made by a previously read rc file.
>>> 
>>> If you wish you can duplicate one of the engine files and give it a new name, e.g., mylatexmk.engine. Then edit that engine file to read a personal rc file with a special name, e.g., mylatexmkrc, instead of the one named after the ${TSBIN} in the engine. Finally place your rc file, named, e.g. mylatexmkrc, in ~/Library/TeXShop/bin/tslatexmk where it will be called.
>>> 
>>> Hope this helps.
>>> 
>>> Good Luck,
>>> 
>>> Herb Schulz
>>> (herbs at wideopenwest dot com)
>> 
>> Howdy,
>> 
>> An alternative is to simply duplicate one of the latexmk engines and edit everything out leaving only the line
>> 
>> latexmk ${1}
>> 
>> which should read your ~/latexmkrc file by default. You won't need any of the rc files mentioned before.
>> 
>> Good Luck,
>> 
>> Herb Schulz
>> (herbs at wideopenwest dot com)
>> 
> 
> Howdy,
> 
> Sorry, that line should be
> 
> latexmk -pdfps "${1}"
> 
> NOT simply
> 
> latexmk ${1}
> 
> as stated before.
> 
> Good Luck,
> 
> Herb Schulz
> (herbs at wideopenwest dot com)
> 

Howdy,

And reading the documentation it will automatically read ~/.latexmkrc not ~/latexmkrc. If you wish to have it read ~/latexmkrc instead the command line should be 

latexmk -pdfps  -r "${HOME}/latexmkrc" "${1}"

rather than what was given before.

Sorry for all the additional comments.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex



More information about the macostex-archives mailing list