Creating pre-formatted Tex file from terminal

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am constantly writing up my homework in Latex and they always have the same framework. Is there anyway I can create a script in Linux that creates a file with the framework then opens it in TexStudio?



For example let's say I am in /home/school/ directory and want to create a file named HW3.tex in the same directory with the framework then open it in TexStudio. Is there anyway of doing this?










share|improve this question

















  • 1




    I’m not clear what the problem is. Create a template file containing the framework, and then just copy it as needed.
    – Scott
    Oct 3 '17 at 0:38










  • I would like to do this efficiently. Like if I type newtex filename.tex it will create a filename.tex file in my current directory with a framework that is already predefined in another .tex file.
    – David
    Oct 3 '17 at 0:40











  • If a man can hammer a needle in 20 seconds, how much time does it take for 20 men to hammer the same needle? Solve the problem first, think about optimizing the solution afterwards.
    – Satō Katsura
    Oct 3 '17 at 6:11















up vote
1
down vote

favorite












I am constantly writing up my homework in Latex and they always have the same framework. Is there anyway I can create a script in Linux that creates a file with the framework then opens it in TexStudio?



For example let's say I am in /home/school/ directory and want to create a file named HW3.tex in the same directory with the framework then open it in TexStudio. Is there anyway of doing this?










share|improve this question

















  • 1




    I’m not clear what the problem is. Create a template file containing the framework, and then just copy it as needed.
    – Scott
    Oct 3 '17 at 0:38










  • I would like to do this efficiently. Like if I type newtex filename.tex it will create a filename.tex file in my current directory with a framework that is already predefined in another .tex file.
    – David
    Oct 3 '17 at 0:40











  • If a man can hammer a needle in 20 seconds, how much time does it take for 20 men to hammer the same needle? Solve the problem first, think about optimizing the solution afterwards.
    – Satō Katsura
    Oct 3 '17 at 6:11













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am constantly writing up my homework in Latex and they always have the same framework. Is there anyway I can create a script in Linux that creates a file with the framework then opens it in TexStudio?



For example let's say I am in /home/school/ directory and want to create a file named HW3.tex in the same directory with the framework then open it in TexStudio. Is there anyway of doing this?










share|improve this question













I am constantly writing up my homework in Latex and they always have the same framework. Is there anyway I can create a script in Linux that creates a file with the framework then opens it in TexStudio?



For example let's say I am in /home/school/ directory and want to create a file named HW3.tex in the same directory with the framework then open it in TexStudio. Is there anyway of doing this?







shell-script latex






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 3 '17 at 0:23









David

1083




1083







  • 1




    I’m not clear what the problem is. Create a template file containing the framework, and then just copy it as needed.
    – Scott
    Oct 3 '17 at 0:38










  • I would like to do this efficiently. Like if I type newtex filename.tex it will create a filename.tex file in my current directory with a framework that is already predefined in another .tex file.
    – David
    Oct 3 '17 at 0:40











  • If a man can hammer a needle in 20 seconds, how much time does it take for 20 men to hammer the same needle? Solve the problem first, think about optimizing the solution afterwards.
    – Satō Katsura
    Oct 3 '17 at 6:11













  • 1




    I’m not clear what the problem is. Create a template file containing the framework, and then just copy it as needed.
    – Scott
    Oct 3 '17 at 0:38










  • I would like to do this efficiently. Like if I type newtex filename.tex it will create a filename.tex file in my current directory with a framework that is already predefined in another .tex file.
    – David
    Oct 3 '17 at 0:40











  • If a man can hammer a needle in 20 seconds, how much time does it take for 20 men to hammer the same needle? Solve the problem first, think about optimizing the solution afterwards.
    – Satō Katsura
    Oct 3 '17 at 6:11








1




1




I’m not clear what the problem is. Create a template file containing the framework, and then just copy it as needed.
– Scott
Oct 3 '17 at 0:38




I’m not clear what the problem is. Create a template file containing the framework, and then just copy it as needed.
– Scott
Oct 3 '17 at 0:38












I would like to do this efficiently. Like if I type newtex filename.tex it will create a filename.tex file in my current directory with a framework that is already predefined in another .tex file.
– David
Oct 3 '17 at 0:40





I would like to do this efficiently. Like if I type newtex filename.tex it will create a filename.tex file in my current directory with a framework that is already predefined in another .tex file.
– David
Oct 3 '17 at 0:40













If a man can hammer a needle in 20 seconds, how much time does it take for 20 men to hammer the same needle? Solve the problem first, think about optimizing the solution afterwards.
– Satō Katsura
Oct 3 '17 at 6:11





If a man can hammer a needle in 20 seconds, how much time does it take for 20 men to hammer the same needle? Solve the problem first, think about optimizing the solution afterwards.
– Satō Katsura
Oct 3 '17 at 6:11











1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Create a template file containing the framework,
and then write a shell script called newtex that says



cp /path/name/to/your/template "$1"


and, if you want, add



tex "$1"


(or whatever command you use to edit a file).






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395735%2fcreating-pre-formatted-tex-file-from-terminal%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Create a template file containing the framework,
    and then write a shell script called newtex that says



    cp /path/name/to/your/template "$1"


    and, if you want, add



    tex "$1"


    (or whatever command you use to edit a file).






    share|improve this answer


























      up vote
      1
      down vote



      accepted










      Create a template file containing the framework,
      and then write a shell script called newtex that says



      cp /path/name/to/your/template "$1"


      and, if you want, add



      tex "$1"


      (or whatever command you use to edit a file).






      share|improve this answer
























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Create a template file containing the framework,
        and then write a shell script called newtex that says



        cp /path/name/to/your/template "$1"


        and, if you want, add



        tex "$1"


        (or whatever command you use to edit a file).






        share|improve this answer














        Create a template file containing the framework,
        and then write a shell script called newtex that says



        cp /path/name/to/your/template "$1"


        and, if you want, add



        tex "$1"


        (or whatever command you use to edit a file).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 4 '17 at 3:10

























        answered Oct 3 '17 at 0:52









        Scott

        6,29942348




        6,29942348



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395735%2fcreating-pre-formatted-tex-file-from-terminal%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?