How to reference/add tables/figures/graphs, after some point in the text?












2















Im new to this, I just have a simple question.



How to declare a table let's say after I mention it in the text.



What I want:



Blah blah blah blah blah blah blah blah blah as shown in Table ~ref{tab:table_Languages}



MY TABLE CAPTION

| Rank | Language | Share | Trend |
-----------------------------
....


What I have:



MY TABLE CAPTION

| Rank | Language | Share | Trend |
-----------------------------
.....


Blah blah blah blah blah blah blah blah blah as shown in Table ~ref{tab:table_Languages}



What I use:



begin{table}
centering
label{tab:table_Languages}
setlength{tabcolsep}{0.3cm}
begin{tabular}{|c|p{2cm}|l|l|}
hline
textbf{Rank} & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
textbf{1} & Python & 26.42% & +5.2% \ hline
textbf{2} & Java & 21.20% & -1.3% \ hline
textbf{3} & JavaScript & 08.21% & -0.3% \ hline
textbf{4} & C# & 07.57% & -0.5% \ hline
textbf{5} & PHP & 07.34% & -1.2% \ hline
textbf{6} & C/C++ & 06.23% & -0.3% \ hline
textbf{7} & R & 04.13% & -0.1% \ hline
end{tabular}
end{table}


UPDATE:



Adding caption{Best ranking Programming Languages in 2019.} creates a nice caption above my example. However it doesn't fix the position and also the value of the counter for the tables is not right, as it gets the Chapter number for a reason as shown in the figure.



Demo










share|improve this question




















  • 1





    The numbering of tables depends on your used documentclass you did not tell us. If you do not want the table to float do not use floating environment table ...

    – Kurt
    Mar 6 at 19:48













  • Jeez okay thanks :S

    – Loizos Vasileiou
    Mar 6 at 20:01











  • For an in-depth discussion of how LaTeX places "floating" objects, such as figure and table environments, please see the posting How to influence the position of float environments like figure and table in LaTeX.

    – Mico
    Mar 6 at 20:19











  • Please do tell us which document class you employ.

    – Mico
    Mar 6 at 20:20











  • I have no idea what you all talk about. I just started 1 month ago. I use documentclass[bsc]{bangorcsthesis} which i use for my uni thesis. I dont know what is going on, and i don't know if that helps

    – Loizos Vasileiou
    Mar 6 at 20:27


















2















Im new to this, I just have a simple question.



How to declare a table let's say after I mention it in the text.



What I want:



Blah blah blah blah blah blah blah blah blah as shown in Table ~ref{tab:table_Languages}



MY TABLE CAPTION

| Rank | Language | Share | Trend |
-----------------------------
....


What I have:



MY TABLE CAPTION

| Rank | Language | Share | Trend |
-----------------------------
.....


Blah blah blah blah blah blah blah blah blah as shown in Table ~ref{tab:table_Languages}



What I use:



begin{table}
centering
label{tab:table_Languages}
setlength{tabcolsep}{0.3cm}
begin{tabular}{|c|p{2cm}|l|l|}
hline
textbf{Rank} & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
textbf{1} & Python & 26.42% & +5.2% \ hline
textbf{2} & Java & 21.20% & -1.3% \ hline
textbf{3} & JavaScript & 08.21% & -0.3% \ hline
textbf{4} & C# & 07.57% & -0.5% \ hline
textbf{5} & PHP & 07.34% & -1.2% \ hline
textbf{6} & C/C++ & 06.23% & -0.3% \ hline
textbf{7} & R & 04.13% & -0.1% \ hline
end{tabular}
end{table}


UPDATE:



Adding caption{Best ranking Programming Languages in 2019.} creates a nice caption above my example. However it doesn't fix the position and also the value of the counter for the tables is not right, as it gets the Chapter number for a reason as shown in the figure.



Demo










share|improve this question




















  • 1





    The numbering of tables depends on your used documentclass you did not tell us. If you do not want the table to float do not use floating environment table ...

    – Kurt
    Mar 6 at 19:48













  • Jeez okay thanks :S

    – Loizos Vasileiou
    Mar 6 at 20:01











  • For an in-depth discussion of how LaTeX places "floating" objects, such as figure and table environments, please see the posting How to influence the position of float environments like figure and table in LaTeX.

    – Mico
    Mar 6 at 20:19











  • Please do tell us which document class you employ.

    – Mico
    Mar 6 at 20:20











  • I have no idea what you all talk about. I just started 1 month ago. I use documentclass[bsc]{bangorcsthesis} which i use for my uni thesis. I dont know what is going on, and i don't know if that helps

    – Loizos Vasileiou
    Mar 6 at 20:27
















