5
votes
1answer
56 views

How to check whether two labels fall on the same page?

I'd like to have something like 5--10 in the header of an article (my document is a journal issue) if it spans the pages 5-10, and 5 (as opposed to 5--5) if it is short and fits on one page. I use ...
4
votes
1answer
80 views

\ifnumcomp + \ref

I have a definition with 20 cases or so, and a proof about that definition has one case for each case of the definition. I'd like the proof cases to reorder themselves automatically when I reorder ...
7
votes
1answer
64 views

How to use \ref command in the test block of \ifnum?

Is there a way to use \ref{} inside the test part of \ifnum. The following example runs into an error. \documentclass{article} \begin{document} \begin{table} \caption{ex} \label{tab:ex} ...
10
votes
1answer
103 views

How to make a conditional reference to a text label

I would like to make a conditional reference to an optional label in my latex document, see the Minimum Working Example below. Hence, IF the label exists somewhere in the document, THEN a reference ...
7
votes
1answer
85 views

Decide whether a label occurs in the current chapter

I want to decide if some label occurs in the same chapter as the current one. I use the zref package as suggested in Chapter ref with LaTeX to find out in which chapter a label occurs, and compare ...
6
votes
1answer
91 views

How can I test if a label has been marked?

I have a long document which includes several files. In some cases I may want to include those files in different orders. In some cases, I may want to adapt the text depending on whether a specific ...
4
votes
2answers
102 views

How to test if a given reference belongs to a list of labels?

This question is a prolongation of my previous question How to choose from a list for using result in \ref?. I got really good and interesting answers. Unfortunately I can not implement them for my ...
2
votes
2answers
168 views

Reference Page of Float Object only if Page isn't actual page

Is it possible to tell LaTeX only use \pageref if the referenced object isn't on actual page? if \pageref{fig:hello_world} != self.page then \pageref{fig:hello_world} end
7
votes
1answer
118 views

How can I conditionally include the page number in a cross-reference (when the object referenced is on a different page)?

When a cross-reference to a figure is not on the same page as the figure, I would like to include the page number in the figure. But when they are on the same page, this is redundant--and I want to ...
3
votes
3answers
281 views

Show “Page X of Y” only if there are multiple pages?

I'm trying to add a line in the header to be "Page X of Y", but only if there are multiple pages. My main problem is how to format the if statement. So far I have \ifx \pageref{LastPage} 1 ...
6
votes
2answers
1k views

Figure numbering without the figure

It is quite common for academic journals to require article submissions to not include the figures, which are submitted separately. Then the journal staff position the figures in the text manually. ...
6
votes
1answer
191 views

Asserting reference inequality

Is there a way for including assertions in a LaTeX document? I want to check that some condition is true, and only allow compilation of the document if it is (or at least complain otherwise). ...