How to add new macros like author without editing latex.ltxHow to make a new command similar to authorHow to write a LaTeX class file for my thesisAccess title and author in custom classHow can I pass class/package options with spaces in values?Macro for Declaring Variables in Class FilesCommands for getting and setting additional elements in a class and documentHow to load class with options, e.g. headseplinetrouble with margins in amsbook modificationModify bibliography title independent of managerhow does 'maketitle' work?How to use authblk's @author outside maketitle (or other way to get easy-to-use author lists in document class)

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

Where to refill my bottle in India?

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

Why do we use polarized capacitors?

Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library?

Ideas for 3rd eye abilities

Re-submission of rejected manuscript without informing co-authors

Supply current of negative rail

"My colleague's body is amazing"

Dual Citizen. Exited the US on Italian passport recently

Is domain driven design an anti-SQL pattern?

Can one use the reaction spell from the War Caster feat to cast Bigby's Hand?

Patience, young "Padovan"

I see my dog run

Inflated grade on resume at previous job, might former employer tell new employer?

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

Springs with some finite mass

What does "rabbited" mean/imply in this sentence?

Can I buy Keisei train tickets with international debit card?

Does light intensity oscillate really fast since it is a wave?

Information to fellow intern about hiring?

Shall I use personal or official e-mail account when registering to external websites for work purpose?

Filling an area between two curves

Email Account under attack (really) - anything I can do?



How to add new macros like author without editing latex.ltx


How to make a new command similar to authorHow to write a LaTeX class file for my thesisAccess title and author in custom classHow can I pass class/package options with spaces in values?Macro for Declaring Variables in Class FilesCommands for getting and setting additional elements in a class and documentHow to load class with options, e.g. headseplinetrouble with margins in amsbook modificationModify bibliography title independent of managerhow does 'maketitle' work?How to use authblk's @author outside maketitle (or other way to get easy-to-use author lists in document class)













0















I want to write a new class based on the article class for student home-works that needs a modified title page.



Is it possible to create new macros like title and author that can be used in the modified maketitle code (e.g. tutor and dueDate) without editing the latex.ltx file?



In the question How to make a new command similar to author the class that is worked on is memoir.cls while I'm trying to modify the article.cls. Furthermore the best solution given is by adding new information to author macro and not on how to add new macros that are ready to use in the preamble.










share|improve this question
























  • see tex.stackexchange.com/questions/58506/…

    – user185220
    26 mins ago











  • They are using the memoir class there while I'm trying to do this by modifying the article.cls.

    – Al_Fh
    24 mins ago











  • Also they don't really answer the question. And in the comments it is hinted that information can be added to the author macro but not how to create a new one

    – Al_Fh
    23 mins ago











  • Yes that is possible and you should indeed not modify latex.ltx at all. It will probably come down to copying the relevant bits from article.cls/latex.ltx and elsewhere and adding the redefinition to your custom class.

    – moewe
    16 mins ago











  • The linked answer shows how to define a command analogous to author, namely director: newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use @director in your title formatting.

    – moewe
    14 mins ago















0















I want to write a new class based on the article class for student home-works that needs a modified title page.



Is it possible to create new macros like title and author that can be used in the modified maketitle code (e.g. tutor and dueDate) without editing the latex.ltx file?



In the question How to make a new command similar to author the class that is worked on is memoir.cls while I'm trying to modify the article.cls. Furthermore the best solution given is by adding new information to author macro and not on how to add new macros that are ready to use in the preamble.










share|improve this question
























  • see tex.stackexchange.com/questions/58506/…

    – user185220
    26 mins ago











  • They are using the memoir class there while I'm trying to do this by modifying the article.cls.

    – Al_Fh
    24 mins ago











  • Also they don't really answer the question. And in the comments it is hinted that information can be added to the author macro but not how to create a new one

    – Al_Fh
    23 mins ago











  • Yes that is possible and you should indeed not modify latex.ltx at all. It will probably come down to copying the relevant bits from article.cls/latex.ltx and elsewhere and adding the redefinition to your custom class.

    – moewe
    16 mins ago











  • The linked answer shows how to define a command analogous to author, namely director: newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use @director in your title formatting.

    – moewe
    14 mins ago