2












2








2








Im new to this, I just have a simple question.



How to declare a table let's say after I mention it in the text.



What I want:



Blah blah blah blah blah blah blah blah blah as shown in Table ~ref{tab:table_Languages}



MY TABLE CAPTION

| Rank | Language | Share | Trend |
-----------------------------
....


What I have:



MY TABLE CAPTION

| Rank | Language | Share | Trend |
-----------------------------
.....


Blah blah blah blah blah blah blah blah blah as shown in Table ~ref{tab:table_Languages}



What I use:



begin{table}
centering
label{tab:table_Languages}
setlength{tabcolsep}{0.3cm}
begin{tabular}{|c|p{2cm}|l|l|}
hline
textbf{Rank} & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
textbf{1} & Python & 26.42% & +5.2% \ hline
textbf{2} & Java & 21.20% & -1.3% \ hline
textbf{3} & JavaScript & 08.21% & -0.3% \ hline
textbf{4} & C# & 07.57% & -0.5% \ hline
textbf{5} & PHP & 07.34% & -1.2% \ hline
textbf{6} & C/C++ & 06.23% & -0.3% \ hline
textbf{7} & R & 04.13% & -0.1% \ hline
end{tabular}
end{table}


UPDATE:



Adding caption{Best ranking Programming Languages in 2019.} creates a nice caption above my example. However it doesn't fix the position and also the value of the counter for the tables is not right, as it gets the Chapter number for a reason as shown in the figure.



Demo










share|improve this question
















Im new to this, I just have a simple question.



How to declare a table let's say after I mention it in the text.



What I want:



Blah blah blah blah blah blah blah blah blah as shown in Table ~ref{tab:table_Languages}



MY TABLE CAPTION

| Rank | Language | Share | Trend |
-----------------------------
....


What I have:



MY TABLE CAPTION

| Rank | Language | Share | Trend |
-----------------------------
.....


Blah blah blah blah blah blah blah blah blah as shown in Table ~ref{tab:table_Languages}



What I use:



begin{table}
centering
label{tab:table_Languages}
setlength{tabcolsep}{0.3cm}
begin{tabular}{|c|p{2cm}|l|l|}
hline
textbf{Rank} & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
textbf{1} & Python & 26.42% & +5.2% \ hline
textbf{2} & Java & 21.20% & -1.3% \ hline
textbf{3} & JavaScript & 08.21% & -0.3% \ hline
textbf{4} & C# & 07.57% & -0.5% \ hline
textbf{5} & PHP & 07.34% & -1.2% \ hline
textbf{6} & C/C++ & 06.23% & -0.3% \ hline
textbf{7} & R & 04.13% & -0.1% \ hline
end{tabular}
end{table}


UPDATE:



Adding caption{Best ranking Programming Languages in 2019.} creates a nice caption above my example. However it doesn't fix the position and also the value of the counter for the tables is not right, as it gets the Chapter number for a reason as shown in the figure.



Demo







tables positioning text






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 20:29







Loizos Vasileiou

















asked Mar 6 at 19:09









Loizos VasileiouLoizos Vasileiou

133




133








  • 1





    The numbering of tables depends on your used documentclass you did not tell us. If you do not want the table to float do not use floating environment table ...

    – Kurt
    Mar 6 at 19:48













  • Jeez okay thanks :S

    – Loizos Vasileiou
    Mar 6 at 20:01











  • For an in-depth discussion of how LaTeX places "floating" objects, such as figure and table environments, please see the posting How to influence the position of float environments like figure and table in LaTeX.

    – Mico
    Mar 6 at 20:19











  • Please do tell us which document class you employ.

    – Mico
    Mar 6 at 20:20











  • I have no idea what you all talk about. I just started 1 month ago. I use documentclass[bsc]{bangorcsthesis} which i use for my uni thesis. I dont know what is going on, and i don't know if that helps

    – Loizos Vasileiou
    Mar 6 at 20:27
















  • 1





    The numbering of tables depends on your used documentclass you did not tell us. If you do not want the table to float do not use floating environment table ...

    – Kurt
    Mar 6 at 19:48













  • Jeez okay thanks :S

    – Loizos Vasileiou
    Mar 6 at 20:01











  • For an in-depth discussion of how LaTeX places "floating" objects, such as figure and table environments, please see the posting How to influence the position of float environments like figure and table in LaTeX.

    – Mico
    Mar 6 at 20:19











  • Please do tell us which document class you employ.

    – Mico
    Mar 6 at 20:20











  • I have no idea what you all talk about. I just started 1 month ago. I use documentclass[bsc]{bangorcsthesis} which i use for my uni thesis. I dont know what is going on, and i don't know if that helps

    – Loizos Vasileiou
    Mar 6 at 20:27










