0

Inside my main.tex I inserted a function called \loadnote which refers to an external file notepie.tex in which are considered the footnotes (with reference to this discussion) .

\usepackage{catchfilebetweentags}
\newcommand{\loadnote}[1]{%
    \ExecuteMetaData[notepie.tex]{notes#1}%
}

I have repeatedly the following error :

Latexmk: Summary of warnings from last run of (pdf)latex: Latex found
3 multiply defined reference(s)

and in the search discovered a convenient package \usepackage{showlabels} that allows viewing the position of footnotes and references to equations.

I would like to understand if it was possible to implement the changes regarding the footed notes written with the command \loadnote{}.

for example :

1.file notepie.tex:

\documentclass[8pt]{article}

\begin{document}
%<*notes004>
\footnote{La mia footnotes è questa.}
%</notes004>

\end{document}

2.in the main.tex file :

\documentclass{article}

\usepackage{catchfilebetweentags}
\newcommand{\loadnote}[1]{%
    \ExecuteMetaData[notepie.tex]{notes#1}%
}

\begin{document}

Se ho necessità di riferirmi ad una nota\loadnote{004},mentre la mia
equazione : $\tau = \mu\,\dot{\theta}{t}$\label{eq080}
\end{document}

the \loadnote is not a \label, I would like to know if it is possible to implement something to make sure that the lateral reference to the note is highlighted

thanks very much :)

enter image description here

  • 1
    yes probably you just need \SK@def \loadnote something.... A small test document showing \loadnote use would help answer the quesion – David Carlisle Nov 16 '18 at 9:43
  • @DavidCarlisle if I enter \SK@def , I have many errors and the file is not compiled – Antonio Nov 16 '18 at 10:16
  • that's what I meant by "something". showlabels lets you use \SK@def to hook into existing commands but the details depend on the command. you need \SK@def\loadnote#1{.....} where a small test file would help test what the .... has to be. (I see you added one thanks, I'll look in a bit) – David Carlisle Nov 16 '18 at 10:26
  • @DavidCarlisle I do not understand how to insert SK@def, in the command \newcommand{\loadnote}[1]{% \ExecuteMetaData[notepie.tex]{notes#1}% }, because if I insert, I get errors. – Antonio Nov 16 '18 at 11:54
2

enter image description here

This just hooks the \ref showkeys styling on to \loadnote

\documentclass{article}
\usepackage{showkeys}

\usepackage{catchfilebetweentags}
\newcommand{\loadnote}[1]{%
    \ExecuteMetaData[notepie.tex]{notes#1}%
}
\makeatletter
  \SK@def\loadnote#1{\SK@\SK@@ref{#1}\SK@loadnote{#1}}%
\makeatother

\begin{document}

Se ho necessità di riferirmi ad una nota\loadnote{004},mentre la mia
equazione : $\tau = \mu\,\dot{\theta}{t}$\label{eq080}
\end{document}
  • the solution is excellent and very useful when mentioning the quations of which I often forget the position. I will have to read about this package. I am too new to latex and I often encounter difficulties in apparently trivial aspects – Antonio Nov 17 '18 at 6:24
1

Another possibility is to use the \showlabels command of the showlabels package (which is a distinct package from showkeys):

\documentclass{article}

\usepackage{catchfilebetweentags}
\newcommand{\loadnote}[1]{%
X#1X%  \ExecuteMetaData[notepie.tex]{notes#1}%
}

\usepackage{showlabels}
\showlabels{loadnote} % handle \loadnote like \label

\begin{document}

Se ho necessità di riferirmi ad una nota\loadnote{004},mentre la mia
equazione : $\tau = \mu\,\dot{\theta}{t}$\label{eq080}
\end{document}

Example output below.

Example output

  • Thanks. never stop learning. also your solution is very interesting and I find it very tidy. – Antonio Nov 18 '18 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.