Page Layout ⇒ Show/hide all but section / subsection / etc. in body
Show/hide all but section / subsection / etc. in body
In one part of the document I include it per usual.
I'd like to include it as an appendix but show none of the body text. I thought I'd solved this, but searching fails. Is there a canonical way of doing this?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Show/hide all but section / subsection / etc. in body
I am not sure what kind of .ltx format are you talking about. In a standard LaTeX document you can use some of the features provided by the comment package. A little example:
Code: Select all
\documentclass{article}
\usepackage{comment}
\usepackage{lipsum} % just to generate some text
\begin{document}
\section{Test section}
\begin{comment}
\lipsum[1-10]
\end{comment}
\end{document}Show/hide all but section / subsection / etc. in body
Code: Select all
\section{Supplies}
\subsection{Food}
Some words about food.
\subsection{Drink}
Some words about drink.
I'd like to include it as an appendix later on but show only the section/subsections, without the intervening text, to make a shopping list of sorts.
Show/hide all but section / subsection / etc. in body
the file main.tex:
Code: Select all
\documentclass{article}
\usepackage{comment}
\usepackage{lipsum} % just to generate some text
\begin{document}
% we include all the contents of the file b.tex
\includecomment{comappend}
\include{b}
% now only the sectional unit titles of file b.tex will be included
\setcounter{section}{0}
\excludecomment{comappend}
\include{b}
\end{document}Code: Select all
\section{Supplies}
\begin{comappend}
\lipsum[1-2]
\end{comappend}
\subsection{Food}
\begin{comappend}
\lipsum[1-2]
\end{comappend}
\subsection{Drinks}
\begin{comappend}
\lipsum[1-2]
\end{comappend}By the way, I still don't know what you mean with .ltx format. Is it some kind of format produced by an editor?
Re: Show/hide all but section / subsection / etc. in body
Now I'm trying to work out why the minimal TeX case works but migrating this into LaTeX fails; specifically the second inclusion contains all the prose, and the TOC for the second inclusion shows line numbers to the first include, and I'm pretty sure the URL package gets completely confusied (making in-document jumps wrong).
I'm also wondering why I chose LaTeX as my default, when perhaps TeX would work for this rather simple (albeit lengthy) document....