Text FormattingMultiple formats for the same information (addresses)

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Gnosos
Posts: 23
Joined: Wed Jun 29, 2011 10:52 pm

Multiple formats for the same information (addresses)

Post by Gnosos »

Hi,

I'm relatively new to LaTeX, and it's hard to believe this subject hasn't been discussed before. But I've not found any such discussion. So I'm asking it now.

Take the example of a pre-publication academic paper and the author's address. For example, suppose an author of a paper is:
  • Dr. Peorgie Tirebiter, PhD
    Department of Obfuscation
    More Science University
    Room 1854 Mudhead Hall
    1848 Antelope Freeway
    Mystic, CT 01517
    USA
    e: PTirebiter@MoSciU.edu
    t: (213) BU8-8252
But then, on the first page of actual text, the paper title will typically be repeated, with contact instructions in a footnote. Instead of appearing as a block, with separate lines devoted to different address elements, it will appear as normal paragraph text.

For example:
  • *Direct all correspondence to Dr. Porgie Tirebiter, PhD, Department of Obfuscation, More Science University, Room 1854 Mudhead Hall, 1848 Antelope Freeway, Mystic, CT 01517, USA, e: PTirebiter@MoSciU.edu, t:(213) BU8-8252.
Notice the information is identical in both examples, just the formatting changes. So I'm wondering if there's some way to input the information in the first format, with "\\" or "\par" as a line terminator. Something like:
  • \newcommand{CR}{\\}
    \newcommand{contact} {
    Dr. Peorgie Tirebiter, PhD\CR
    Department of Obfuscation\CR
    ...
    }
    \contact
and then to change the terminator into something else (most likely ", ") for the first page of the document, so the contact text now appears as:
  • \renewcommand{CR}{, }
    Direct all correspondence to \contact
Any suggestions?

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Multiple formats for the same information (addresses)

Post by Johannes_B »

Welcome, i don't understand what is tripping you. You can redefine everything you want, as long as you know what you are doing and what might crash.

Code: Select all

\documentclass{article}
\author{Dr.~Peorgie Tirebiter, PhD\\
	Department of Obfuscation\\
	More Science University\\
	Room 1854 Mudhead Hall\\
	1848 Antelope Freeway\\
	Mystic, CT 01517\\
	USA\\
	e:~PTirebiter@MoSciU.edu\\
t:~(213) BU8-8252}
\begin{document}
\makeatletter\@author
\bigbreak
and later a footnote\footnote{\def\\{,}\@author}
\bigbreak
\noindent\parbox{\linewidth}{\def\\{~$\diamond$}\@author}
\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.
Gnosos
Posts: 23
Joined: Wed Jun 29, 2011 10:52 pm

Multiple formats for the same information (addresses)

Post by Gnosos »

Johannes_B wrote:Welcome, i don't understand what is tripping you. You can redefine everything you want, as long as you know what you are doing and what might crash.

Code: Select all

\documentclass{article}
\author{Dr.~Peorgie Tirebiter, PhD\\
	Department of Obfuscation\\
	More Science University\\
	Room 1854 Mudhead Hall\\
	1848 Antelope Freeway\\
	Mystic, CT 01517\\
	USA\\
	e:~PTirebiter@MoSciU.edu\\
t:~(213) BU8-8252}
\begin{document}
\makeatletter\@author
\bigbreak
and later a footnote\footnote{\def\\{,}\@author}
\bigbreak
\noindent\parbox{\linewidth}{\def\\{~$\diamond$}\@author}
\end{document}
Thanks.

I needed another pair of eyes on the problem and was afraid of two things. (1) Although I was assigning the address to a new command, I was mistakenly thinking LeTeX would process the line terminators into newlines and therefore they would be unavailable for redefinition in the footnote. (2) I was (and maybe still am) afraid the footnote paragraph would have both the original line terminators (\\ in \ author) as well as other line terminators that should be left alone.
Post Reply