How to make a original latexmk.engine for TeXShop

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make a original latexmk.engine for TeXShop

军其 胡
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


----------- 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

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 7:14 AM, 军其 胡 <[hidden email]> 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)

----------- 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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 8:28 AM, Herbert Schulz <[hidden email]> wrote:
>
>
>
>> On Oct 19, 2018, at 7:14 AM, 军其 胡 <[hidden email]> 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)

----------- 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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 8:49 AM, Herbert Schulz <[hidden email]> wrote:
>
>
>
>> On Oct 19, 2018, at 8:28 AM, Herbert Schulz <[hidden email]> wrote:
>>
>>
>>
>>> On Oct 19, 2018, at 7:14 AM, 军其 胡 <[hidden email]> 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)

----------- 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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 8:58 AM, Herbert Schulz <[hidden email]> wrote:
>
>
>
>> On Oct 19, 2018, at 8:49 AM, Herbert Schulz <[hidden email]> wrote:
>>
>>
>>
>>> On Oct 19, 2018, at 8:28 AM, Herbert Schulz <[hidden email]> wrote:
>>>
>>>
>>>
>>>> On Oct 19, 2018, at 7:14 AM, 军其 胡 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 9:05 AM, Herbert Schulz <[hidden email]> wrote:
>
>
>
>> On Oct 19, 2018, at 8:58 AM, Herbert Schulz <[hidden email]> wrote:
>>
>>
>>
>>> On Oct 19, 2018, at 8:49 AM, Herbert Schulz <[hidden email]> wrote:
>>>
>>>
>>>
>>>> On Oct 19, 2018, at 8:28 AM, Herbert Schulz <[hidden email]> wrote:
>>>>
>>>>
>>>>
>>>>> On Oct 19, 2018, at 7:14 AM, 军其 胡 <[hidden email]> 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)
>
Howdy,

Ok, this is silly... Here's a simple latexmk engine (mylatexmk.engine --- rename it as you wish) that will read in ~/latexmkrc as you wish.




