DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

latexteada
latexteada

Posted on

LaTeX: Cross Referencing

Hello :) How are you today?

In my last post I told you a situation where you can use cross referencing, and, I told you some commands.

In this post I am going to tell you about cross referencing and some stuff related with that. Let's go !! :)

What is Cross Referencing?

Cross referencing is a tool which can be used to reference an element without having to remember properties of the element.

Cross referencing is dynamic in LaTeX, this means, the reference actualizes itself automatically, you do not need to be worrying about it

What can I refer in my document?

Well you can refer each single thing that we have checked until now, this is: Sections, Figures, Tables, Pages, etc.

  • Until now we have checked that, but, in a future we are going to talk about formulas and math in LaTeX, and, of course, you can refer to equations too :)

Labeling the elements

We need to label the element, this will allow us to refer the element. We label the element with

\label{myLabel}
Enter fullscreen mode Exit fullscreen mode

Where myLabel is the name which we need to use to refer to that element

But, wait!!! I can refer many things, how can I distinguish between all those elements without writing long names to my labels? Well...

Referencing conventions

These are not officials, but these are very helpful

  • ch: Chapter
  • sec: Section
  • subsec: Subsection
  • subsubsec: Subsubsection
  • fig: Figure
  • tbl: Table

So if we want to label the Chapter First and our Figure White

\label{ch: First}
\label{fig: White}
Enter fullscreen mode Exit fullscreen mode

Yes, but where?

Ok, ok we have learned the \label{something} command and we can refer to everything, but

Where can I put the label command?

At the beginning? middle? top? or, maybe, at the bottom?

  • In section, subsection, subsubsection can be after the command or below
\section{My Section}
\label{sec: My Section}

or

\section{My Section}\label{sec: My Section}
Enter fullscreen mode Exit fullscreen mode

This is all for today, thank you :)

Do not forget to follow me on twitter @latexteada

Top comments (0)

All DEV content is created by the community!

Hey, if you're landing here for the first time, you should know that this website is a global community of folks who blog about their experiences to help folks like you out.

Sign up now if you're curious. It's free!