Changes

Jump to navigation Jump to search
453 bytes removed ,  02:13, 31 March 2021
no edit summary
While ConTeXt (i.e. mtxrun) already automates The [[First Document]] page provides a lot, in bigger projects I find it tedious cursory introduction to call context with all its options all the timetypesetting document using ConTeXt. One might use The [https://www.gnu.org/software/make/ make[Context]] or [https://githubpage describes the command-line options in brief.com/cereda/arara arara], but I mostly use shell scripts (on OSX and Linux)This page provides additional information for command-line options. Here are some useful snippets:
<pre>#!/bin/bash== --run ==
OS=`uname`if [ "$TEXROOT" == "" ]Process one or more files; then # setup ConTeXt’s path; I used different locations on OSX this is the default action and Linux # You might also check on the hostname or if the path exists if [ "$OS" == "Linux" ]; then source /var/opt/context/tex/setuptex /var/opt/context/tex elif [ "$OS" == "Darwin" ]; then source ~/Library/texmf/tex/setuptex ~/Library/texmf/tex fifimay be omitted.
# ulimit was 256 on older OSX versions, that's too low for bigger booksif [ `ulimit` != "unlimited" ]; then ulimit = -S -n 2048fiautopdf ==
# I like to have my PDFs versioned at least by dateISODATE=`date +"%Y-%m-%d"`Reopen the generated PDF file in the system's default PDF file viewer after recompiling a document.
PRD=$1if [ "$1" =--purgeall = "" ]; then echo Which product? ls -Alh prd_*.tex exit 1fiRESULT=${PRD}_${ISODATE}
MODE=$2if [ "$MODE" == "" ]; then echo Using lowres pictures for previewDelete all build artifacts generated during compiling of a document, such as ''.tuc'' and ''. Use log'print' parameter for highres modefiles. MOD=lowreselse # print RESULT=${RESULT}_$MODEfi
if [ "$OS" == "Darwin" ]; then OPEN='open -a Preview' SHARE-path=~/Boxelse OPENlist ="qpdfview --quiet" SHARE=~/Dropboxfi
context --jit prd_${PRD} --result=_pdf/$RESULT --mode=$MODif [ "$?" == "0" ]; then ${OPEN} _pdf/$RESULTProvide a list of paths for ConTeXt to search when processing.pdf & cp _pdf/${RESULT}.pdf ${SHARE}/projects/fi
</pre>== --result ==
Changes the output document file name. ConTeXt creates the output document file in the current working directory; this option cannot create or move the output document in a different directory. Instead, change the working directory before running ConTeXt and use the ''--path'' option to configure where ConTeXt searches for files to process.
 
 
 
[[Category:Basics]]
[[Category:Tools]]
419

edits

Navigation menu