Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 793385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:08:38+00:00 2026-05-14T22:08:38+00:00

I am writing a document class for LaTeX and I want it to be

  • 0

I am writing a document class for LaTeX and I want it to be generic. In this document class I redefine the \maketitle command to display a custom title page, and here I want to display some information, like the title, author, etc., but also some other informations. Here is how I display the title:

{\LARGE{\bf \@title}}\\

I’d like to create a new command that works similarly to \title or \author, how can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:08:39+00:00Added an answer on May 14, 2026 at 10:08 pm

    If you look at latex.ltx you can see that \title is defined as follows:

    \def\title#1{\gdef\@title{#1}}
    \def\@title{\@latex@error{No \noexpand\title given}\@ehc}
    

    Those are low-level TeX commands. \title is a command that redefines \@title to expand to the argument given to \title. In more modern LaTeX commands your own definition could look like this:

    \newcommand\foo[1]{\renewcommand\@foo{#1}}
    \newcommand\@foo{\@latex@error{No \noexpand\foo given}\@ehc}
    

    It’s better to use \PackageError or \ClassError to show the error message. Or, if you want \foo to be optional and be empty by default:

    \newcommand\foo[1]{\renewcommand\@foo{#1}}
    \newcommand\@foo{}
    

    If this is not inside a package, you’ll have to put it between \makeatletter and \makeatother because of the @ signs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a Latex document using the scrbook package. \documentclass[12pt,a4paper,oneside]{scrbook} \pagestyle{plain} The page
I'm writing a Sweave document, and I want to include a small section that
I am currently writing a PHP class which handles an XML document. Specifically, a
I am using this class for writing into config file. Code is builted and
I'm trying to explain the differences between writing timeline code vs Document Class code,
I have a Mongoid model that looks like this: class V1Cache include Mongoid::Document field
I'm interested in writing a method which returns an object of class Document ,
I'm writing an XML document based on a stream of data. This part has
I am writing a c++ app to implement this: Given an arbitrary text document
I am currently writing a custom context menu class which utilizes jQuery largely. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.