General"self-referencing" Problem

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
enochlok
Posts: 4
Joined: Tue Jan 20, 2009 5:34 am

"self-referencing" Problem

Post by enochlok »

Hi all,


I am doing a transcription now, and I need to prepare a summary for it, by writing a sentence that summarize what the part of conversation is about.

I put the transcription as appendix in a latex file, and I wanna know, can I somehow "cross-reference" that part of conversation and should it directly in the summary? I have tried the vref package, but it only shows me the page number and line number, which is not enough. And I don't want to copy and paste the same thing all the time, which is troublesome if there is any amendment in the transcript.

Thanks again.


Enoch

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: "self-referencing" Problem

Post by corderin »

I guess you should take advantage of the hyperref package and use then \autoref{app:...} to reference the appendix, once you have labeled it (\label{app:...}).

Is this what you want?
enochlok
Posts: 4
Joined: Tue Jan 20, 2009 5:34 am

Re: "self-referencing" Problem

Post by enochlok »

I have tried, but nope.

the "autoref{app:...}" just gives me "section 1", but actually I want to have the whole paragraph appear before section 123.

Here is the code:
***
\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{hyperref}
\begin{document}
\autoref{app:...}
\newpage
\section{123}
\label{app:...}I put the transcription as appendix in a latex file, and I wanna know, can I somehow "cross-reference" that part of conversation and should it directly in the summary? I have tried the vref package, but it only shows me the page number and line number, which is not enough. And I don't want to copy and paste the same thing all the time, which is troublesome if there is any amendment in the transcript.
\end{document}
***

If the code do what I want to, it should be able to show the paragraph first, then the section name, and then the paragraph again, if I change the paragraph in tex file, both paragraphs will change accordingly.
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: "self-referencing" Problem

Post by corderin »

To reference a section use \autoref{sec:...}
To use this feature with appendices do the following:

In the preamble:
\usepackage[toc,page,titletoc]{appendix}

In the document:
In the \autoref{app:doc123} we have the...


\begin{appendices}
\appendix
\chapter{Document 123 or something else}
\label{app:doc123}
...

\end{appendices}
enochlok
Posts: 4
Joined: Tue Jan 20, 2009 5:34 am

Re: "self-referencing" Problem

Post by enochlok »

I use the following code:

***

\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[toc,page,titletoc]{appendix}
\usepackage{hyperref}
\begin{document}
In the \autoref{app:doc123} we have the...


\begin{appendices}
\appendix
\chapter{Document 123 or something else}
\label{app:doc123}
qweqweqwe

\end{appendices}
\end{document}

***


But I just received this:

***
In the section we have the...
Appendices
Document 123 or something else qweqweqwe
***

Did I miss anything?
marco_d
Posts: 57
Joined: Tue Jan 20, 2009 7:49 pm

"self-referencing" Problem

Post by marco_d »

Hello,

the arcticle-class has no chapter. The structuring starts with section. For writing a document with autoref you have to specify the language and you have to load babel.

Code: Select all

\listfiles
\documentclass[english,11pt,a4paper]{article}
\usepackage{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[toc,page,titletoc]{appendix}
\usepackage{hyperref}

\begin{document}
In the \autoref{app:doc123} we have the...


\begin{appendices}
\appendix
\section{Document 123 or something else}
\label{app:doc123}
qweqweqwe

\end{appendices}
\end{document}
Marco
i am German. I can not use difficult words. :-)
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: "self-referencing" Problem

Post by corderin »

Sorry, I didn´t realise you were using article as document class.

I guess it isn´t necessary to define the laguage and use babel, at least if you are writing in english.

In other case you will need to specify the language and maybe redefine the names given by autoref and for the apendixpage and TOC name, this way: for example in spanish,
\def\appendixautorefname{Apéndice}
\renewcommand*{\appendixtocname}{Apéndices}
\renewcommand*{\appendixpagename}{Apéndices}

in german
\def\appendixautorefname{Anhang}
...
I hope this is enough! :)
enochlok
Posts: 4
Joined: Tue Jan 20, 2009 5:34 am

Re: "self-referencing" Problem

Post by enochlok »

Thanks for you guys help! But looks like I didn't make it clear...

I would like to have something like this:


***
Summary: This is a summary.

Example:
This is the example that is extracted from the appendix

Appendix:
This is the example that is extracted from the appendix

***

I wanna see if it is possible that:
When I change "This is the example that is extracted from the appendix" from the Appendix section, the changes is done automatically in the Example section.
I need to quote tons of things from the appendix, and I don't want to copy and paste the articles, which the risk that if I change something in the Appendix section, I need to check all the Examples again.

Thanks a lot!
Post Reply