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)
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
add a comment |
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
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 modifylatex.ltxat all. It will probably come down to copying the relevant bits fromarticle.cls/latex.ltxand elsewhere and adding the redefinition to your custom class.
– moewe
16 mins ago
The linked answer shows how to define a command analogous toauthor, namelydirector:newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use@directorin your title formatting.
– moewe
14 mins ago
add a comment |
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
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
documentclass-writing
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 modifylatex.ltxat all. It will probably come down to copying the relevant bits fromarticle.cls/latex.ltxand elsewhere and adding the redefinition to your custom class.
– moewe
16 mins ago
The linked answer shows how to define a command analogous toauthor, namelydirector:newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use@directorin your title formatting.
– moewe
14 mins ago
add a comment |
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 modifylatex.ltxat all. It will probably come down to copying the relevant bits fromarticle.cls/latex.ltxand elsewhere and adding the redefinition to your custom class.
– moewe
16 mins ago
The linked answer shows how to define a command analogous toauthor, namelydirector:newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use@directorin 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
add a comment |
1 Answer
1
active
oldest
votes
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
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 puttutorin 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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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 puttutorin 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
add a comment |
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
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 puttutorin 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
add a comment |
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
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
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 puttutorin 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
add a comment |
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 puttutorin 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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.ltxat all. It will probably come down to copying the relevant bits fromarticle.cls/latex.ltxand 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, namelydirector:newcommanddirector[1]gdef@director#1% newcommand@director@latex@warning@no@lineNo noexpanddirector given. You can now use@directorin your title formatting.– moewe
14 mins ago