LaTeX forum ⇒ Text FormattingMultiple formats for the same information (addresses)

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

Multiple formats for the same information (addresses)

Postby Gnosos » Mon Mar 21, 2016 11:48 pm

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?

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Mar 22, 2016 9:24 am

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.
  1. \documentclass{article}
  2. \author{Dr.~Peorgie Tirebiter, PhD\\
  3. Department of Obfuscation\\
  4. More Science University\\
  5. Room 1854 Mudhead Hall\\
  6. 1848 Antelope Freeway\\
  7. Mystic, CT 01517\\
  8. USA\\
  9. e:~PTirebiter@MoSciU.edu\\
  10. t:~(213) BU8-8252}
  11. \begin{document}
  12. \makeatletter\@author
  13. \bigbreak
  14. and later a footnote\footnote{\def\\{,}\@author}
  15. \bigbreak
  16. \noindent\parbox{\linewidth}{\def\\{~$\diamond$}\@author}
  17. \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: 19
Joined: Wed Jun 29, 2011 10:52 pm

Postby Gnosos » Tue Mar 22, 2016 3:07 pm

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.
  1. \documentclass{article}
  2. \author{Dr.~Peorgie Tirebiter, PhD\\
  3. Department of Obfuscation\\
  4. More Science University\\
  5. Room 1854 Mudhead Hall\\
  6. 1848 Antelope Freeway\\
  7. Mystic, CT 01517\\
  8. USA\\
  9. e:~PTirebiter@MoSciU.edu\\
  10. t:~(213) BU8-8252}
  11. \begin{document}
  12. \makeatletter\@author
  13. \bigbreak
  14. and later a footnote\footnote{\def\\{,}\@author}
  15. \bigbreak
  16. \noindent\parbox{\linewidth}{\def\\{~$\diamond$}\@author}
  17. \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.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 4 guests