Generalquotation

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Frank2013
Posts: 2
Joined: Fri Jul 19, 2013 6:08 am

quotation

Post by Frank2013 »

Hi,

I have two latex files, A.tex and B.tex in the same folder.

I would like to quote a few sentences from A.tex to B.tex. The main advantage is that when I change A.tex, the corresponding changes will appear in B.tex.

Are there any commands having this function?

Thanks a lot.

Frank

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

quotation

Post by tom »

You might want to keep an extra text or tex file with the common content and load it through \input.

Code: Select all

\documentclass[11pt]{article}
\usepackage{blindtext}
\begin{document}
\blindtext\input{common.txt}\blindtext
\end{document}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

quotation

Post by Johannes_B »

Or save the content in a macro:

Code: Select all

\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{lipsum}
\usepackage{csquotes}
\newcommand{\myText}{This is the text to be quoted.}
\newcommand{\myLongText}{\lipsum[2]}
\begin{document}
hello, \myText 

\myLongText

\blindtext

and later one can quote: \enquote{\myText}

\begin{quote}
\myLongText
\end{quote}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply