I did the following test in the Terminal (bash
shell)
cd
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs iCloudFolder
TEXMFHOME=~/iCloudFolder/texmf pdflatex test
(this temporarily overrides the inner variable TEXMFHOME
) and got
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2018-04-01> patch level 5
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo))
(/Users/enrico2013/iCloudFolder/texmf/tex/latex/test.sty
FOUND
) (./test.aux) [1{/usr/local/texlive/2018/texmf-var/fonts/map/pdftex/updmap/pdf
tex.map}] (./test.aux) )</usr/local/texlive/2018/texmf-dist/fonts/type1/public/
amsfonts/cm/cmr10.pfb>
Output written on test.pdf (1 page, 8685 bytes).
Transcript written on test.log.
on my console.
The file test.tex
contains
\documentclass{article}
\usepackage{test}
\begin{document}
x
\end{document}
whereas the texmf/tex/latex
folder in the iCloud drive has test.sty
which just contains
\typeout{FOUND}
As you see, the output is as expected.
Now just change the top level texmf.cnf
file in /usr/local/texlive/2018
from
% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
TEXMFHOME = ~/Library/texmf
TEXMFVAR = ~/Library/texlive/2018/texmf-var
TEXMFCONFIG = ~/Library/texlive/2018/texmf-config
to have
TEXMFHOME = ~/iCloudFolder/texmf
then copy texmf
in ~/Library
to the iCloud drive.
Note that this makes no assumption on what you sync with iCloud.
TEXINPUTS="path/to/sty//:$TEXINPUTS"
before compiling?