1




1





The numbering of tables depends on your used documentclass you did not tell us. If you do not want the table to float do not use floating environment table ...

– Kurt
Mar 6 at 19:48







The numbering of tables depends on your used documentclass you did not tell us. If you do not want the table to float do not use floating environment table ...

– Kurt
Mar 6 at 19:48















Jeez okay thanks :S

– Loizos Vasileiou
Mar 6 at 20:01





Jeez okay thanks :S

– Loizos Vasileiou
Mar 6 at 20:01













For an in-depth discussion of how LaTeX places "floating" objects, such as figure and table environments, please see the posting How to influence the position of float environments like figure and table in LaTeX.

– Mico
Mar 6 at 20:19





For an in-depth discussion of how LaTeX places "floating" objects, such as figure and table environments, please see the posting How to influence the position of float environments like figure and table in LaTeX.

– Mico
Mar 6 at 20:19













Please do tell us which document class you employ.

– Mico
Mar 6 at 20:20





Please do tell us which document class you employ.

– Mico
Mar 6 at 20:20













I have no idea what you all talk about. I just started 1 month ago. I use documentclass[bsc]{bangorcsthesis} which i use for my uni thesis. I dont know what is going on, and i don't know if that helps

– Loizos Vasileiou
Mar 6 at 20:27







I have no idea what you all talk about. I just started 1 month ago. I use documentclass[bsc]{bangorcsthesis} which i use for my uni thesis. I dont know what is going on, and i don't know if that helps

– Loizos Vasileiou
Mar 6 at 20:27












1 Answer
1






active

oldest

votes


















3














(updated the answer to include the OP's piece of information that the bangorcsthesis document class is in use)



You're almost there: In addition to providing label and ref statements, you need to inform LaTeX which counter or item to associate the label with. In the case of figure and table environments, the way to make this association is to issue a caption directive. This directive not only typesets a (hopefully meaningful) caption, it also increments a figure or table counter in such a way that the subsequent label statement "knows" what to latch on to. Incidentally, because label statements try to "latch on" to the most recently incremented counter variable, it is essential to issue figure- and table-related label statements after the corresponding caption statements.



The LaTeX kernel provides the basic, yet flexible and quite powerful label-ref mechanism. Many LaTeX packages have been written to extend this basic mechanism. Please see the posting Cross-reference packages: which to use, which conflict? for more information about these packages.



enter image description here



documentclass[bsc]{bangorcsthesis}
usepackage{array} % for "newcolumntype" macro
newcolumntype{C}{>{bfseries}c}
begin{document}
setcounter{chapter}{3} % just for this example

begin{table}
centering
caption{Best Programming Languages in 2019}
label{tab:table_Languages}
setlength{tabcolsep}{3mm}
begin{tabular}{|C|l|l|r|}
hline
Rank & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
1 & Python & 26.42% & +5.2% \
2 & Java & 21.20% & $-$1.3% \
3 & JavaScript & 08.21% & $-$0.3% \
4 & C# & 07.57% & $-$0.5% \
5 & PHP & 07.34% & $-$1.2% \
6 & C/C++ & 06.23% & $-$0.3% \
7 & R & 04.13% & $-$0.1% \
hline
end{tabular}
end{table}

noindent
dots as shown in Table~ref{tab:table_Languages}, dots

end{document}





share|improve this answer


























  • I updated my question due to some issues.

    – Loizos Vasileiou
    Mar 6 at 19:37











  • @LoizosVasileiou - I've updated my answer to reflect the pieces of information that (a) you use the bangorcsthesis document class and (b) that the table occurs somewhere in chapter 3.

    – Mico
    Mar 6 at 20:53











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478073%2fhow-to-reference-add-tables-figures-graphs-after-some-point-in-the-text%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














(updated the answer to include the OP's piece of information that the bangorcsthesis document class is in use)



You're almost there: In addition to providing label and ref statements, you need to inform LaTeX which counter or item to associate the label with. In the case of figure and table environments, the way to make this association is to issue a caption directive. This directive not only typesets a (hopefully meaningful) caption, it also increments a figure or table counter in such a way that the subsequent label statement "knows" what to latch on to. Incidentally, because label statements try to "latch on" to the most recently incremented counter variable, it is essential to issue figure- and table-related label statements after the corresponding caption statements.



The LaTeX kernel provides the basic, yet flexible and quite powerful label-ref mechanism. Many LaTeX packages have been written to extend this basic mechanism. Please see the posting Cross-reference packages: which to use, which conflict? for more information about these packages.



enter image description here



documentclass[bsc]{bangorcsthesis}
usepackage{array} % for "newcolumntype" macro
newcolumntype{C}{>{bfseries}c}
begin{document}
setcounter{chapter}{3} % just for this example

begin{table}
centering
caption{Best Programming Languages in 2019}
label{tab:table_Languages}
setlength{tabcolsep}{3mm}
begin{tabular}{|C|l|l|r|}
hline
Rank & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
1 & Python & 26.42% & +5.2% \
2 & Java & 21.20% & $-$1.3% \
3 & JavaScript & 08.21% & $-$0.3% \
4 & C# & 07.57% & $-$0.5% \
5 & PHP & 07.34% & $-$1.2% \
6 & C/C++ & 06.23% & $-$0.3% \
7 & R & 04.13% & $-$0.1% \
hline
end{tabular}
end{table}

noindent
dots as shown in Table~ref{tab:table_Languages}, dots

end{document}





share|improve this answer


























  • I updated my question due to some issues.

    – Loizos Vasileiou
    Mar 6 at 19:37











  • @LoizosVasileiou - I've updated my answer to reflect the pieces of information that (a) you use the bangorcsthesis document class and (b) that the table occurs somewhere in chapter 3.

    – Mico
    Mar 6 at 20:53
















3














(updated the answer to include the OP's piece of information that the bangorcsthesis document class is in use)



You're almost there: In addition to providing label and ref statements, you need to inform LaTeX which counter or item to associate the label with. In the case of figure and table environments, the way to make this association is to issue a caption directive. This directive not only typesets a (hopefully meaningful) caption, it also increments a figure or table counter in such a way that the subsequent label statement "knows" what to latch on to. Incidentally, because label statements try to "latch on" to the most recently incremented counter variable, it is essential to issue figure- and table-related label statements after the corresponding caption statements.



The LaTeX kernel provides the basic, yet flexible and quite powerful label-ref mechanism. Many LaTeX packages have been written to extend this basic mechanism. Please see the posting Cross-reference packages: which to use, which conflict? for more information about these packages.



enter image description here



documentclass[bsc]{bangorcsthesis}
usepackage{array} % for "newcolumntype" macro
newcolumntype{C}{>{bfseries}c}
begin{document}
setcounter{chapter}{3} % just for this example

begin{table}
centering
caption{Best Programming Languages in 2019}
label{tab:table_Languages}
setlength{tabcolsep}{3mm}
begin{tabular}{|C|l|l|r|}
hline
Rank & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
1 & Python & 26.42% & +5.2% \
2 & Java & 21.20% & $-$1.3% \
3 & JavaScript & 08.21% & $-$0.3% \
4 & C# & 07.57% & $-$0.5% \
5 & PHP & 07.34% & $-$1.2% \
6 & C/C++ & 06.23% & $-$0.3% \
7 & R & 04.13% & $-$0.1% \
hline
end{tabular}
end{table}

noindent
dots as shown in Table~ref{tab:table_Languages}, dots

end{document}





share|improve this answer


























  • I updated my question due to some issues.

    – Loizos Vasileiou
    Mar 6 at 19:37











  • @LoizosVasileiou - I've updated my answer to reflect the pieces of information that (a) you use the bangorcsthesis document class and (b) that the table occurs somewhere in chapter 3.

    – Mico
    Mar 6 at 20:53














3












3








3







(updated the answer to include the OP's piece of information that the bangorcsthesis document class is in use)



You're almost there: In addition to providing label and ref statements, you need to inform LaTeX which counter or item to associate the label with. In the case of figure and table environments, the way to make this association is to issue a caption directive. This directive not only typesets a (hopefully meaningful) caption, it also increments a figure or table counter in such a way that the subsequent label statement "knows" what to latch on to. Incidentally, because label statements try to "latch on" to the most recently incremented counter variable, it is essential to issue figure- and table-related label statements after the corresponding caption statements.



The LaTeX kernel provides the basic, yet flexible and quite powerful label-ref mechanism. Many LaTeX packages have been written to extend this basic mechanism. Please see the posting Cross-reference packages: which to use, which conflict? for more information about these packages.



enter image description here



documentclass[bsc]{bangorcsthesis}
usepackage{array} % for "newcolumntype" macro
newcolumntype{C}{>{bfseries}c}
begin{document}
setcounter{chapter}{3} % just for this example

begin{table}
centering
caption{Best Programming Languages in 2019}
label{tab:table_Languages}
setlength{tabcolsep}{3mm}
begin{tabular}{|C|l|l|r|}
hline
Rank & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
1 & Python & 26.42% & +5.2% \
2 & Java & 21.20% & $-$1.3% \
3 & JavaScript & 08.21% & $-$0.3% \
4 & C# & 07.57% & $-$0.5% \
5 & PHP & 07.34% & $-$1.2% \
6 & C/C++ & 06.23% & $-$0.3% \
7 & R & 04.13% & $-$0.1% \
hline
end{tabular}
end{table}

noindent
dots as shown in Table~ref{tab:table_Languages}, dots

end{document}





share|improve this answer















(updated the answer to include the OP's piece of information that the bangorcsthesis document class is in use)



You're almost there: In addition to providing label and ref statements, you need to inform LaTeX which counter or item to associate the label with. In the case of figure and table environments, the way to make this association is to issue a caption directive. This directive not only typesets a (hopefully meaningful) caption, it also increments a figure or table counter in such a way that the subsequent label statement "knows" what to latch on to. Incidentally, because label statements try to "latch on" to the most recently incremented counter variable, it is essential to issue figure- and table-related label statements after the corresponding caption statements.



The LaTeX kernel provides the basic, yet flexible and quite powerful label-ref mechanism. Many LaTeX packages have been written to extend this basic mechanism. Please see the posting Cross-reference packages: which to use, which conflict? for more information about these packages.



enter image description here



documentclass[bsc]{bangorcsthesis}
usepackage{array} % for "newcolumntype" macro
newcolumntype{C}{>{bfseries}c}
begin{document}
setcounter{chapter}{3} % just for this example

begin{table}
centering
caption{Best Programming Languages in 2019}
label{tab:table_Languages}
setlength{tabcolsep}{3mm}
begin{tabular}{|C|l|l|r|}
hline
Rank & textbf{Language} & textbf{Share} & textbf{Trend} \
hline
1 & Python & 26.42% & +5.2% \
2 & Java & 21.20% & $-$1.3% \
3 & JavaScript & 08.21% & $-$0.3% \
4 & C# & 07.57% & $-$0.5% \
5 & PHP & 07.34% & $-$1.2% \
6 & C/C++ & 06.23% & $-$0.3% \
7 & R & 04.13% & $-$0.1% \
hline
end{tabular}
end{table}

noindent
dots as shown in Table~ref{tab:table_Languages}, dots

end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 6 at 20:47

























answered Mar 6 at 19:27









MicoMico

283k31388775




283k31388775













  • I updated my question due to some issues.

    – Loizos Vasileiou
    Mar 6 at 19:37











  • @LoizosVasileiou - I've updated my answer to reflect the pieces of information that (a) you use the bangorcsthesis document class and (b) that the table occurs somewhere in chapter 3.

    – Mico
    Mar 6 at 20:53



















  • I updated my question due to some issues.

    – Loizos Vasileiou
    Mar 6 at 19:37











  • @LoizosVasileiou - I've updated my answer to reflect the pieces of information that (a) you use the bangorcsthesis document class and (b) that the table occurs somewhere in chapter 3.

    – Mico
    Mar 6 at 20:53

















I updated my question due to some issues.

– Loizos Vasileiou
Mar 6 at 19:37





I updated my question due to some issues.

– Loizos Vasileiou
Mar 6 at 19:37













@LoizosVasileiou - I've updated my answer to reflect the pieces of information that (a) you use the bangorcsthesis document class and (b) that the table occurs somewhere in chapter 3.

– Mico
Mar 6 at 20:53





@LoizosVasileiou - I've updated my answer to reflect the pieces of information that (a) you use the bangorcsthesis document class and (b) that the table occurs somewhere in chapter 3.

– Mico
Mar 6 at 20:53


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478073%2fhow-to-reference-add-tables-figures-graphs-after-some-point-in-the-text%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents