Win 및 OSX의 bib 파일 경로

Win 및 OSX의 bib 파일 경로

저는 집에서는 Windows를 사용하고 대학에서는 OSX를 사용합니다. 내 tex 파일은 Dropbox를 통해 동기화됩니다. 그러나 이러한 시스템에서는 경로 규칙이 분명히 다릅니다. 결과적으로 이런 글을 써야 겠네요

\bibliography{D:/TeX/mybibfile}

\bibliography{/Users/df/TeX/mybibfile}

운영 체제에 따라 위 줄의 주석 처리/주석 해제를 수행합니다.

좀 더 '우아하고/영리한' 방법이 있나요?

WBR,

드미트리

답변1

이 같은?

ifplatform패키지와 해당 매크로를 사용하여 \if....일부 명령을 테스트하고 정의합니다.

\documentclass{article}

\usepackage{ifplatform}


\newcommand{\DropboxPathPrefix}{%
  \ifmacosx%
  /users/def/TeX%
  \else%
  \ifwindows%
  D:/TeX%
  \else%
  \iflinux%
  .%   (local directory) Change to appropiate values
  \else% 
  \ifcygwin%
  % ????
  \fi%
  \fi%
  \fi%
  \fi%
}


\newcommand{\PathToBibFile}{\DropBoxPrefix/standardbiblio}

\begin{document}

%% Somes stuff in here


\cite{Lam94}

\bibliographystyle{unsrt}
\bibliography{\PathToBibFile}



\end{document}

( standardbiblio.bib실제로는 biblio.bib의 파일 입니다 texmf-dist/bibtex/bib/msc)

여기에 이미지 설명을 입력하세요

관련 정보