Trying to create simple template for novice users
I am trying to create a simple template for students to create a one page abstract. The idea is that they just define their title, author, and abstract, and another file could actually have the main code that uses them. For example:
title{A Very Simple LaTeXe{} Template}
author{author1 and author2}
abstract{
Long, drawn out abstract, blah, blah, blah.
}
captionedimage {myimage.pdf}{caption text}
captionedimage {myimage2.pdf}{caption text2}
In the second file would be the main document, including the first. Although I have never done anything like this, obviously if I want a new style the thing to do is write a new .sty and .cls file for the new style I want. Hypothetically, the main document could look like this ( I am using C preprocessor includes to illustrate what I'm going for)
#include "individualpage.tex"
documentclass[12pt]{simpleabstract}
begin{document}
maketitle %% Insert a bold title font at the top of the page
%% insert the abstract defined by the student here
%% if there is an image, insert it here
end{document}
The first question is whether anything like this exists already, since I would rather not reinvent the wheel. I searched for templates for abstracts, but didn't even find a simple example of just a page I want, let alone a setup that would allow me to generate this page, and then alternately put many of them together. It's work, but I know I could mutate a document class to make the page look I want. However, before I try I would like to know that there isn't something that already exists to do this. Here is what I want the one page to look like:
The second question is how to automate taking two hundred of these and creating a single document of them. That would presumably take a different document style, one that has a title page, some introductory text, then a table of contents selected from the title of each abstract, and the abstract pages. It is primarily for this reason that I would rather not have the individual students embed the latex code that defines the document, but would rather have that in a separate file. If they embed their document style in a page, then to build the larger document I must wrap that in a larger document.
I have tried to illustrate what I want to achieve using the C++ preprocessor to hook files together, and of course one way of implementing this is to use perl or some other text processing language to process these files in some way. But perhaps in my ignorance of LaTeX, I'm not aware that some facility like that already exists, hence this question: is there some standardized way to achieve this or will it require custom programming on my part?
templates documentclass-writing
add a comment |
I am trying to create a simple template for students to create a one page abstract. The idea is that they just define their title, author, and abstract, and another file could actually have the main code that uses them. For example:
title{A Very Simple LaTeXe{} Template}
author{author1 and author2}
abstract{
Long, drawn out abstract, blah, blah, blah.
}
captionedimage {myimage.pdf}{caption text}
captionedimage {myimage2.pdf}{caption text2}
In the second file would be the main document, including the first. Although I have never done anything like this, obviously if I want a new style the thing to do is write a new .sty and .cls file for the new style I want. Hypothetically, the main document could look like this ( I am using C preprocessor includes to illustrate what I'm going for)
#include "individualpage.tex"
documentclass[12pt]{simpleabstract}
begin{document}
maketitle %% Insert a bold title font at the top of the page
%% insert the abstract defined by the student here
%% if there is an image, insert it here
end{document}
The first question is whether anything like this exists already, since I would rather not reinvent the wheel. I searched for templates for abstracts, but didn't even find a simple example of just a page I want, let alone a setup that would allow me to generate this page, and then alternately put many of them together. It's work, but I know I could mutate a document class to make the page look I want. However, before I try I would like to know that there isn't something that already exists to do this. Here is what I want the one page to look like:
The second question is how to automate taking two hundred of these and creating a single document of them. That would presumably take a different document style, one that has a title page, some introductory text, then a table of contents selected from the title of each abstract, and the abstract pages. It is primarily for this reason that I would rather not have the individual students embed the latex code that defines the document, but would rather have that in a separate file. If they embed their document style in a page, then to build the larger document I must wrap that in a larger document.
I have tried to illustrate what I want to achieve using the C++ preprocessor to hook files together, and of course one way of implementing this is to use perl or some other text processing language to process these files in some way. But perhaps in my ignorance of LaTeX, I'm not aware that some facility like that already exists, hence this question: is there some standardized way to achieve this or will it require custom programming on my part?
templates documentclass-writing
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format.
– Claudio Fiandrino
Jun 16 '13 at 16:40
Can you provide more information about your workflow? Do the students need to be able to compile their separate documents? When they submit them to you are they all in the same directory? How do they give you their images? Do you know all file names in advance? What should happen if some submissions contain errors? Since you can imagine how to do your job with C++ I assume you're comfortable with makefiles - there might be a makefile solution that does much of your work. (After thinking through these questions, take a look at thestandalone
package.)
– Ethan Bolker
Jun 16 '13 at 19:53
Ethan, Yes, my idea is that I want to give students a template that they can edit in TeXWorks and display a pdf, yet when they upload all their individual pages, I can put 250-300 of them into a book, one per page.
– Dov
Jun 17 '13 at 0:05
1
Maybecombine
,abstbook
orconfproc
packages can help you.
– Ignasi
Jun 17 '13 at 7:12
Since you want the template to be easy to use, maybe it's worth considering Markdown instead of LaTeX?
– mbork
Jun 19 '13 at 12:48
add a comment |
I am trying to create a simple template for students to create a one page abstract. The idea is that they just define their title, author, and abstract, and another file could actually have the main code that uses them. For example:
title{A Very Simple LaTeXe{} Template}
author{author1 and author2}
abstract{
Long, drawn out abstract, blah, blah, blah.
}
captionedimage {myimage.pdf}{caption text}
captionedimage {myimage2.pdf}{caption text2}
In the second file would be the main document, including the first. Although I have never done anything like this, obviously if I want a new style the thing to do is write a new .sty and .cls file for the new style I want. Hypothetically, the main document could look like this ( I am using C preprocessor includes to illustrate what I'm going for)
#include "individualpage.tex"
documentclass[12pt]{simpleabstract}
begin{document}
maketitle %% Insert a bold title font at the top of the page
%% insert the abstract defined by the student here
%% if there is an image, insert it here
end{document}
The first question is whether anything like this exists already, since I would rather not reinvent the wheel. I searched for templates for abstracts, but didn't even find a simple example of just a page I want, let alone a setup that would allow me to generate this page, and then alternately put many of them together. It's work, but I know I could mutate a document class to make the page look I want. However, before I try I would like to know that there isn't something that already exists to do this. Here is what I want the one page to look like:
The second question is how to automate taking two hundred of these and creating a single document of them. That would presumably take a different document style, one that has a title page, some introductory text, then a table of contents selected from the title of each abstract, and the abstract pages. It is primarily for this reason that I would rather not have the individual students embed the latex code that defines the document, but would rather have that in a separate file. If they embed their document style in a page, then to build the larger document I must wrap that in a larger document.
I have tried to illustrate what I want to achieve using the C++ preprocessor to hook files together, and of course one way of implementing this is to use perl or some other text processing language to process these files in some way. But perhaps in my ignorance of LaTeX, I'm not aware that some facility like that already exists, hence this question: is there some standardized way to achieve this or will it require custom programming on my part?
templates documentclass-writing
I am trying to create a simple template for students to create a one page abstract. The idea is that they just define their title, author, and abstract, and another file could actually have the main code that uses them. For example:
title{A Very Simple LaTeXe{} Template}
author{author1 and author2}
abstract{
Long, drawn out abstract, blah, blah, blah.
}
captionedimage {myimage.pdf}{caption text}
captionedimage {myimage2.pdf}{caption text2}
In the second file would be the main document, including the first. Although I have never done anything like this, obviously if I want a new style the thing to do is write a new .sty and .cls file for the new style I want. Hypothetically, the main document could look like this ( I am using C preprocessor includes to illustrate what I'm going for)
#include "individualpage.tex"
documentclass[12pt]{simpleabstract}
begin{document}
maketitle %% Insert a bold title font at the top of the page
%% insert the abstract defined by the student here
%% if there is an image, insert it here
end{document}
The first question is whether anything like this exists already, since I would rather not reinvent the wheel. I searched for templates for abstracts, but didn't even find a simple example of just a page I want, let alone a setup that would allow me to generate this page, and then alternately put many of them together. It's work, but I know I could mutate a document class to make the page look I want. However, before I try I would like to know that there isn't something that already exists to do this. Here is what I want the one page to look like:
The second question is how to automate taking two hundred of these and creating a single document of them. That would presumably take a different document style, one that has a title page, some introductory text, then a table of contents selected from the title of each abstract, and the abstract pages. It is primarily for this reason that I would rather not have the individual students embed the latex code that defines the document, but would rather have that in a separate file. If they embed their document style in a page, then to build the larger document I must wrap that in a larger document.
I have tried to illustrate what I want to achieve using the C++ preprocessor to hook files together, and of course one way of implementing this is to use perl or some other text processing language to process these files in some way. But perhaps in my ignorance of LaTeX, I'm not aware that some facility like that already exists, hence this question: is there some standardized way to achieve this or will it require custom programming on my part?
templates documentclass-writing
templates documentclass-writing
edited Jun 17 '13 at 2:40
Dov
asked Jun 16 '13 at 16:14
DovDov
7161016
7161016
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format.
– Claudio Fiandrino
Jun 16 '13 at 16:40
Can you provide more information about your workflow? Do the students need to be able to compile their separate documents? When they submit them to you are they all in the same directory? How do they give you their images? Do you know all file names in advance? What should happen if some submissions contain errors? Since you can imagine how to do your job with C++ I assume you're comfortable with makefiles - there might be a makefile solution that does much of your work. (After thinking through these questions, take a look at thestandalone
package.)
– Ethan Bolker
Jun 16 '13 at 19:53
Ethan, Yes, my idea is that I want to give students a template that they can edit in TeXWorks and display a pdf, yet when they upload all their individual pages, I can put 250-300 of them into a book, one per page.
– Dov
Jun 17 '13 at 0:05
1
Maybecombine
,abstbook
orconfproc
packages can help you.
– Ignasi
Jun 17 '13 at 7:12
Since you want the template to be easy to use, maybe it's worth considering Markdown instead of LaTeX?
– mbork
Jun 19 '13 at 12:48
add a comment |
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format.
– Claudio Fiandrino
Jun 16 '13 at 16:40
Can you provide more information about your workflow? Do the students need to be able to compile their separate documents? When they submit them to you are they all in the same directory? How do they give you their images? Do you know all file names in advance? What should happen if some submissions contain errors? Since you can imagine how to do your job with C++ I assume you're comfortable with makefiles - there might be a makefile solution that does much of your work. (After thinking through these questions, take a look at thestandalone
package.)
– Ethan Bolker
Jun 16 '13 at 19:53
Ethan, Yes, my idea is that I want to give students a template that they can edit in TeXWorks and display a pdf, yet when they upload all their individual pages, I can put 250-300 of them into a book, one per page.
– Dov
Jun 17 '13 at 0:05
1
Maybecombine
,abstbook
orconfproc
packages can help you.
– Ignasi
Jun 17 '13 at 7:12
Since you want the template to be easy to use, maybe it's worth considering Markdown instead of LaTeX?
– mbork
Jun 19 '13 at 12:48
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format.
– Claudio Fiandrino
Jun 16 '13 at 16:40
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format.
– Claudio Fiandrino
Jun 16 '13 at 16:40
Can you provide more information about your workflow? Do the students need to be able to compile their separate documents? When they submit them to you are they all in the same directory? How do they give you their images? Do you know all file names in advance? What should happen if some submissions contain errors? Since you can imagine how to do your job with C++ I assume you're comfortable with makefiles - there might be a makefile solution that does much of your work. (After thinking through these questions, take a look at the
standalone
package.)– Ethan Bolker
Jun 16 '13 at 19:53
Can you provide more information about your workflow? Do the students need to be able to compile their separate documents? When they submit them to you are they all in the same directory? How do they give you their images? Do you know all file names in advance? What should happen if some submissions contain errors? Since you can imagine how to do your job with C++ I assume you're comfortable with makefiles - there might be a makefile solution that does much of your work. (After thinking through these questions, take a look at the
standalone
package.)– Ethan Bolker
Jun 16 '13 at 19:53
Ethan, Yes, my idea is that I want to give students a template that they can edit in TeXWorks and display a pdf, yet when they upload all their individual pages, I can put 250-300 of them into a book, one per page.
– Dov
Jun 17 '13 at 0:05
Ethan, Yes, my idea is that I want to give students a template that they can edit in TeXWorks and display a pdf, yet when they upload all their individual pages, I can put 250-300 of them into a book, one per page.
– Dov
Jun 17 '13 at 0:05
1
1
Maybe
combine
, abstbook
or confproc
packages can help you.– Ignasi
Jun 17 '13 at 7:12
Maybe
combine
, abstbook
or confproc
packages can help you.– Ignasi
Jun 17 '13 at 7:12
Since you want the template to be easy to use, maybe it's worth considering Markdown instead of LaTeX?
– mbork
Jun 19 '13 at 12:48
Since you want the template to be easy to use, maybe it's worth considering Markdown instead of LaTeX?
– mbork
Jun 19 '13 at 12:48
add a comment |
1 Answer
1
active
oldest
votes
Here's the framework for an answer, based on @Ignasi's suggestion. Documentation for the combine
package (http://tug.ctan.org/tex-archive/macros/latex/contrib/combine/combine.pdf) will help you play with formatting, make the toc work, even generate an index and a table of figures.
The student gets two files, preamble.tex
(read only if possible) and template.tex
. She fills in the template, compiles it and submits it with a new name along with her image files (you have to establish the naming conventions).
The preamble:
% preamble.tex
% provided to students, read only
documentclass[12pt,notitlepage]{article}
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
% hack the date field of maketitle
date{School: theschool{} -- Teacher: theteacher{}}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
begin{document}
newcommand{alldone}{end{document}}
template.tex
, saved as plato.tex
:
% template for students to fill in
%
input{preamble}
author{Plato}
title{The Republic}
school{Athens}
teacher{Socrates}
maketitle
begin{abstract}
emph{The Republic} in one short paragraph ldots
end{abstract}
% first argument is image (.jpg, .png, .pdf)
% second argument is figure caption
myfigure{therepublic}{Image from wikipedia}
alldone
Compiles to
The wrapper is putittogether.tex
, in the directory with student submissions and an empty preamble.tex
. I compiled and tested it with a second saved template - code not included here.
% putittogether.tex
documentclass[12pt]{combine}
% macros from the preamble seen by the students
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
newcommand{hackdate}{%
date{School: theschool{} -- Teacher: theteacher{}}
}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
% The date must be renewed between imports
newcommand{goget}[1]{%
hackdate{}import{#1}
}
newcommand{alldone}{} % do nothing
% Combine package configuration
title{All Together Now}
author{many authors}
date{today}
begin{document}
pagestyle{combine} % use the combine page style
maketitle % main title
tableofcontents % main ToC
clearpage
% The files to glue together - all in this directory,
% along with all graphics files required.
%
% Generate this list with a script, then include it here.
goget{plato}
goget{vonneumann}
end{document}
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');
});
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%2f119415%2ftrying-to-create-simple-template-for-novice-users%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
Here's the framework for an answer, based on @Ignasi's suggestion. Documentation for the combine
package (http://tug.ctan.org/tex-archive/macros/latex/contrib/combine/combine.pdf) will help you play with formatting, make the toc work, even generate an index and a table of figures.
The student gets two files, preamble.tex
(read only if possible) and template.tex
. She fills in the template, compiles it and submits it with a new name along with her image files (you have to establish the naming conventions).
The preamble:
% preamble.tex
% provided to students, read only
documentclass[12pt,notitlepage]{article}
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
% hack the date field of maketitle
date{School: theschool{} -- Teacher: theteacher{}}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
begin{document}
newcommand{alldone}{end{document}}
template.tex
, saved as plato.tex
:
% template for students to fill in
%
input{preamble}
author{Plato}
title{The Republic}
school{Athens}
teacher{Socrates}
maketitle
begin{abstract}
emph{The Republic} in one short paragraph ldots
end{abstract}
% first argument is image (.jpg, .png, .pdf)
% second argument is figure caption
myfigure{therepublic}{Image from wikipedia}
alldone
Compiles to
The wrapper is putittogether.tex
, in the directory with student submissions and an empty preamble.tex
. I compiled and tested it with a second saved template - code not included here.
% putittogether.tex
documentclass[12pt]{combine}
% macros from the preamble seen by the students
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
newcommand{hackdate}{%
date{School: theschool{} -- Teacher: theteacher{}}
}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
% The date must be renewed between imports
newcommand{goget}[1]{%
hackdate{}import{#1}
}
newcommand{alldone}{} % do nothing
% Combine package configuration
title{All Together Now}
author{many authors}
date{today}
begin{document}
pagestyle{combine} % use the combine page style
maketitle % main title
tableofcontents % main ToC
clearpage
% The files to glue together - all in this directory,
% along with all graphics files required.
%
% Generate this list with a script, then include it here.
goget{plato}
goget{vonneumann}
end{document}
add a comment |
Here's the framework for an answer, based on @Ignasi's suggestion. Documentation for the combine
package (http://tug.ctan.org/tex-archive/macros/latex/contrib/combine/combine.pdf) will help you play with formatting, make the toc work, even generate an index and a table of figures.
The student gets two files, preamble.tex
(read only if possible) and template.tex
. She fills in the template, compiles it and submits it with a new name along with her image files (you have to establish the naming conventions).
The preamble:
% preamble.tex
% provided to students, read only
documentclass[12pt,notitlepage]{article}
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
% hack the date field of maketitle
date{School: theschool{} -- Teacher: theteacher{}}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
begin{document}
newcommand{alldone}{end{document}}
template.tex
, saved as plato.tex
:
% template for students to fill in
%
input{preamble}
author{Plato}
title{The Republic}
school{Athens}
teacher{Socrates}
maketitle
begin{abstract}
emph{The Republic} in one short paragraph ldots
end{abstract}
% first argument is image (.jpg, .png, .pdf)
% second argument is figure caption
myfigure{therepublic}{Image from wikipedia}
alldone
Compiles to
The wrapper is putittogether.tex
, in the directory with student submissions and an empty preamble.tex
. I compiled and tested it with a second saved template - code not included here.
% putittogether.tex
documentclass[12pt]{combine}
% macros from the preamble seen by the students
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
newcommand{hackdate}{%
date{School: theschool{} -- Teacher: theteacher{}}
}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
% The date must be renewed between imports
newcommand{goget}[1]{%
hackdate{}import{#1}
}
newcommand{alldone}{} % do nothing
% Combine package configuration
title{All Together Now}
author{many authors}
date{today}
begin{document}
pagestyle{combine} % use the combine page style
maketitle % main title
tableofcontents % main ToC
clearpage
% The files to glue together - all in this directory,
% along with all graphics files required.
%
% Generate this list with a script, then include it here.
goget{plato}
goget{vonneumann}
end{document}
add a comment |
Here's the framework for an answer, based on @Ignasi's suggestion. Documentation for the combine
package (http://tug.ctan.org/tex-archive/macros/latex/contrib/combine/combine.pdf) will help you play with formatting, make the toc work, even generate an index and a table of figures.
The student gets two files, preamble.tex
(read only if possible) and template.tex
. She fills in the template, compiles it and submits it with a new name along with her image files (you have to establish the naming conventions).
The preamble:
% preamble.tex
% provided to students, read only
documentclass[12pt,notitlepage]{article}
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
% hack the date field of maketitle
date{School: theschool{} -- Teacher: theteacher{}}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
begin{document}
newcommand{alldone}{end{document}}
template.tex
, saved as plato.tex
:
% template for students to fill in
%
input{preamble}
author{Plato}
title{The Republic}
school{Athens}
teacher{Socrates}
maketitle
begin{abstract}
emph{The Republic} in one short paragraph ldots
end{abstract}
% first argument is image (.jpg, .png, .pdf)
% second argument is figure caption
myfigure{therepublic}{Image from wikipedia}
alldone
Compiles to
The wrapper is putittogether.tex
, in the directory with student submissions and an empty preamble.tex
. I compiled and tested it with a second saved template - code not included here.
% putittogether.tex
documentclass[12pt]{combine}
% macros from the preamble seen by the students
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
newcommand{hackdate}{%
date{School: theschool{} -- Teacher: theteacher{}}
}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
% The date must be renewed between imports
newcommand{goget}[1]{%
hackdate{}import{#1}
}
newcommand{alldone}{} % do nothing
% Combine package configuration
title{All Together Now}
author{many authors}
date{today}
begin{document}
pagestyle{combine} % use the combine page style
maketitle % main title
tableofcontents % main ToC
clearpage
% The files to glue together - all in this directory,
% along with all graphics files required.
%
% Generate this list with a script, then include it here.
goget{plato}
goget{vonneumann}
end{document}
Here's the framework for an answer, based on @Ignasi's suggestion. Documentation for the combine
package (http://tug.ctan.org/tex-archive/macros/latex/contrib/combine/combine.pdf) will help you play with formatting, make the toc work, even generate an index and a table of figures.
The student gets two files, preamble.tex
(read only if possible) and template.tex
. She fills in the template, compiles it and submits it with a new name along with her image files (you have to establish the naming conventions).
The preamble:
% preamble.tex
% provided to students, read only
documentclass[12pt,notitlepage]{article}
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
% hack the date field of maketitle
date{School: theschool{} -- Teacher: theteacher{}}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
begin{document}
newcommand{alldone}{end{document}}
template.tex
, saved as plato.tex
:
% template for students to fill in
%
input{preamble}
author{Plato}
title{The Republic}
school{Athens}
teacher{Socrates}
maketitle
begin{abstract}
emph{The Republic} in one short paragraph ldots
end{abstract}
% first argument is image (.jpg, .png, .pdf)
% second argument is figure caption
myfigure{therepublic}{Image from wikipedia}
alldone
Compiles to
The wrapper is putittogether.tex
, in the directory with student submissions and an empty preamble.tex
. I compiled and tested it with a second saved template - code not included here.
% putittogether.tex
documentclass[12pt]{combine}
% macros from the preamble seen by the students
usepackage{graphicx}
newcommand{theschool}{to be renewed}
newcommand{school}[1]{%
renewcommand{theschool}{#1}
}
newcommand{theteacher}{to be renewed}
newcommand{teacher}[1]{%
renewcommand{theteacher}{#1}
}
newcommand{hackdate}{%
date{School: theschool{} -- Teacher: theteacher{}}
}
newcommand{myfigure}[2]{%
centering
includegraphics[height=3cm]{#1}\
Caption: #2
}
% The date must be renewed between imports
newcommand{goget}[1]{%
hackdate{}import{#1}
}
newcommand{alldone}{} % do nothing
% Combine package configuration
title{All Together Now}
author{many authors}
date{today}
begin{document}
pagestyle{combine} % use the combine page style
maketitle % main title
tableofcontents % main ToC
clearpage
% The files to glue together - all in this directory,
% along with all graphics files required.
%
% Generate this list with a script, then include it here.
goget{plato}
goget{vonneumann}
end{document}
edited Feb 11 at 22:36
botenvouwer
1034
1034
answered Jun 18 '13 at 23:56
Ethan BolkerEthan Bolker
6,65632351
6,65632351
add a comment |
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');
});
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%2f119415%2ftrying-to-create-simple-template-for-novice-users%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');
});
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');
});
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');
});
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
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format.
– Claudio Fiandrino
Jun 16 '13 at 16:40
Can you provide more information about your workflow? Do the students need to be able to compile their separate documents? When they submit them to you are they all in the same directory? How do they give you their images? Do you know all file names in advance? What should happen if some submissions contain errors? Since you can imagine how to do your job with C++ I assume you're comfortable with makefiles - there might be a makefile solution that does much of your work. (After thinking through these questions, take a look at the
standalone
package.)– Ethan Bolker
Jun 16 '13 at 19:53
Ethan, Yes, my idea is that I want to give students a template that they can edit in TeXWorks and display a pdf, yet when they upload all their individual pages, I can put 250-300 of them into a book, one per page.
– Dov
Jun 17 '13 at 0:05
1
Maybe
combine
,abstbook
orconfproc
packages can help you.– Ignasi
Jun 17 '13 at 7:12
Since you want the template to be easy to use, maybe it's worth considering Markdown instead of LaTeX?
– mbork
Jun 19 '13 at 12:48