diff --git a/autocompile.sh b/autocompile.sh index f79b03d2760d43ea5c152ccff7053f949c66e1f0..cb580ace3d2ab7dfc8c492274b1adf99a7fc8c22 100755 --- a/autocompile.sh +++ b/autocompile.sh @@ -8,6 +8,7 @@ [ ! -e main.tex ] && [ -e config/main.tex ] && \ cp config/main.tex . && \ ln -s config/autocompile.sh . && \ + ln -s config/latexmkrc . && \ ln -s config/.gitignore . git gc --auto diff --git a/bind.sty b/bind.sty index ee56e0fdb44d0fcd6f555ef433a9dcc483436665..b4ce21dae1c360e82a16ccb31d056c131c0910b0 100644 --- a/bind.sty +++ b/bind.sty @@ -30,7 +30,7 @@ \RequirePackage{colortbl} \RequirePackage[poster]{tcolorbox} \tcbuselibrary{breakable,raster} -%\tcbset{enhanced, attach boxed title to top center={yshift*=-3mm},drop shadow east,colback=white,arc=6mm,outer arc=1mm} +%\tcbset{enhanced, attach boxed title to top center={yshift*=-3mm},drop shadow east,callback=white,arc=6mm,outer arc=1mm} \tcbset{enhanced, drop shadow east, colframe=black,colbacktitle=black!5!white, @@ -47,11 +47,29 @@ interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west) } } +\RequirePackage{xr-hyper} \RequirePackage[ pdfstartpage=2, bookmarks=true]% {hyperref} +%%%%%%%%%% Allow for external referencing + +\newcommand*{\externalReferent}[1]{ + \newtoggle{#1} + \IfFileExists{../#1/main.tex}{ + \makeatletter + \@addtofilelist{../#1/main.tex} + \@addtofilelist{../#1/main.aux}% + \makeatother + \externaldocument{../#1/main}% + \settoggle{#1}{true} + }% + {\typeout{No file #1.} + \settoggle{#1}{false} + } +} + %%%%%%%%%% Section Headers %%%%%%%%%% diff --git a/latexmkrc b/latexmkrc new file mode 100644 index 0000000000000000000000000000000000000000..755cb5d1b1fc64645a6b0f6ea7fb1beae0eba21a --- /dev/null +++ b/latexmkrc @@ -0,0 +1,8 @@ +add_cus_dep( 'tex', 'aux', 0, 'makeexternaldocument' ); + +sub makeexternaldocument { + if (!($root_filename eq $_[0])) + { + system( "latexmk -cd -pdf \"$_[0]\"" ); + } +}