0












0








0








I want to write a new class based on the article class for student home-works that needs a modified title page.



Is it possible to create new macros like title and author that can be used in the modified maketitle code (e.g. tutor and dueDate) without editing the latex.ltx file?



In the question How to make a new command similar to author the class that is worked on is memoir.cls while I'm trying to modify the article.cls. Furthermore the best solution given is by adding new information to author macro and not on how to add new macros that are ready to use in the preamble.










share|improve this question
















I want to write a new class based on the article class for student home-works that needs a modified title page.



Is it possible to create new macros like title and author that can be used in the modified maketitle code (e.g. tutor and dueDate) without editing the latex.ltx file?



In the question How to make a new command similar to author the class that is worked on is memoir.cls while I'm trying to modify the article.cls. Furthermore the best solution given is by adding new information to author macro and not on how to add new macros that are ready to use in the preamble.







documentclass-writing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 18 mins ago







Al_Fh

















asked 27 mins ago









Al_FhAl_Fh

556




556












  • see tex.stackexchange.com/questions/58506/…

    – user185220
    26 mins ago











  • They are using the memoir class there while I'm trying to do this by modifying the article.cls.

    – Al_Fh
    24 mins ago











  • Also they don't really answer the question. And in the comments it is hinted that information can be added to the author macro but not how to create a new one

    – Al_Fh
    23 mins ago











  • Yes that is possible and you should indeed not modify latex.ltx at all. It will probably come down to copying the relevant bits from article.cls/latex.ltx and elsewhere and adding the redefinition to your custom class.

    – moewe
    16 mins ago











  • The linked answer shows how to define a command analogous to author, namely director: newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use @director in your title formatting.

    – moewe
    14 mins ago

















  • see tex.stackexchange.com/questions/58506/…

    – user185220
    26 mins ago











  • They are using the memoir class there while I'm trying to do this by modifying the article.cls.

    – Al_Fh
    24 mins ago











  • Also they don't really answer the question. And in the comments it is hinted that information can be added to the author macro but not how to create a new one

    – Al_Fh
    23 mins ago











  • Yes that is possible and you should indeed not modify latex.ltx at all. It will probably come down to copying the relevant bits from article.cls/latex.ltx and elsewhere and adding the redefinition to your custom class.

    – moewe
    16 mins ago











  • The linked answer shows how to define a command analogous to author, namely director: newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use @director in your title formatting.

    – moewe
    14 mins ago
















see tex.stackexchange.com/questions/58506/…

– user185220
26 mins ago





see tex.stackexchange.com/questions/58506/…

– user185220
26 mins ago













They are using the memoir class there while I'm trying to do this by modifying the article.cls.

– Al_Fh
24 mins ago





They are using the memoir class there while I'm trying to do this by modifying the article.cls.

– Al_Fh
24 mins ago













Also they don't really answer the question. And in the comments it is hinted that information can be added to the author macro but not how to create a new one

– Al_Fh
23 mins ago





Also they don't really answer the question. And in the comments it is hinted that information can be added to the author macro but not how to create a new one

– Al_Fh
23 mins ago













Yes that is possible and you should indeed not modify latex.ltx at all. It will probably come down to copying the relevant bits from article.cls/latex.ltx and elsewhere and adding the redefinition to your custom class.

– moewe
16 mins ago





Yes that is possible and you should indeed not modify latex.ltx at all. It will probably come down to copying the relevant bits from article.cls/latex.ltx and elsewhere and adding the redefinition to your custom class.

– moewe
16 mins ago













The linked answer shows how to define a command analogous to author, namely director: newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use @director in your title formatting.

– moewe
14 mins ago





The linked answer shows how to define a command analogous to author, namely director: newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use @director in your title formatting.

– moewe
14 mins ago










1 Answer
1






active

oldest

votes


















2














In latex.ltx, there are two lines related to author:



defauthor#1gdef@author#1
def@author@latex@warning@no@lineNo noexpandauthor given


Then you can always have



documentclassarticle
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
makeatother
begindocument
tutorAl Fh
makeatletter@tutormakeatother
enddocument


Now customize your maketitle with this command @tutor, like



