[{"data":1,"prerenderedAt":1124},["ShallowReactive",2],{"\u002Fblogs\u002Fautomated-workflow-for-latex":3},{"id":4,"title":5,"body":6,"coverImage":1112,"description":1115,"extension":1116,"meta":1117,"navigation":316,"path":1118,"publishedOn":1119,"seo":1120,"sitemap":1121,"stem":1122,"__hash__":1123},"content\u002Fblogs\u002Fautomated-workflow-for-latex.md","An Automated and Modern Workflow for Using LaTex",{"type":7,"value":8,"toc":1106},"minimark",[9,47,50,55,92,102,111,114,117,130,133,137,144,203,209,238,258,285,288,330,361,374,395,399,402,408,433,450,456,498,527,537,554,601,618,630,719,727,736,780,801,807,813,887,893,913,936,951,955,958,987,1012,1032,1035,1083,1102],[10,11,12,13,20,21,26,27,32,33,37,38,42,43,46],"p",{},"If you're aware of or have used ",[14,15,19],"a",{"href":16,"rel":17},"https:\u002F\u002Fwww.latex-project.org",[18],"nofollow","LaTeX"," in the\npast, you would know how archaic & antiquated its toolkit is. Sure, LaTeX\ndistributions like ",[14,22,25],{"href":23,"rel":24},"https:\u002F\u002Fwww.tug.org\u002Ftexlive",[18],"TeX Live"," & online LaTeX\neditors like ",[14,28,31],{"href":29,"rel":30},"https:\u002F\u002Fwww.overleaf.com",[18],"Overleaf"," alleaviates the need for any\nmanual setting up of an environment, but those options aren't for everyone. For\nexample, TeX Live can be ",[34,35,36],"strong",{},"VERY"," bloated while Overleaf is an online editor.\nAnd Overleaf is an online web-based editor which means \"",[39,40,41],"em",{},"no Internet"," == ",[39,44,45],{},"can't\nwork on your LaTeX projects","\".",[10,48,49],{},"That said through this article, I hope to share how I work with LaTex by using\nmodern tools & software. You'll also get to see & understand what my typical\nLaTeX workflow is like & take it as an inspiration to develop your own workflow!\nBut be prepared, this article will be a long one, so I hope you've bucket of\npopcorn with you ready! 😉",[51,52,54],"h2",{"id":53},"the-issues-with-existing-tools-like-overleaftex-live","The Issues With Existing Tools Like Overleaf\u002FTeX Live",[10,56,57,58,62,63,68,69,72,73,81,82,87,88,91],{},"If you read up a bit behind the history of\n",[14,59,19],{"href":60,"rel":61},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLaTeX",[18]," (and it's predecessor,\n",[14,64,67],{"href":65,"rel":66},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTeX",[18],"Tex","), you would know the software is old &\narchaic (",[39,70,71],{},"calling LaTeX\u002FTeX \"archaic\" is an understatement in my opinion","). You\nsee the LaTeX engine (",[39,74,75,76,80],{},"the software responsible for compiling the ",[77,78,79],"code",{},".tex"," files",")\nis older than ",[14,83,86],{"href":84,"rel":85},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLinux",[18],"GNU\u002FLinux"," (",[39,89,90],{},"not to be\nconfused to the Linux kernel",") itself by at least a decade! Suffice to say, the\nUI\u002FUX of using LaTeX\u002FTeX isn't up to modern standards.",[10,93,94,95,97,98,101],{},"Fortunately though, software distributions like TeX Live & online editors such\nas Overleaf eased most of the pain points of using LaTex\u002FTex. TeX Live packages\neverything an user would require to use LaTex in a standalone distribution. And\nit included everything like language packs, encoding, macros, a text-editor,\noffline documentations of the included command-line tools & so on. You might or\nmightn't ever need those extra features when compiling the ",[77,96,79],{}," files to\n",[77,99,100],{},".pdf",".",[10,103,104,105,110],{},"Such overloaded distributions also came at a hefty price! For instance, on a\nstandard Ubuntu LTS release, installing the various available TeX Live\ndistributions would use up anywhere between 1-6+ GB of storage space\n(",[14,106,109],{"href":107,"rel":108},"https:\u002F\u002Fgist.github.com\u002Fshivams\u002F0e62b79aaef345560c11aa1862b7029c",[18],"see source",")!\nI don't know about you, but I for sure wouldn't want to waste upwards of 6 GB of\nstorage space simply for a bunch of redundant software I might or mightn't ever\nuse.",[10,112,113],{},"If redundant & unnecessary wastage of precious storage space bothers you as\nwell, you could give Overleaf a try. The online editor provides a nice interface\n& similar to TeX Live, it already provides everything you'll ever need to\ncompile you PDF documents. The major (and perhaps the only) drawback of the\nplatform for me is it's hard dependency on Internet connectivity. For me this is\na major drawback because I travel often & I would like to work on my book(s)\neven when I don't have access to the Web.",[10,115,116],{},"The other common issues I faced with all LaTex distributions are:",[118,119,120,124,127],"ol",{},[121,122,123],"li",{},"Lack of proper Language-Server Protocol (LSP) support.",[121,125,126],{},"Compilation is often insanely slow even for LaTeX documents which are barely\na handful of pages long!",[121,128,129],{},"Set of ambiguously named command-line tools which could be integrated into\none single binary by today's standards.",[10,131,132],{},"On a brigher note though, all of the aforementioned issues can be resolved by\nusing a couple of modern tools & the next section sheds light on those tools. A\nheads up though, some of the said tools are redundant-proof. So if you're\nsoftware developer, you can easily integrate them into your development workflow\nas well even when not working with LaTeX!",[51,134,136],{"id":135},"introducing-the-modern-latex-tool-kit","Introducing the Modern LaTeX Tool Kit",[10,138,139,140,143],{},"The \"modern\" LaTeX workflow I adopted recently requires a couple of software\ninstalled locally (",[39,141,142],{},"and yes, don't worry they're not as bloated as TeX Live",").\nHere are the following list of tools I use:",[145,146,147,162,183],"ul",{},[121,148,149,156,157,101],{},[14,150,153],{"href":151,"rel":152},"https:\u002F\u002Ftectonic-typesetting.github.io",[18],[77,154,155],{},"tectonic",", a modern &\nself-contained TeX\u002FLaTeX engine & a CLI tool written in\n",[14,158,161],{"href":159,"rel":160},"https:\u002F\u002Fwww.rust-lang.org",[18],"Rust",[121,163,164,171,172,177,178,101],{},[14,165,168],{"href":166,"rel":167},"https:\u002F\u002Ftaskfile.dev",[18],[77,169,170],{},"task"," a modern & cross-platform alternative to\n",[14,173,176],{"href":174,"rel":175},"https:\u002F\u002Fwww.gnu.org\u002Fsoftware\u002Fmake\u002Fmanual\u002Fmake.html",[18],"GNU Make"," written in\n",[14,179,182],{"href":180,"rel":181},"https:\u002F\u002Fgo.dev",[18],"Go",[121,184,185,186,191,192,191,197,202],{},"A Text Editor of your choice for example ",[14,187,190],{"href":188,"rel":189},"https:\u002F\u002Fneovim.io",[18],"Neovim"," or\n",[14,193,196],{"href":194,"rel":195},"https:\u002F\u002Fwww.sublimetext.com",[18],"Sublime Text 3",[14,198,201],{"href":199,"rel":200},"https:\u002F\u002Fcode.visualstudio.com",[18],"Visual Studio Code"," which is my personal\npreference.",[10,204,205,208],{},[34,206,207],{},"NOTE",": You might want to stick around & follow me for future updates! I'm\nworking on another write-up which aims at discussing setting up a work\nenvironment for LaTeX projects using VSCode\u002FNeovim.",[10,210,211,212,214,215,217,218,220,221,223,224,226,227,232,233,237],{},"At the crux of my workflow is ",[77,213,155],{}," which is responsible for compiling the\n",[77,216,79],{}," files to ",[77,219,100],{}," (and much more)! The said CLI tool is actively developed\nusing the Rust language & as such you can expect it to be ",[34,222,36],{}," fast! The\nauthors of ",[77,225,155],{}," also advcates how the project stands on the shoulders of\nthe giants. And they say, the project wouldn't have seen the light of the day\nwithout the collective effort put into the\n",[14,228,231],{"href":229,"rel":230},"http:\u002F\u002Fxetex.sourceforge.net",[18],"XeTeX project","\n(",[14,234,109],{"href":235,"rel":236},"https:\u002F\u002Ftectonic-typesetting.github.io\u002Fbook\u002Flatest\u002Fintroduction\u002Findex.html#tectonic-and-tex",[18],").",[10,239,240,241,243,244,246,247,254,255,257],{},"While I don't understand how ",[77,242,155],{}," works under-the-hood, you've my personal\nguaranteed, its as useful as a full-blown bloated distribution like TeX Live!\nYou needn't worry about a package's existence on the local machine because\n",[77,245,155],{}," is smart enough to figure it out at compile time! It'll identify what\npackages are used in the\n\"",[14,248,251],{"href":249,"rel":250},"https:\u002F\u002Fen.wikibooks.org\u002Fwiki\u002FLaTeX\u002FDocument_Structure#Preamble",[18],[39,252,253],{},"preamble","\"\n& then either download them to be cached for later use. You can configure\n",[77,256,155],{}," to download packages eagerly but using the cache is preferable for\nfaster usages & workflow.",[10,259,260,261,268,269,276,277,284],{},"You should also note, the tool has two versions of the CLI; the existing\n",[14,262,265],{"href":263,"rel":264},"https:\u002F\u002Ftectonic-typesetting.github.io\u002Fbook\u002Flatest\u002Fref\u002Fv1cli.html",[18],[77,266,267],{},"v1"," & the\nwork-in-progress\n",[14,270,273],{"href":271,"rel":272},"https:\u002F\u002Ftectonic-typesetting.github.io\u002Fbook\u002Flatest\u002Fref\u002Fv2cli.html",[18],[77,274,275],{},"v2","\ninterface. I prefer using the v2 interface because of its intuitiveness & a\n",[14,278,281],{"href":279,"rel":280},"https:\u002F\u002Fdoc.rust-lang.org\u002Fcargo",[18],[77,282,283],{},"cargo","-like user-experience. I suggest going\nthrough the documentations I linked above to gain more knowledge about the\ndifferences.",[10,286,287],{},"But for starters here's a quick sneak peak into the differences:",[289,290,295],"pre",{"className":291,"code":292,"language":293,"meta":294,"style":294},"language-console shiki shiki-themes everforest-dark","# The \"-X\" (notice the capital \"X\") stands for the v2 interface.\ntectonic -X build\n\n# And this is the v1 interface which will be deprecated some day.\ntectonic my-file.tex\n","console","",[77,296,297,305,311,318,324],{"__ignoreMap":294},[298,299,302],"span",{"class":300,"line":301},"line",1,[298,303,304],{},"# The \"-X\" (notice the capital \"X\") stands for the v2 interface.\n",[298,306,308],{"class":300,"line":307},2,[298,309,310],{},"tectonic -X build\n",[298,312,314],{"class":300,"line":313},3,[298,315,317],{"emptyLinePlaceholder":316},true,"\n",[298,319,321],{"class":300,"line":320},4,[298,322,323],{},"# And this is the v1 interface which will be deprecated some day.\n",[298,325,327],{"class":300,"line":326},5,[298,328,329],{},"tectonic my-file.tex\n",[10,331,332,333,335,336,339,340,342,343,87,346,349,350,352,353,355,356,101],{},"The second tool in the box is ",[77,334,170],{}," which is a cross-platform & modern\nalternative to GNU Make. The tool is also a single binary & which was written\nusing Go, so you can expect it to be pretty fast & responsive! Besides, unlike\nGNU Make's ",[77,337,338],{},"Makefile",", ",[77,341,170],{}," uses a ",[77,344,345],{},"Taskfile.yml",[39,347,348],{},"notice its an YAML file",")\nwhich is easier & faster to write, maintain & distribute. So if you're not\nwell-acquainted with the syntax of ",[77,351,338],{},", the ",[77,354,345],{}," would be a\ngodsend for you. If you're not well-acquainted with YAML, check out\n",[14,357,360],{"href":358,"rel":359},"https:\u002F\u002Flearnxinyminutes.com\u002Fdocs\u002Fyaml",[18],"this resource to learn it in a couple of minutes",[10,362,363,364,366,367,373],{},"I've also share an example ",[77,365,345],{}," in the next section for your reference\nbut I also suggest checking out the\n",[14,368,370,371],{"href":166,"rel":369},[18],"official documentations on ",[77,372,170],{}," as well.",[10,375,376,377,380,381,384,385,388,389,391,392,394],{},"The third tool I use is Visual Studio Code (",[39,378,379],{},"and on occasions Neovim as well",").\nThis is perhaps the only tool-agnostic aspect of the entire workflow & you're\nfree to choose any Text Editor of your personal preferences! But just so you\nknow, I chose VSCode for it's plugin ecosystem (",[39,382,383],{},"hence allowing me to extend\nit's base features",") plus its superb LSP support. You're free to choose ",[34,386,387],{},"ANY","\nText Editor of your choice to write the ",[77,390,79],{}," files. You only need them on a\nlocal machine for compilation to ",[77,393,100],{}," file formats. Hence, in the next section\nlet's dive deeper into my personal workflow & see how you can take inspiration\nfrom it as well.",[51,396,398],{"id":397},"the-modern-latex-workflow","The Modern LaTeX Workflow",[10,400,401],{},"Throughout the rest of the article there's been only a brief mention of the need\nof a more modern LaTeX workflow & the tools to make it happen. Hence, this\nsection of the article attempts to discuss the nitty-gritty details of the LaTeX\nworkflow! But before proceeding ahead, make sure you've the necessary tools\ninstalled on your local machine.",[10,403,404,405,407],{},"The first step of the workflow is generating a boilerplate template to base our\nLaTeX work off of. To help us in that regards, ",[77,406,155],{}," provides us a handy\ncommand to get started;",[289,409,413],{"className":410,"code":411,"language":412,"meta":294,"style":294},"language-bash shiki shiki-themes everforest-dark","# Note, the v1 interface doesn't provide an equivalent command!\ntectonic -X new\n","bash",[77,414,415,421],{"__ignoreMap":294},[298,416,417],{"class":300,"line":301},[298,418,420],{"class":419},"s67c6","# Note, the v1 interface doesn't provide an equivalent command!\n",[298,422,423,426,430],{"class":300,"line":307},[298,424,155],{"class":425},"sRC7j",[298,427,429],{"class":428},"sySyC"," -X",[298,431,432],{"class":428}," new\n",[10,434,435,436,438,439,441,442,444,445,101],{},"It creates a couple of ",[77,437,79],{}," files (to be compiled in to a ",[77,440,100],{},") & a TOML\nfile. The later of which ",[77,443,155],{}," uses to identify the location of the files\nto compile & much more! To know more about it, I recommend reading its\n",[14,446,449],{"href":447,"rel":448},"https:\u002F\u002Ftectonic-typesetting.github.io\u002Fbook\u002Flatest\u002Fv2cli\u002Fnew.html",[18],"official documentations",[10,451,452,453,455],{},"But there's a little caveat you should be aware of when using the officially\nrecommended way of bootstrapping a LaTeX project! The filenames doesn't follow a\nstandard practice but ",[77,454,155],{}," won't be bothered if you don't do so. Hence,\ndeviating from the recommended file-naming system, here's what my project's base\nstructure looks like:",[289,457,459],{"className":291,"code":458,"language":293,"meta":294,"style":294},".\n├── src\u002F\n│   ├── subdirectories\u002F\n│   │   └── ...\n│   ├── preamble.tex\n│   └── main.tex\n└── Tectonic.toml\n",[77,460,461,466,471,476,481,486,492],{"__ignoreMap":294},[298,462,463],{"class":300,"line":301},[298,464,465],{},".\n",[298,467,468],{"class":300,"line":307},[298,469,470],{},"├── src\u002F\n",[298,472,473],{"class":300,"line":313},[298,474,475],{},"│   ├── subdirectories\u002F\n",[298,477,478],{"class":300,"line":320},[298,479,480],{},"│   │   └── ...\n",[298,482,483],{"class":300,"line":326},[298,484,485],{},"│   ├── preamble.tex\n",[298,487,489],{"class":300,"line":488},6,[298,490,491],{},"│   └── main.tex\n",[298,493,495],{"class":300,"line":494},7,[298,496,497],{},"└── Tectonic.toml\n",[10,499,500,501,508,509,511,512,514,515,518,519,526],{},"I follow the tried-and-tested\n\"",[14,502,505],{"href":503,"rel":504},"https:\u002F\u002Fen.wikibooks.org\u002Fwiki\u002FLaTeX\u002FModular_Documents",[18],[39,506,507],{},"Modular Documents","\"\nstructuring for writing individual ",[77,510,79],{}," files containing specific & atomic\ncontents of the final product. To stitch together all the ",[77,513,79],{}," files\n\"",[39,516,517],{},"properly","\" during compilation, the\n",[14,520,523],{"href":521,"rel":522},"http:\u002F\u002Fwww.ctan.org\u002Fpkg\u002Fsubfiles",[18],[77,524,525],{},"subfiles"," package comes to my rescue.",[10,528,529,530,533,534,536],{},"If this is your first time writing\u002Fusing LaTeX, I ",[34,531,532],{},"STRONGLY"," recommend reading\nthe hyperlinked wikia page of \"",[39,535,507],{},"\" before venturing further.",[10,538,539,540,543,544,546,547,550,551,553],{},"You see, of the many quirks of LaTeX's antiquated nature is; it doesn't\n\"",[39,541,542],{},"import","\" other ",[77,545,79],{}," like you would expect in any other programming language!\nThis has been a major pain & disappointment for me (",[39,548,549],{},"it still is but that's a\nstory for another day","). Without the ",[77,552,525],{}," package, the book(s) I'm\ncurrently working on would've been painful to write in LaTeX.",[10,555,556,557,567,568,571,572,575,576,578,579,582,583,585,586,588,589,592,593,600],{},"On that note, the root of the project directory (",[39,558,559,560],{},"which is usually\nversion-controlled for me using ",[14,561,564],{"href":562,"rel":563},"https:\u002F\u002Fgit-scm.com",[18],[77,565,566],{},"git",") contains the\n",[77,569,570],{},"src"," directory & the ",[77,573,574],{},"Tectonic.toml"," file. The ",[77,577,570],{}," directory contains the\nsubdirectories of the different sections of say a book\u002Fthesis (",[39,580,581],{},"ignore it if you\ndeem it necessary","). And the ",[77,584,574],{}," file on the hand is responsible for\nletting ",[77,587,155],{}," know where it can find the ",[77,590,591],{},"preamble.tex",", the\n",[14,594,597],{"href":595,"rel":596},"https:\u002F\u002Fen.wikibooks.org\u002Fwiki\u002FLaTeX\u002FModular_Documents#The_main_document_document.tex",[18],[77,598,599],{},"main.tex","\nfile & the directory holding all those files.",[10,602,603,604,606,607,609,610,613,614,617],{},"As mentioned earlier, the ",[77,605,599],{}," file is responsible for importing the\n",[39,608,253],{}," & the rest of the sections (",[39,611,612],{},"if applicable",") located within the\n\"",[39,615,616],{},"subdirectories","\" at compile time.",[10,619,620,621,623,624,626,627,629],{},"The ",[77,622,574],{}," file other hand is how you configure ",[77,625,155],{}," to do some\nheavy-lifting for you. Although I observed its not a strict requirement, it's\nbest to leave it as it is because having it doesn't hurt anyone. Here's what the\ncontents of the file looks like when I'm working with ",[77,628,155],{},":",[289,631,635],{"className":632,"code":633,"language":634,"meta":294,"style":294},"language-toml shiki shiki-themes everforest-dark","[doc]\n# The name of the project\nname = \"project-name\"\n# The tarball for 'tectonic' to use for packages.\nbundle = \"https:\u002F\u002Fdata1.fullyjustified.net\u002Ftlextras-2021.3r1.tar\"\n\n[[output]]\n# The name of the generated PDF file.\nname = \"main\"\n# The file-format to output after compilation.\ntype = \"pdf\"\n# The name of the 'preamble.tex' file, by default its '_preamble.tex'.\npreamble = \"preamble\"\n# The root file 'tectonic' will look for, by default it's 'index.tex'.\nindex = \"main\"\n","toml",[77,636,637,642,647,652,657,662,666,671,677,683,689,695,701,707,713],{"__ignoreMap":294},[298,638,639],{"class":300,"line":301},[298,640,641],{},"[doc]\n",[298,643,644],{"class":300,"line":307},[298,645,646],{},"# The name of the project\n",[298,648,649],{"class":300,"line":313},[298,650,651],{},"name = \"project-name\"\n",[298,653,654],{"class":300,"line":320},[298,655,656],{},"# The tarball for 'tectonic' to use for packages.\n",[298,658,659],{"class":300,"line":326},[298,660,661],{},"bundle = \"https:\u002F\u002Fdata1.fullyjustified.net\u002Ftlextras-2021.3r1.tar\"\n",[298,663,664],{"class":300,"line":488},[298,665,317],{"emptyLinePlaceholder":316},[298,667,668],{"class":300,"line":494},[298,669,670],{},"[[output]]\n",[298,672,674],{"class":300,"line":673},8,[298,675,676],{},"# The name of the generated PDF file.\n",[298,678,680],{"class":300,"line":679},9,[298,681,682],{},"name = \"main\"\n",[298,684,686],{"class":300,"line":685},10,[298,687,688],{},"# The file-format to output after compilation.\n",[298,690,692],{"class":300,"line":691},11,[298,693,694],{},"type = \"pdf\"\n",[298,696,698],{"class":300,"line":697},12,[298,699,700],{},"# The name of the 'preamble.tex' file, by default its '_preamble.tex'.\n",[298,702,704],{"class":300,"line":703},13,[298,705,706],{},"preamble = \"preamble\"\n",[298,708,710],{"class":300,"line":709},14,[298,711,712],{},"# The root file 'tectonic' will look for, by default it's 'index.tex'.\n",[298,714,716],{"class":300,"line":715},15,[298,717,718],{},"index = \"main\"\n",[10,720,721,722,726],{},"I've left comments in the TOML file to make it pretty self-explanatory. But I\nwould still recommend checking out it related\n",[14,723,449],{"href":724,"rel":725},"https:\u002F\u002Ftectonic-typesetting.github.io\u002Fbook\u002Flatest\u002Fref\u002Ftectonic-toml.html",[18],"\nfor more information.",[10,728,729,730,732,733,735],{},"The gist is, you can use this configuration file to instruct ",[77,731,155],{}," about\nhow & where to find the source files to compile. As such you no longer have to\npass a specific ",[77,734,79],{}," file to compile thus reducing errors & unsatisfactory\ncompilation results. In other words, the following set commands work:",[289,737,739],{"className":291,"code":738,"language":293,"meta":294,"style":294},"# Use this command to build the final PDF product.\ntectonic -X build\n# Use this command to dump partial sections of the whole document.\ntectonic -X dump\n# Use this command to compile a standalone PDF file like an article or resume.\ntectonic -X compile\n# Use this command to watch for changes & build the PDF as you write the LaTeX files.\ntectonic -X watch\n",[77,740,741,746,750,755,760,765,770,775],{"__ignoreMap":294},[298,742,743],{"class":300,"line":301},[298,744,745],{},"# Use this command to build the final PDF product.\n",[298,747,748],{"class":300,"line":307},[298,749,310],{},[298,751,752],{"class":300,"line":313},[298,753,754],{},"# Use this command to dump partial sections of the whole document.\n",[298,756,757],{"class":300,"line":320},[298,758,759],{},"tectonic -X dump\n",[298,761,762],{"class":300,"line":326},[298,763,764],{},"# Use this command to compile a standalone PDF file like an article or resume.\n",[298,766,767],{"class":300,"line":488},[298,768,769],{},"tectonic -X compile\n",[298,771,772],{"class":300,"line":494},[298,773,774],{},"# Use this command to watch for changes & build the PDF as you write the LaTeX files.\n",[298,776,777],{"class":300,"line":673},[298,778,779],{},"tectonic -X watch\n",[10,781,782,784,785,787,788,790,791,794,795,794,797,800],{},[34,783,207],{},": None of the commands required the user to pass a ",[77,786,79],{}," file.\n",[77,789,155],{}," is simply smart enough (",[39,792,793],{},"thanks to the"," ",[77,796,574],{},[39,798,799],{},"file",") to\nfigure out everything!",[10,802,803,804,806],{},"On that note, I don't know about you but having to not just remember but type\nout multi-words commands on the Shell is tiresome for me! This is where ",[77,805,170],{},"\ncomes handy for me, it not only simplifies multiple set of commands for me but\nalso helps in documenting them!",[10,808,809,810,812],{},"For reference, here's what a minimal ",[77,811,345],{}," looks like for some of my\nsmall-scale LaTeX projects:",[289,814,818],{"className":815,"code":816,"language":817,"meta":294,"style":294},"language-yaml shiki shiki-themes everforest-dark","version: 3\n\ntasks:\n  compile:\n    desc: Compile the LaTeX files in to a PDF.\n    cmds:\n      - tectonic -X build --keep-intermediates --keep-logs\n\n  cleanup:\n    desc:\n      Remove unnecessary & redundant stuff like the log files & improperly\n      generated PDF files.\n    cmds:\n      - rm --recursive --force build\n","yaml",[77,819,820,825,829,834,839,844,849,854,858,863,868,873,878,882],{"__ignoreMap":294},[298,821,822],{"class":300,"line":301},[298,823,824],{},"version: 3\n",[298,826,827],{"class":300,"line":307},[298,828,317],{"emptyLinePlaceholder":316},[298,830,831],{"class":300,"line":313},[298,832,833],{},"tasks:\n",[298,835,836],{"class":300,"line":320},[298,837,838],{},"  compile:\n",[298,840,841],{"class":300,"line":326},[298,842,843],{},"    desc: Compile the LaTeX files in to a PDF.\n",[298,845,846],{"class":300,"line":488},[298,847,848],{},"    cmds:\n",[298,850,851],{"class":300,"line":494},[298,852,853],{},"      - tectonic -X build --keep-intermediates --keep-logs\n",[298,855,856],{"class":300,"line":673},[298,857,317],{"emptyLinePlaceholder":316},[298,859,860],{"class":300,"line":679},[298,861,862],{},"  cleanup:\n",[298,864,865],{"class":300,"line":685},[298,866,867],{},"    desc:\n",[298,869,870],{"class":300,"line":691},[298,871,872],{},"      Remove unnecessary & redundant stuff like the log files & improperly\n",[298,874,875],{"class":300,"line":697},[298,876,877],{},"      generated PDF files.\n",[298,879,880],{"class":300,"line":703},[298,881,848],{},[298,883,884],{"class":300,"line":709},[298,885,886],{},"      - rm --recursive --force build\n",[10,888,889,890,892],{},"The minimal ",[77,891,345],{}," we shared up there is capable of performing the\nfollowing tasks:",[118,894,895,906],{},[121,896,897,898,901,902,905],{},"Compile the ",[77,899,900],{},"build\u002Fmain\u002Fmain.pdf"," file by simply running ",[77,903,904],{},"task compile",". You\nno longer have to remember complicated sets of CLI commands.",[121,907,908,909,912],{},"Cleanup the unnecessary files like log files, improperly generated PDF files\n& much more by invoking the ",[77,910,911],{},"task cleanup"," command.",[10,914,915,916,919,920,923,924,927,928,794,931,794,933,46],{},"3.And also document each of the individual ",[77,917,918],{},"tasks"," for future reference. So, in\ncase you ever forget a workflow, simply run ",[77,921,922],{},"task --list"," (or in short\n",[77,925,926],{},"task -l",") to get a \"",[39,929,930],{},"list of",[77,932,918],{},[39,934,935],{},"& a description of their\nfunctionality",[10,937,938,939,941,942,947,948,950],{},"Of course, you can configure ",[77,940,170],{}," to simplify & automate a lot more than what\nwe discussed so far! So, I suggest checking out the\n",[14,943,946],{"href":944,"rel":945},"https:\u002F\u002Ftaskfile.dev\u002Fusage",[18],"usage guidelines"," for ",[77,949,170],{}," to customise your\nworkflow further.",[51,952,954],{"id":953},"suggestions-for-improvements","Suggestions for Improvements",[10,956,957],{},"As I mentioned earlier, LaTeX is an archaic & antiquated piece of software &\nyou're bound to stumble across a couple of hiccups here & there. Even if you\nfollow the workflow I shared in today's write-up, there's no guranteed it'll\nwork as expected. Fortunately, the tools I mentioned above does ease our\nworkflow by an exponential degree. The said workflow is by no means set in stone\n& is a mere source of inspiration, so feel free to use it to develop your own\npersonal LaTeX workflow!",[10,959,960,961,963,964,966,967,969,970,973,974,976,977,986],{},"Some aspects of the workflow which can be improved further are things like\ndocumentations of the ",[77,962,170],{},". As you develop your workflow over time, your\n",[77,965,345],{}," will grow larger & you won't be able to remember each of those\nindividual ",[77,968,170],{},"! So yes, documentations are never enough, the more of it (",[39,971,972],{},"and\nwherever necessary","), the better. ",[77,975,170],{}," supports\n\"",[14,978,981,794,984],{"href":979,"rel":980},"https:\u002F\u002Ftaskfile.dev\u002Fusage\u002F#display-summary-of-task",[18],[39,982,983],{},"a long-format \"summary\" of an individual",[77,985,170],{},"\",\nutilise it well.",[10,988,989,990,992,993,995,996,1003,1004,1011],{},"The example ",[77,991,345],{}," I shared here is minimal, don't stick to it try &\ndevelop your own workflow! Create a couple more ",[77,994,170],{}," where each one performs a\nspecific job, like\n\"",[14,997,1000],{"href":998,"rel":999},"https:\u002F\u002Ftectonic-typesetting.github.io\u002Fbook\u002Flatest\u002Fv2cli\u002Fwatch.html",[18],[39,1001,1002],{},"build & watch for changes in the LaTeX files","\"\nor\n\"",[14,1005,1008],{"href":1006,"rel":1007},"https:\u002F\u002Ftectonic-typesetting.github.io\u002Fbook\u002Flatest\u002Fv2cli\u002Fbuild.html#command-line-options",[18],[39,1009,1010],{},"build & open the generated PDF file for preview","\"\n& much more. Pretty much the sky is your limit to what you want to automate with\nthe tools mentioned in this workflow.",[10,1013,1014,1015,1018,1019,1026,1027,237],{},"If you still need a more hands-on approach to help you develop your own LaTeX\nworkflow, you can check out one of the book project I'm working on. Its been\nopen-sourced for a while now & you can even read it for free (",[39,1016,1017],{},"right now &\nforever","). So go & check out the repository of the\n\"",[14,1020,1023],{"href":1021,"rel":1022},"https:\u002F\u002Fgithub.com\u002FJarmos-san\u002Ftechnical-book",[18],[39,1024,1025],{},"Writing a Technical Book in LaTeX","\"\n(",[34,1028,1029],{},[39,1030,1031],{},"the book name isn't decided yet!",[10,1033,1034],{},"Or if you need some refresher on LaTex, here're some helpful resources:",[145,1036,1037,1053,1063,1073],{},[121,1038,1039,1040,1047,1048],{},"\"",[14,1041,1044],{"href":1042,"rel":1043},"https:\u002F\u002Ftex.stackexchange.com\u002Fq\u002F11",[18],[39,1045,1046],{},"What're Some Good Learning Resources for a LaTex Beginner","\"\n| ",[14,1049,1052],{"href":1050,"rel":1051},"https:\u002F\u002Ftex.stackexchange.com",[18],"Tex - Stack Exchange",[121,1054,1055,1062],{},[14,1056,1039,1059,1039],{"href":1057,"rel":1058},"https:\u002F\u002Fwww.overleaf.com\u002Flearn\u002Flatex\u002FLearn_LaTeX_in_30_minutes",[18],[39,1060,1061],{},"Learn LaTex in 30 Minutes","\n| Overleaf - The Online LaTex Editor",[121,1064,1065,1072],{},[14,1066,1039,1069,1039],{"href":1067,"rel":1068},"https:\u002F\u002Fwww.learnlatex.org",[18],[39,1070,1071],{},"Learn LaTex"," | Learn LaTex.org",[121,1074,1075,1082],{},[14,1076,1039,1079,1039],{"href":1077,"rel":1078},"https:\u002F\u002Ftypeset.io\u002Fresources\u002Flearn-latex-beginners-step-by-step-guide",[18],[39,1080,1081],{},"Learn LaTex - A Beginner's Step-by-Step Guide","\n| Deeptanshu D - SciSpace",[10,1084,1085,1086,1091,1092,1091,1097,1101],{},"On a final note I would like to let you know, if you still found working with\nLaTeX difficult, feel free to reach out to me! You can find me on\n",[14,1087,1090],{"href":1088,"rel":1089},"https:\u002F\u002Ftwitter.com\u002FJarmosan",[18],"Twitter","\u002F",[14,1093,1096],{"href":1094,"rel":1095},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fjarmos",[18],"LinkedIn",[14,1098,1100],{"href":1099},"mailto:somraj.mle@gmail.com","Email","\n& my inbox is always open! So, be sure to put aside your hesitations reach out\nto me with your queries.",[1103,1104,1105],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s67c6, html code.shiki .s67c6{--shiki-default:#859289;--shiki-default-font-style:italic}html pre.shiki code .sRC7j, html code.shiki .sRC7j{--shiki-default:#A7C080}html pre.shiki code .sySyC, html code.shiki .sySyC{--shiki-default:#DBBC7F}",{"title":294,"searchDepth":307,"depth":307,"links":1107},[1108,1109,1110,1111],{"id":53,"depth":307,"text":54},{"id":135,"depth":307,"text":136},{"id":397,"depth":307,"text":398},{"id":953,"depth":307,"text":954},{"url":1113,"alt":1114},"https:\u002F\u002Fik.imagekit.io\u002Fjarmos\u002Fautomated-workflow-for-latex.png?updatedAt=1702974989273","An automated & modern workflow for LaTex","Revitalize your LaTeX workflow with modern tools! Sidestep TeX Live's bloat and Overleaf's online constraints. Embrace `tectonic`—a Rust-based, efficient LaTeX engine. Harness `task` for streamlined automation. Craft modular documents with `subfiles` for seamless collaboration. Dive into a rejuvenated, efficient LaTeX experience! 🚀📄🔧","md",{},"\u002Fblogs\u002Fautomated-workflow-for-latex","2021-09-04",{"title":5,"description":1115},{"loc":1118},"blogs\u002Fautomated-workflow-for-latex","1U4O5QyPMhHBJlnK2gxb3q6V4w_G4YSOWjAEXV3lSto",1788689045440]