I've got a LaTeX document that's build from many smaller files. When I'm editing text or formulas I usually look for some characteristic text and do something like:
find -name "*.tex" > t
grep -n 'text of interest' `cat t` | tee v
vim -q v
I see that there's a currfile
package. I'd like to know if there's a way that I could use the \currfilename
command in that package to stamp the margin with the filename (and/or path), or perhaps even just to generate a footnote.
EDIT: I found a way to do this in a standalone example, and that's posted below as a self-answer, which I initially thought to be sufficient. However, that answer used fancyhdr, and I'm using the classicthesis template which uses scrpage2, so a fancyhdr solution doesn't work. I've been able to make updates to classicthesis.sty to show the filenames in the chapter and section headers using \currfilepath
, but would really like this to be a page level footer (one that I'd eventually make conditional on the drafting flag).
This is the scrpage2 section from classicthesis that I'd like to modify:
% ********************************************************************
% headlines
% ********************************************************************
\PassOptionsToPackage{automark}{scrpage2}
\RequirePackage{scrpage2} % provides headers and footers (KOMA Script)
\clearscrheadings
\setheadsepline{0pt}
\ifthenelse{\boolean{@nochapters}}%
{\relax}%
{\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\enspace\spacedlowsmallcaps{#1}}}
\lehead{\mbox{\llap{\small\thepage\kern2em}\headmark\hfil}}
\rohead{\mbox{\hfil{\headmark}\rlap{\small\kern2em\thepage}}}
\renewcommand{\headfont}{\small}
% \DeclareRobustCommand{\fixBothHeadlines}[2]{} % <--- ToDo
% hack to get the content headlines right (thanks, Lorenzo!)
\def\toc@heading{%
\ifthenelse{\boolean{@nochapters}}%
{\section*{\contentsname}}%nochapters
{\chapter*{\contentsname}}%chapters
\@mkboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}}
pdfpages
?--synctex
compile time option that is built into most of the editors. You simply right click on the output PDF and the actual source file that produced it opened. This will save you a lot of time.