documentclassarticle
usepackagearray
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
renewcommandmaketitle%
begincenter
textbfHuge@title\[2em]
largebegintabular>bfseriesll
Author: & @author\
Tutor: & @tutor\
Date: & @date
endtabular
endcenterparvspace2em
usepackagelipsum
begindocument
titleMy document
authorYour student
tutorAl Fh
datetoday
maketitle
lipsum[1]
enddocument





share|improve this answer

























  • So in the end I have to define tutor after the begindocument label and not before it?

    – Al_Fh
    8 mins ago












  • @Al_Fh No. You can put tutor in the preamble if you like. I prefer putting it inside.

    – JouleV
    7 mins ago











  • Thank you very much. This is what I was looking for.

    – Al_Fh
    5 mins ago











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483953%2fhow-to-add-new-macros-like-author-without-editing-latex-ltx%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














In latex.ltx, there are two lines related to author:



defauthor#1gdef@author#1
def@author@latex@warning@no@lineNo noexpandauthor given


Then you can always have



documentclassarticle
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
makeatother
begindocument
tutorAl Fh
makeatletter@tutormakeatother
enddocument


Now customize your maketitle with this command @tutor, like



documentclassarticle
usepackagearray
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
renewcommandmaketitle%
begincenter
textbfHuge@title\[2em]
largebegintabular>bfseriesll
Author: & @author\
Tutor: & @tutor\
Date: & @date
endtabular
endcenterparvspace2em
usepackagelipsum
begindocument
titleMy document
authorYour student
tutorAl Fh
datetoday
maketitle
lipsum[1]
enddocument





share|improve this answer

























  • So in the end I have to define tutor after the begindocument label and not before it?

    – Al_Fh
    8 mins ago












  • @Al_Fh No. You can put tutor in the preamble if you like. I prefer putting it inside.

    – JouleV
    7 mins ago











  • Thank you very much. This is what I was looking for.

    – Al_Fh
    5 mins ago















2














In latex.ltx, there are two lines related to author:



defauthor#1gdef@author#1
def@author@latex@warning@no@lineNo noexpandauthor given


Then you can always have



documentclassarticle
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
makeatother
begindocument
tutorAl Fh
makeatletter@tutormakeatother
enddocument


Now customize your maketitle with this command @tutor, like



documentclassarticle
usepackagearray
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
renewcommandmaketitle%
begincenter
textbfHuge@title\[2em]
largebegintabular>bfseriesll
Author: & @author\
Tutor: & @tutor\
Date: & @date
endtabular
endcenterparvspace2em
usepackagelipsum
begindocument
titleMy document
authorYour student
tutorAl Fh
datetoday
maketitle
lipsum[1]
enddocument





share|improve this answer

























  • So in the end I have to define tutor after the begindocument label and not before it?

    – Al_Fh
    8 mins ago












  • @Al_Fh No. You can put tutor in the preamble if you like. I prefer putting it inside.

    – JouleV
    7 mins ago











  • Thank you very much. This is what I was looking for.

    – Al_Fh
    5 mins ago













2












2








2







In latex.ltx, there are two lines related to author:



defauthor#1gdef@author#1
def@author@latex@warning@no@lineNo noexpandauthor given


Then you can always have



documentclassarticle
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
makeatother
begindocument
tutorAl Fh
makeatletter@tutormakeatother
enddocument


Now customize your maketitle with this command @tutor, like



documentclassarticle
usepackagearray
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
renewcommandmaketitle%
begincenter
textbfHuge@title\[2em]
largebegintabular>bfseriesll
Author: & @author\
Tutor: & @tutor\
Date: & @date
endtabular
endcenterparvspace2em
usepackagelipsum
begindocument
titleMy document
authorYour student
tutorAl Fh
datetoday
maketitle
lipsum[1]
enddocument





share|improve this answer















In latex.ltx, there are two lines related to author:



defauthor#1gdef@author#1
def@author@latex@warning@no@lineNo noexpandauthor given


Then you can always have



documentclassarticle
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
makeatother
begindocument
tutorAl Fh
makeatletter@tutormakeatother
enddocument


Now customize your maketitle with this command @tutor, like



