Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 0.61 KB | None | 0 0
  1. \documentclass{article}
  2.  
  3. \usepackage{etoolbox}
  4.  
  5. \newcounter{listcount}
  6.  
  7. \newcommand{\ppath}[2][$\;\triangleright\;$]{%
  8.   \setcounter{listcount}{0}% Restart list count
  9.   \renewcommand*{\do}[1]{\stepcounter{listcount}}% Count list item
  10.   \docsvlist{#2}% Process list and count items
  11.   \def\nextitem{\def\nextitem{#1}}% Separator
  12.   \renewcommand*{\do}[1]{%
  13.     \addtocounter{listcount}{-1}%
  14.     \ifnum\value{listcount}=0 ~and~\else\nextitem\fi\textsf{##1}}% How to process each item
  15.   \docsvlist{#2}% Process list
  16. }
  17.  
  18. \begin{document}
  19.  
  20. A decent file path is \ppath[, ]{File,New,Document}.
  21.  
  22. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement