is there any way where i can put a label on a full latex document and refer to it in another tex file.  e.g. supplement.tex  \documentclass[review,12pt]{article} \usepackage{graphicx} \begin{document} \label{supplement1}   something  \end{document}   and in the main document main.tex do something like:      \documentclass[review,12pt]{article}     \usepackage{graphicx} \externaldocument{supplement}     \begin{document}       something is refered from Supplement file~\ref{supplement1}      \end{document}   EDIT  thanks for your comments, what i basically want is not to refer to a section or chapter in another document, but i want to refer to the whole document.
14886
I want to cross-reference between different .tex files, just because I want to put every chapters separately.  Let's say in file chapterI.tex I have \label{a} and I want to access this in file chapterII.tex using something like \ref{a}. How to do this exactly in LaTeX, moreover if LEd have an easy feature to cover this, it will be better (I have put those both files in the same project).  I found another question with similar title, but I just didn't really understand. It's here: .
86933
I have a paragraph in one part of the .tex file that I want to be duplicated in another part of the .tex file.  I could do ctrl-c, ctrl-v... as easy as that, but then if I modify one place, I will have to do the same for the other.  Is there a way to take a piece of text, in some part of the document, surround it by some reference marker, and then just use this reference marker elsewhere to duplicate the text?  EDIT: I could just do    \newcommand{\textA}{piece of text}   and then use "\textA" anywhere I want this text to appear.  However, I want "\textA" to be defined in a certain place in the document (in the .tex file). That location appears after the first time I want to use this macro.  Macros can be used only in places in the document after which they were defined, so I can't do that.
32875
I'm facing a problem with my document that has many equations. The problem with the labelling issue if I decide to modify or add new equations. Basically so far, I'm using \label{eq4.1} where 4 for the chapter four and 1 for the first equation. With this approach, if I decide later to add new equations before eq4.1, then I have to change all subsequent equations to reflect this change. I'm looking for a better and flexible approach to cope with this problem.   \documentclass{article} \usepackage{amsmath}  \begin{document}  \begin{align} x &amp;= 2^{100}, \label{eq4.1} \\ y &amp;= 2^{100}, \label{eq4.2} \\ z &amp;= 2^{100}. \label{eq4.3} \end{align}  These are \eqref{eq4.1} and \eqref{eq4.2} and \eqref{eq4.3}.   \end{document}
116657
I have a fairly large document, that I have picked apart into different sections etc, each in their own file. To include graphics that are not in one central directory I use \graphicspath which works quite nicely. Is there a similar command I could use to include tex files from multiple directories without me explicitly naming them?  The idea would be the following:  \graphicspath{{./Some/Directory/For/Figures1/},{./Some/Directory/For/Figures2/}} \texpath{{./Some/Directory/For/Tex/Files1/},{./Some/Directory/For/Tex/Files2/}}   The I would like to call within the document:  \includegraphics{fig_from_Figures1}% this works \includegraphics{fig_from_Figures2}  \input{doc_from_Files1}% this would be awesome \input{doc_from_Files2}
7197
Working with documents with huge amount of equations it becomes cumbersome to go back and remind yourself what you labeled a certain equation to (I try to name them in a smart way, but there are too many).  Is there a convenient way to have equations print the label along with the tag/number, so that I can easily check the label in the compiled document?  Something like this would be perfect:  x = y               (14.1) eq:my_label
67546
In the following MWE, I receive a warning and a reference points to the wrong element.  \documentclass{article} \usepackage{hyperref} \usepackage{amsmath} \begin{document}     \begin{equation}         \label{eq1}     \end{equation}      \begin{equation}\tag{\ref*{eq1}b}         \label{eq1b}     \end{equation}      \begin{equation}         \label{eq2}     \end{equation}  This reference is incorrect: \ref{eq2} points to 1b. Also, this warnings appear: \begin{verbatim}         pdfTeX warning (ext4): destination with the same identifier         (name{equation.0.2}) has been already used, duplicate ignored     \end{verbatim} \end{document}   In this variant with equation*, the latter problem is fixed, but a new one introduced. A link that was fine before is now wrong:  \documentclass{article} \usepackage{hyperref} \usepackage{amsmath} \begin{document}     \begin{equation}         \label{eq1}     \end{equation}      \begin{equation*}\tag{\ref*{eq1}b}         \label{eq1b}     \end{equation*}      \begin{equation}         \label{eq2}     \end{equation}      This reference is incorrect: \ref{eq1b} points to 1. No warning. \end{document}   How can I get all references correct?  These questions are similar, but don't help:
49512
Question: What steps are required to use the xr package in LyX in order to reference items in other, independent LyX documents?  Steps already taken:   The tools package (that contains the xr package) has been installed in MikTeX. The xr package has been used in the referencing document (by adding \usepackage{xr} to the referencing document's preamble). A pointer to the referenced document has been set in the referencing document (by adding \externaldocument{referenced.lyx} to the referencing document's preamble). A label in the referenced document has been cross-referenced in the the referencing document using the \ref tag.   Observed (undesired) behavior: The reference appears as "BROKEN" in the LyX editor. The PDF output shows "??" where the reference number is expected.  Relevant links:       Software used: LyX + MiKTeX + BibTeX on Windows 7  My level of Lyx/LaTeX proficiency: Beginner+
90389
I was using this:    To try and create numbered examples in my document.  However, when I load it and put the example exe in that link in one of the separate Tex files (Introduction.tex) I include in main.tex, I get:  ./Chapters/Introduction.tex:14: TeX capacity exceeded, sorry [parameter stack s ize=10000]. \gb@ifnextchar #1#2#3-&gt;                        \let \reserved@d =#1\def \reserved@a {#2}\def \reserv... l.14 ... and political news \cite{washington_post}                                                   .  More importantly, when ...   Which is not even referring to the exe example I inserted but a couple of blocks of tex above it.  For info, here is my full code before my document begins:  \documentclass{report} % [fontsize=11pt,border=5pt] % standalone for the tree \usepackage{forest} % This overrides warnings like http://tex.stackexchange.com/questions/52576/difference-between-bookmark-levels-greater-than-one-what-does-this-mean \usepackage{bookmark} \usepackage{amsmath} \usepackage{subcaption} \usepackage{standalone} \usepackage[round]{natbib} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[utf8]{inputenc} % This is for hyperlinks \usepackage{hyperref} \hypersetup{     colorlinks=true,     linkcolor=blue,     filecolor=magenta,           urlcolor=cyan, }  \urlstyle{same} % Not sure why I need to use this % \usepackage{graphicx} % \graphicspath{ {images/} } % \usepackage[pdftex]{graphicx} % fontsize=11pt,twoside]{scrartcl} % This is for numbered examples \usepackage{gb4e}   Would appreciate some help as I feel like my Latex is very messy here.
87654
Problem  I have defined an environment to automatically number example sentences throughout my document. It uses the tabular environment and automatically numbers the first column of each row using a custom counter. I have reasons for not using lists or the theorem counter.  I want to label and reference a table row so that the number associated with the row is displayed. Using \label and \ref does not work. Is there some way to feed a function two args, a key and the current value of my counter, and later use the key to recall the other arg? Or is there another way to do what I want? Not breaking the labels and references for the rest of the document is ideal but not necessary.  (Non-)Working Example  \documentclass{article} \usepackage{array} %don't know why this is needed; get csname error otherwise  % automatically number examples throughout document \newcounter{exno} \newenvironment{examples} { \begin{flushleft} \begin{tabular}{&gt;{(\stepcounter{exno}\theexno)}rl} } { \end{tabular} \end{flushleft} }  \begin{document}  \section{Foo} Here are some numbered example sentences. \begin{examples}   &amp;Content of row 1 \label{row1} \\   &amp;Content of row 2 \label{row2} \end{examples} Now I want to get a 1 here: \ref{row1}. I want to get a 2 here: \ref{row2}.  \end{document}
112626
I have a table, and I want to print it twice in my document. I want them to have the same label, caption and number, so that in the caption when it says "Table 1: foo" the same number shows up, and so that when I reference its label, it will always reference to the same number. Is this possible?
114516
This question led to a new package:      How can I display the full path of the tex file that I compile? It is a simple file, no include or input present.  Edit: I use MiKTeX 2.9 on a Windows 7 64-bit.  Less demanding: If not possible, then I will be satisfied with a partial path (at least one or two folders up + the filename).
61603
How can I generate a text-file (without any formatting) of the references used in a tex file?  This is needed quite often when submitting scientific papers to journals, because they want a separate list of the bibliography. However, if I turn the pdf file to a docx document, there is the problem that "ff" and "fi" in the text is not copied properly, so that a lot of manual corrections would be needed.  Does anyone know of a way to get the list of references either from the latex file or the pdf document?
120941
Is there a way to make a cross reference to a label of a header with custom text? That is, its text should differ from the Header text, or its number or page (not like the predefined formats in Lyx). Something like the the hyperlinks or bookmarks in MS word, and in such a way that I can write the different text for each cross-reference individually. I'm not looking to define a new format for the references.  For example, if the header text is "State and Path functions", I want to make a cross reference to it with the text "state function".
84177
Is it possible to introduce an own table of contents in LaTeX? I would like to introduce an own tag, to define some terms in my document. At the end of the document I would like to automatically generate a list of defined terms, with links to the page, where the term was defined.
31
\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.
37408
I am writing a large document with several chapters and I would like to work on each chapter separately. In my main.tex I include the chapters either like   \include{chap1.tex}  \include{chap2.tex}  \include{chap3.tex}   or   \input{chap1.tex}  \input{chap2.tex}  \input{chap3.tex}   I think \include is preferable if I want things to be referenced and cited correctly? but doing it the \include way latex main.tex I don't get any dvi output whereas with \input things compile fine to dvi. What's going wrong here?  I would then like to use \includeonly (or \excludeonly ) to work on individual sections of the document whilst maintaining the referencing etc.  A mwe can be handy:  \documentclass[a4paper,10pt]{article} \includeonly{chap1}  \begin{document}   \include{chap1}   \include{chap2}   \include{chap3} \end{document}
29403
I am new to TeX/LaTeX. How do I install TeX on Windows (7)? It seems that there are many different implementations, so which one is best for my OS?