-
Notifications
You must be signed in to change notification settings - Fork 131
Description
(originally found by @T-F-S in https://tex.stackexchange.com/a/750935)
Currently for \inputminted[<options>]{<language>}{<filename>}, minted treats
- everything in
<filename>after the first/as the base filename, and - everything in the base filename after the first
.as file extension
minted/latex/minted/minted.dtx
Lines 3971 to 3992 in 19ea6fc
| \gdef\minted@iffasthighlightmode@buffertempfile@i#1/#2\FV@Sentinel{% | |
| \if\relax\detokenize{#2}\relax | |
| \expandafter\@firstoftwo | |
| \else | |
| \expandafter\@secondoftwo | |
| \fi | |
| {\minted@iffasthighlightmode@buffertempfile@ii#1.\FV@Sentinel}% | |
| {\minted@iffasthighlightmode@buffertempfile@i#2\FV@Sentinel}} | |
| \gdef\minted@iffasthighlightmode@buffertempfile@ii#1.#2\FV@Sentinel{% | |
| \if\relax\detokenize{#2}\relax | |
| \expandafter\@gobble | |
| \else | |
| \expandafter\@firstofone | |
| \fi | |
| {\minted@iffasthighlightmode@buffertempfile@iii#2\FV@Sentinel}} | |
| \gdef\minted@iffasthighlightmode@buffertempfile@iii#1.\FV@Sentinel{% | |
| \ifcsname minted@buffertempfileextension@#1\endcsname | |
| \expandafter\@firstofone | |
| \else | |
| \expandafter\@gobble | |
| \fi | |
| {\minted@iffasthighlightmode@buffertempfile@iv}} |
When <filename> contains multiple /s, in parsing for the base filename, it's more robust to find everything after the last, not the first /.
When the base filename contains multiple .s, for example \jobname.tcb.temp, the primary file extension might be more meaningful to minted (the .temp part), rather than the full file extension (the .tcb.temp part).
The expl3 function \file_parse_full_name:nNNN {<full name>} <dir> <name> <ext> fits exactly the requirements here. If non-expl3 catcode scheme is preferred, \UseName{file_parse_full_name:nNNN}... can be used instead.