documentclassarticle
usepackagearray
makeatletter
deftutor#1gdef@tutor#1
def@tutor@latex@warning@no@lineNo noexpandtutor given
renewcommandmaketitle%
begincenter
textbfHuge@title\[2em]
largebegintabular>bfseriesll
Author: & @author\
Tutor: & @tutor\
Date: & @date
endtabular
endcenterparvspace2em
usepackagelipsum
begindocument
titleMy document
authorYour student
tutorAl Fh
datetoday
maketitle
lipsum[1]
enddocument






share|improve this answer














share|improve this answer



share|improve this answer








edited 6 mins ago

























answered 14 mins ago









JouleVJouleV

11.9k22561




11.9k22561












  • So in the end I have to define tutor after the begindocument label and not before it?

    – Al_Fh
    8 mins ago












  • @Al_Fh No. You can put tutor in the preamble if you like. I prefer putting it inside.

    – JouleV
    7 mins ago











  • Thank you very much. This is what I was looking for.

    – Al_Fh
    5 mins ago

















  • So in the end I have to define tutor after the begindocument label and not before it?

    – Al_Fh
    8 mins ago












  • @Al_Fh No. You can put tutor in the preamble if you like. I prefer putting it inside.

    – JouleV
    7 mins ago











  • Thank you very much. This is what I was looking for.

    – Al_Fh
    5 mins ago
















So in the end I have to define tutor after the begindocument label and not before it?

– Al_Fh
8 mins ago






So in the end I have to define tutor after the begindocument label and not before it?

– Al_Fh
8 mins ago














@Al_Fh No. You can put tutor in the preamble if you like. I prefer putting it inside.

– JouleV
7 mins ago





@Al_Fh No. You can put tutor in the preamble if you like. I prefer putting it inside.

– JouleV
7 mins ago













Thank you very much. This is what I was looking for.

– Al_Fh
5 mins ago





Thank you very much. This is what I was looking for.

– Al_Fh
5 mins ago

















draft saved

draft discarded
















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483953%2fhow-to-add-new-macros-like-author-without-editing-latex-ltx%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

acmart: Multiple authors: all with same affiliation, one author an additional affiliationHow to Write Names of Multiple Authors with Shared Affiliation in ACM 2017 Template?Multiple authors with different primary affiliation, but same additional affiliationSame affiliation for all authors without extra packagesIOS-Book-Article.cls: one author with multiple affiliationacmart: Shared Author AffiliationMultiple authors with different primary affiliation, but same additional affiliationAuthor affiliation with only 1 authorAdding Multiple Authors with Different Affiliation in LaTeX ArticleLaTeX: Multiple authors stays on same lineHow to Label Multiple Authors with Same DescriptionHow to make two authors use the same affiliationTwo authors with same affiliation on finished front page

How to write “ä” and other umlauts and accented letters in bibliography?Accents in BibTeXSorting references with special characters alphabeticallyUse ae ligature in bibliographyEastern European nameInverted circumflex in BibTexBibTex, non-ascii initials and nameptr fproblems with accent in LatexHow to add a Ø to my bibliography from Jabref?References without accentsTroubles when trying to cite St“omer-Verlet in ”title" field of a bib entryComprehensive list of accented charactersHow to type the letter “i” with two dots (diaeresis) in math mode?Problem with glossary text and accented lettersSpecial character in bibliographyAccented letters, Unicode and LaTeX accentsHow to stop natbib from modifying bibliography styleCitation of a paper with non-standard characters by BibtexWrite accented characters to file using writeHow to group the bibliography alphabetically, if some surnames start with “accented” characters?How can I automatically capitalize significant words in my bibliography?

How to remove border form elements in the last row?Targeting flex items on the last rowHow to vertically wrap content with flexbox?Remove border from IFrameCSS3's border-radius property and border-collapse:collapse don't mix. How can I use border-radius to create a collapsed table with rounded corners?Div width 100% minus fixed amount of pixelsBorder around specific rows in a table?How to remove border (outline) around text/input boxes? (Chrome)How do I remove the space between inline-block elements?Flex-box: Align last row to gridRemove blue border from css custom-styled button in ChromeFill remaining vertical space with CSS using display:flexhow style elements in the last row of flexbox row layout with pure css without js