Just unzip it, place it in ~/Library/TeXShop/Engines and restart TeXShop. It should then appear in the popup engine list on the Source file Toolbar (NOT under the Typeset menu.

By the way, what special settings do you use that aren't properly set by the latexmk engine supplied with TeXShop?

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

mylatexmk.engine.zip (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

军其 胡
I think it's still not a good one, since it only read ~/latexmkrc.
But I want to make latexmk read $PROJECTDIR/latexmkrc.

> Le 19 oct. 2018 à 16:19, Herbert Schulz <[hidden email]> a écrit :
>
> Here's a simple latexmk engine (mylatexmk.engine --- rename it as you wish) that will read in ~/latexmkrc as you wish.
>
> <mylatexmk.engine.zip>
>
> Just unzip it, place it in ~/Library/TeXShop/Engines and restart TeXShop. It should then appear in the popup engine list on the Source file Toolbar (NOT under the Typeset menu.

I put the following lines into $PROJECTDIR/latexmkrc:
---------------------------------------------------------------------------------------
$pdflatex = 'xelatex -synctex=-1 %O %S';
$pdf_mode = 1;
$postscript_mode = 0;
$dvi_mode = 0;

add_cus_dep('adx', 'and', 0, 'makeadx2and');
sub makeadx2and {
    system( "makeindex -o \"$_[0].and\" \"$_[0].adx\"" );
}

add_cus_dep('nlo', 'nls', 0, 'makenlo2nls');
sub makenlo2nls {
    system( "makeindex \"$_[0].nlo\" -s nomencl.ist -o \"$_[0].nls\"" );
}
---------------------------------------------------------------------------------------
it always works well.

> By the way, what special settings do you use that aren't properly set by the latexmk engine supplied with TeXShop?


----------- 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

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 10:30 AM, 军其 胡 <[hidden email]> wrote:
>
> I think it's still not a good one, since it only read ~/latexmkrc.
> But I want to make latexmk read $PROJECTDIR/latexmkrc.
>
>> Le 19 oct. 2018 à 16:19, Herbert Schulz <[hidden email]> a écrit :
>>
>> Here's a simple latexmk engine (mylatexmk.engine --- rename it as you wish) that will read in ~/latexmkrc as you wish.
>>
>> <mylatexmk.engine.zip>
>>
>> Just unzip it, place it in ~/Library/TeXShop/Engines and restart TeXShop. It should then appear in the popup engine list on the Source file Toolbar (NOT under the Typeset menu.
>
> I put the following lines into $PROJECTDIR/latexmkrc:
> ---------------------------------------------------------------------------------------
> $pdflatex = 'xelatex -synctex=-1 %O %S';
> $pdf_mode = 1;
> $postscript_mode = 0;
> $dvi_mode = 0;
>
> add_cus_dep('adx', 'and', 0, 'makeadx2and');
> sub makeadx2and {
>    system( "makeindex -o \"$_[0].and\" \"$_[0].adx\"" );
> }
>
> add_cus_dep('nlo', 'nls', 0, 'makenlo2nls');
> sub makenlo2nls {
>    system( "makeindex \"$_[0].nlo\" -s nomencl.ist -o \"$_[0].nls\"" );
> }
> ---------------------------------------------------------------------------------------
> it always works well.
>
>> By the way, what special settings do you use that aren't properly set by the latexmk engine supplied with TeXShop?
Howdy,

Ok, the following TeXShop engine also reads $PROJECTDIR/latexmkrc.




I assume you're using TeXShop to run the engine so I'd use

$pdflatex = 'xelatex -synctex=-1  --file-line-error %O %S';

in your $PROJECTDIR/latexmkrc file since TeXShop uses that information to find the file for the error in the log file.

You were talking about latex and I see you want to use xelatex. Try the xelatexmk engine along with a platexmkrc file and see if that works for you

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

mylatexmk.engine (84 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

军其 胡
Let me try.

> Le 19 oct. 2018 à 17:49, Herbert Schulz <[hidden email]> a écrit :
>
> Ok, the following TeXShop engine also reads $PROJECTDIR/latexmkrc.
>
> <mylatexmk.engine>
>
> I assume you're using TeXShop to run the engine so I'd use
>
> $pdflatex = 'xelatex -synctex=-1  --file-line-error %O %S';
>
> in your $PROJECTDIR/latexmkrc file since TeXShop uses that information to find the file for the error in the log file.

I think the mechanism of latexmk is simple.
Through a custom latexmkrc, we can define many options, including LaTeX engine, PDF/DVI mode, using other utilities or not, etc.
One latexmk.engine is enough for all TeX engine.

> You were talking about latex and I see you want to use xelatex. Try the xelatexmk engine along with a platexmkrc file and see if that works for you


----------- 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

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

军其 胡
In reply to this post by Herbert Schulz
The behavior of running latexmk in TeXShop is weird.
It seems that latexmk.engine would ignore to check the timestamps of the files in the TeX projects.
It is not like directly running latexmk in the bash shell because it would check timestamps.
For example, if you execute this following command
$ latexmk sam.tex
in bash shell once, the TeX-format files will be compiled.
If we don't modify anything in this TeX project, just run
$ latexmk sam.tex
again, it will give me the following information
---------------------------------------------------------------------------------------
Latexmk: This is Latexmk, John Collins, 7 August 2018, version: 4.59.
Latexmk: All targets (lnmpde.pdf) are up-to-date
---------------------------------------------------------------------------------------
I can't figure out what happened in TeXShop.

> Le 19 oct. 2018 à 17:49, Herbert Schulz <[hidden email]> a écrit :
>
> Ok, the following TeXShop engine also reads $PROJECTDIR/latexmkrc.
>
> <mylatexmk.engine>
>
> I assume you're using TeXShop to run the engine so I'd use
>
> $pdflatex = 'xelatex -synctex=-1  --file-line-error %O %S';
>
> in your $PROJECTDIR/latexmkrc file since TeXShop uses that information to find the file for the error in the log file.

----------- 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

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 11:28 AM, 军其 胡 <[hidden email]> wrote:
>
> The behavior of running latexmk in TeXShop is weird.
> It seems that latexmk.engine would ignore to check the timestamps of the files in the TeX projects.
> It is not like directly running latexmk in the bash shell because it would check timestamps.
> For example, if you execute this following command
> $ latexmk sam.tex
> in bash shell once, the TeX-format files will be compiled.
> If we don't modify anything in this TeX project, just run
> $ latexmk sam.tex
> again, it will give me the following information
> ---------------------------------------------------------------------------------------
> Latexmk: This is Latexmk, John Collins, 7 August 2018, version: 4.59.
> Latexmk: All targets (lnmpde.pdf) are up-to-date
> ---------------------------------------------------------------------------------------
> I can't figure out what happened in TeXShop.
>
>> Le 19 oct. 2018 à 17:49, Herbert Schulz <[hidden email]> a écrit :
>>
>> Ok, the following TeXShop engine also reads $PROJECTDIR/latexmkrc.
>>
>> <mylatexmk.engine>
>>
>> I assume you're using TeXShop to run the engine so I'd use
>>
>> $pdflatex = 'xelatex -synctex=-1  --file-line-error %O %S';
>>
>> in your $PROJECTDIR/latexmkrc file since TeXShop uses that information to find the file for the error in the log file.

Howdy,

Exactly the same behavior in TeXShop! If the files are up to date latexmk gives the same output. Are you sure you are having TeXShop use that engine?

First, how are you using the engine? You should have a line

% !TEX program = mylatexmk

(or whatever you call the engine) at the top of your file. Second, you typeset the document by using Typeset->Typeset (Cmd-T). Then TeXShop will execute the mylatexmk (or whatever…) engine.

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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

军其 胡
Ok! Following your instructions, latexmk.engine DOES work. Although there are only two lines
-------------------------------
#!/bin/bash
latexmk "$1"
-------------------------------
in latexmk.engine.

I'm confused of the role of latexmk.engine in TeXShop. 
When I use latexmk in Emacs, I only take it as the wrapped scripts instead of TeX engine.
In other words, latexmk always ignore the local file variable of Emacs in the TeX-format files when it is called in Emacs.
In fact, the TeX engine for latexmk is specified in latexmkrc.
However, by clicking latexmk button in TeXShop, latexmk.engine would also read the local file variable.

Le 19 oct. 2018 à 19:06, Herbert Schulz <[hidden email]> a écrit :


Howdy,

Exactly the same behavior in TeXShop! If the files are up to date latexmk gives the same output. Are you sure you are having TeXShop use that engine?

First, how are you using the engine? You should have a line

% !TEX program = mylatexmk

(or whatever you call the engine) at the top of your file. Second, you typeset the document by using Typeset->Typeset (Cmd-T). Then TeXShop will execute the mylatexmk (or whatever…) engine.


----------- 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

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 1:26 PM, 军其 胡 <[hidden email]> wrote:
>
> Ok! Following your instructions, latexmk.engine DOES work. Although there are only two lines
> -------------------------------
> #!/bin/bash
> latexmk "$1"
> -------------------------------
> in latexmk.engine.
>
> I'm confused of the role of latexmk.engine in TeXShop.
> When I use latexmk in Emacs, I only take it as the wrapped scripts instead of TeX engine.
> In other words, latexmk always ignore the local file variable of Emacs in the TeX-format files when it is called in Emacs.
> In fact, the TeX engine for latexmk is specified in latexmkrc.
> However, by clicking latexmk button in TeXShop, latexmk.engine would also read the local file variable.
>
>> Le 19 oct. 2018 à 19:06, Herbert Schulz <[hidden email]> a écrit :
>>
>>
>> Howdy,
>>
>> Exactly the same behavior in TeXShop! If the files are up to date latexmk gives the same output. Are you sure you are having TeXShop use that engine?
>>
>> First, how are you using the engine? You should have a line
>>
>> % !TEX program = mylatexmk
>>
>> (or whatever you call the engine) at the top of your file. Second, you typeset the document by using Typeset->Typeset (Cmd-T). Then TeXShop will execute the mylatexmk (or whatever…) engine.

Howdy,

I sent an updated engine in a later email. Sorry about so many posts.

There are many extra dependencies that are already in the rc files associated with each of the TeXShop engines and they satisfy almost everyone's ordinary needs. If you have special needs for a given project you can always create a platexmkrc (the p is for project) in the same folder as the project. I use different engines for different documents and it's helpful for me to see that I'm using xelatex when I use the xelatexmk engine rather than a generic latexmk engine. The latexmk engine actually is set up to use latex->dvips->ps2pdf.

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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

军其 胡
Probably, I understand what you explained. 
I insist that the TeX engine for latexmk should specified in latexmkrc even for common users.

Thank you for your patience.

Le 19 oct. 2018 à 20:51, Herbert Schulz <[hidden email]> a écrit :

There are many extra dependencies that are already in the rc files associated with each of the TeXShop engines and they satisfy almost everyone's ordinary needs. If you have special needs for a given project you can always create a platexmkrc (the p is for project) in the same folder as the project. I use different engines for different documents and it's helpful for me to see that I'm using xelatex when I use the xelatexmk engine rather than a generic latexmk engine. The latexmk engine actually is set up to use latex->dvips->ps2pdf.



----------- 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

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 2:11 PM, 军其 胡 <[hidden email]> wrote:
>
> Probably, I understand what you explained.
> I insist that the TeX engine for latexmk should specified in latexmkrc even for common users.
>
> Thank you for your patience.
>
>> Le 19 oct. 2018 à 20:51, Herbert Schulz <[hidden email]> a écrit :
>>
>> There are many extra dependencies that are already in the rc files associated with each of the TeXShop engines and they satisfy almost everyone's ordinary needs. If you have special needs for a given project you can always create a platexmkrc (the p is for project) in the same folder as the project. I use different engines for different documents and it's helpful for me to see that I'm using xelatex when I use the xelatexmk engine rather than a generic latexmk engine. The latexmk engine actually is set up to use latex->dvips->ps2pdf.

Howdy,

I keep most of my non-project oriented .tex files in a single folder. They use different engines depending upon what I'm trying to accomplish; I usually use pdflatex but, with some documents I use xelatex and even lualatex and, if I'm using many eps graphics I might even use latex->dvips->ps2pdf. Using your method I'd have to edit the latexmkrc file for each case. I can't agree with you.

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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

军其 胡
Ah..., you use latexmk for single TeX-format file. 
At this occasion, you are right. 
I thought latexmk is always used to compile the TeX projects like GNU Make.

Le 19 oct. 2018 à 21:21, Herbert Schulz <[hidden email]> a écrit :

I keep most of my non-project oriented .tex files in a single folder. They use different engines depending upon what I'm trying to accomplish; I usually use pdflatex but, with some documents I use xelatex and even lualatex and, if I'm using many eps graphics I might even use latex->dvips->ps2pdf. Using your method I'd have to edit the latexmkrc file for each case. I can't agree with you.



----------- 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

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 19, 2018, at 2:32 PM, 军其 胡 <[hidden email]> wrote:
>
> Ah..., you use latexmk for single TeX-format file.
> At this occasion, you are right.
> I thought latexmk is always used to compile the TeX projects like GNU Make.
>
>> Le 19 oct. 2018 à 21:21, Herbert Schulz <[hidden email]> a écrit :
>>
>> I keep most of my non-project oriented .tex files in a single folder. They use different engines depending upon what I'm trying to accomplish; I usually use pdflatex but, with some documents I use xelatex and even lualatex and, if I'm using many eps graphics I might even use latex->dvips->ps2pdf. Using your method I'd have to edit the latexmkrc file for each case. I can't agree with you.

Howdy,

There are many reasons to use latexmk based engines. I've got lots of documents that require multiple compiles because of cross-references, or special processing for glossaries, or bibliographies (latexmk will automatically use biber rather than bibtex when needed with the biblatex package) or … . The rc files that are read in create the necessary dependencies and rules for quite a few packages so the user doesn't have to it themselves.

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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

军其 胡
In your case, since there are so many dependencies (cross-references, etc.) between those files,
I think, it's better to organize them as a TeX projects,
or else it cause to fail in compiling them because of some single TeX-format file would be missed.

> Le 19 oct. 2018 à 22:26, Herbert Schulz <[hidden email]> a écrit :
>
> There are many reasons to use latexmk based engines. I've got lots of documents that require multiple compiles because of cross-references, or special processing for glossaries, or bibliographies (latexmk will automatically use biber rather than bibtex when needed with the biblatex package) or … . The rc files that are read in create the necessary dependencies and rules for quite a few packages so the user doesn't have to it themselves.
>
> 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

----------- 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

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

Herbert Schulz


> On Oct 20, 2018, at 3:29 AM, 军其 胡 <[hidden email]> wrote:
>
> In your case, since there are so many dependencies (cross-references, etc.) between those files,
> I think, it's better to organize them as a TeX projects,
> or else it cause to fail in compiling them because of some single TeX-format file would be missed.
>
>> Le 19 oct. 2018 à 22:26, Herbert Schulz <[hidden email]> a écrit :
>>
>> There are many reasons to use latexmk based engines. I've got lots of documents that require multiple compiles because of cross-references, or special processing for glossaries, or bibliographies (latexmk will automatically use biber rather than bibtex when needed with the biblatex package) or … . The rc files that are read in create the necessary dependencies and rules for quite a few packages so the user doesn't have to it themselves.
>>
>> Good Luck,
>>
>> Herb Schulz
>> (herbs at wideopenwest dot com)

Howdy,

They are single files but they may have things in them that require multiple runs of pdflatex, e.g., table of contents, references to equations or tables or tikz-figures. If there is a need for multiple files (e.g., graphics inclusion) I do make a project folder to keep the files together.

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
Reply | Threaded
Open this post in threaded view
|

Re: How to make a original latexmk.engine for TeXShop

军其 胡
Through a custom latexmkrc, all of your needs will be realized.

Le 20 oct. 2018 à 13:12, Herbert Schulz <[hidden email]> a écrit :

They are single files but they may have things in them that require multiple runs of pdflatex, e.g., table of contents, references to equations or tables or tikz-figures. 

I hope that there would be a method of using latexmk in TeXShop, which is independent of the local file variable, i.e. TEX TS-program.

----------- 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

signature.asc (507 bytes) Download Attachment