Questions tagged [preamble]

{preamble} is everything before \begin{document} in a LaTeX document. It contains commands loading packages, definitions, and usually most style settings for a document.

Filter by
Sorted by
Tagged with
0
votes
1answer
49 views

Trying to write a newcommand to wrap text in bold parentheses

I am attempting to define a command \ideal that will wrap its argument in bold parentheses. Here is my attempt: \newcommand{\ideal}[1]{\boldsymbol{\left(\right.} #1 \boldsymbol{\left.\right)}} This ...
2
votes
1answer
30 views

A Preloaded Command In Lyx Doesn't Show in Lyx Editor

I just created a new command that loads in the preamble: \newcommand{\e}{\epsilon}, and when i type \e in math mode, i don't see the epsilon in the editor, but it comes out as the epsilon that I want ...
1
vote
0answers
54 views

latex error(can only be used in preamble)

goodevening to everyone. please when i try running this code below i always have can only be used at the preamble.Please need your help. \documentclass[12pt,A4,english]{report} \usepackage{setspace} \...
0
votes
0answers
43 views

Proof redefinition not working

My proof redefinition command does not work on some cases and I cannot see the pattern nor the reason. These are the more reduced MN(N)E I could get. They were reproduced on Overleaf. MWE 1: \...
1
vote
1answer
36 views

Automatic splitting of displayed equations using only commands in the preamble

I have a LaTeX project with one main file, and several subfiles corresponding to chapters of my textbook. One of my students is vision impaired making it necessary for me to create a special version ...
1
vote
1answer
38 views

Using the same preamble in different projects

I am using overleaf to make excercises with my group in our different classes. We have multiple projects, one for each subject, all with the same preamble. We of course update the preamble from time ...
2
votes
1answer
52 views

Define multiple tcolorboxes from list of names

I recently build this little tcolorbox for a template: \documentclass[a4paper, 12pt]{book} \usepackage{tcolorbox} \tcbset{framedboxfilled/.style={ sharp corners, fonttitle={\bfseries}, ...
0
votes
0answers
28 views

Well coded framed Boxes

I wanted to define a simple box using the thmtools package. This box should have a name (e.g. Framedbox), a title and then the text inside a top and bottom line. This is the basic (messy) code I have ...
0
votes
0answers
12 views

Change numbering from left to right [duplicate]

I am using the following preamble: \documentclass[12pt]{amsart} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amssymb,amsmath,amsthm} \usepackage{indentfirst} \usepackage{...
3
votes
2answers
274 views

Where to \definecolor?

When I put color definitions in the preamble, I get an error, e.g. \documentclass[12pt]{article} \usepackage{xcolor} \definecolor{es-bg}{HTML}{e7edf4ff}% (cornflower light blue background at the top)...
1
vote
0answers
31 views

Base file for certain formatting

I'm interested in making a latex text and using the following template as shown below: This text is in Portuguese, the "Sumário" translation is the Summary, and the "Introdução" ...
2
votes
1answer
45 views

Predefined contents at a fixed document location (page number)

In a two-column XeLaTeX setting, I'm trying to get a framebox to completely take up the full height of one of the two columns in order to display some contents independent of the actual document (...
1
vote
1answer
67 views

Preamble code to automatically delete some commands in .tex file

I would be very grateful for help to resolve a bug. I need to use a preamble specification to automatically delete two commands in a tex file which result from a conflict between different document ...
0
votes
2answers
52 views

Call multiple commands in preamble with loop

I want to call multiple commands in the preamble with a for loop in order to define the amount of commands at a different position in the code. So far my code looks like this: \documentclass[10pt,...
0
votes
1answer
84 views

Preamble problem

unfortunately, I don't have any minimal working example to show how the problem is wrong. But, I have the following preamble, and there is some spacing that is occurring above and below my section ...
0
votes
0answers
30 views

Is there an equivalent of the python 'if name == __main__.py' command in latex?

I'm busy working on a multi-document latex file. I use \include to import my different chapters into my main file, and I've defined my preamble in a separate .sty file, that I import into my main file ...
0
votes
0answers
29 views

Can a subfile have its own preamble without the standalone package?

Can a subfile have its own preamble without the standalone package? I tried adding a preamble to a subfile, basically just a different font and it did not work. Is there a way to do so (because I hear ...
0
votes
3answers
71 views

Problem with typesetting Persian, Greek, Hebrew

So, I am trying to write the following sample text, and when I type \begin{hebrew} נְשִימָה \end{hebrew}, all the rest of text goes all wrong. The same issue arises with Greek word. "لفظ (anima ...
0
votes
1answer
49 views

standalone wrongly claims sub-preamble of a subfile changed

(Maybe related to this question.) Each pdflatex compilation of the following MCE: \begin{filecontents}[overwrite]{subfile.tex} \documentclass{article} \newcommand\mycolon{:} \begin{document} Foo. \end{...
0
votes
2answers
79 views

How to display article title in fancyhdr header

I am doing documentation for my company i.e. writing countless documents which uses the same referred preamble in a file for itself. The preamble is over 500 lines, so I want to avoid posting it here. ...
0
votes
1answer
19 views

Multiple thmboxes with for each loop

I want to get rid of a lot of redundant code while defining thmxboxes. I tried to use for-each loops, but it does not work. The following code (that does not work) should give you an idea of what I'm ...
4
votes
1answer
2k views

Is this a junk preamble?

As a beginner to LaTeX, I would like to know if this is a junk preamble. \documentclass[a4paper,12pt]{report} \renewcommand{\baselinestretch}{1.5} \usepackage[margin=2.5cm,top=2.5cm,bottom=2.5cm]{...
0
votes
1answer
35 views

Using \RequirePackage with parameters

I want to outsource my preamble to a different file. So far I'm doing it with \RequirePackage. This ends up looking like this: \RequirePackage{templates} \begin{document} ... \end{document} My ...
1
vote
0answers
59 views

LuaLaTeX and mylatexformat precompiling not working

I am trying to use mylatexformat to precompile my lengthy preamble, which is basically all in my custom .cls, with the remaining bit of non-static preamble at the top of my main.tex, before which I ...
0
votes
2answers
86 views

mylatexformat | packages loaded 'after' dump?

I've been testing the mylatexformat as a means for speeding up the compilation of various documents that call lots (30-40) of packages in the preamble (including some large packages, like TikZ) -- ...
0
votes
0answers
40 views

How to reduce space between nomenclature header and first entry?

once again i ask for help from you all! I am currently working on my final thesis in Overleaf. In order to decrease the amount of pages necessary to show my entire nomenclature, i have slightly ...
1
vote
0answers
36 views

Text not showing as bold in slides

I am preparing some slides and want to use bold text occasionally in a definition. I can use bold text outside a definition, but it just wont work inside. I was sent a template for the slides and I ...
0
votes
0answers
322 views

Collapse line spacing between items in the preamble of an r markdown pdf output to single spacing

I'm starting to explore Latex right now, working with Rstudio and using an r markdown file to produce a report in pdf format. I would like to find a way to adjust the spaces between lines of the title,...
0
votes
0answers
45 views

Lyx preamble definecolor error

I have a lot of custom commands in my preamble, and I am using these setting for all my new and old documents. Lately I added a command to change the default green color by adding the following ...
1
vote
2answers
37 views

Package for parsing author data

Is there a general solution for parsing document author data (name, address, email etc)? I am imagining something like \documentclass{whatever} \addauthor[email = ..., address = ..., other = ..., ...
1
vote
1answer
94 views

How are subpreambles handled by the standalone package?

I wrote two simple files integrated using the standalone package: main.tex: \documentclass{article} \usepackage[subpreambles]{standalone} \begin{document} \input{myfile} \end{document} myfile.tex: ...
0
votes
1answer
153 views

Missing # inserted in tabular mode

I'm somewhat new to Latex. Right now, I'm stuck with table creation. After searching this and other forums, I didn't manage to sort this out yet, so I kindly ask for your support. If I missed the ...
0
votes
0answers
77 views

cannot compile matrix to pdf

I have a problem knitting my rmd to pdf. I have tried copying the code that works for others from this forum but it is not working for me. I keep receiving: !LaTeX Error: Can be used only in preamble. ...
0
votes
1answer
38 views

Convert two-sided document into single-sided with page numbers, header and footer

I want to convert my thesis into a single-sided document with page numbers, header and footer. \documentclass[twosided,12pt]{book} \usepackage{fancyhdr} \usepackage{lipsum} \renewcommand{\chaptermark}[...
0
votes
0answers
49 views

Precompiled Preamble does not respect fontspec Tex Ligatures fontspec

I have successfully setup a precompiled preamble as described in this Tex-Stackexchange post. However, one problem remains: If I move fontspec to the preamble the ligatures stop to work. Currently my ...
0
votes
1answer
53 views

minimum working example preamble in a separete file

Context I have seen other posts on preambles in separate files, but they do not meet my needs because they do not include minimum working examples. In addition, when I look in [1], this is a pretty ...
0
votes
0answers
40 views

What Causes the Chapter Title to Get Repeated in the Header

I've got a rather awkward question. In my preamble there has to be some command that causes the chapter title to be repeated in the header on every commencing page of the chapter. The following ...
0
votes
2answers
57 views

can't pass optional arguments to a \newenvironment using fancyvrb

I am trying to define a new script environment built on fancyvrb's Verbatim environment. Preamble: \usepackage{fancyvrb} \newenvironment{script}[1][firstnumber=1] {\VerbatimEnvironment\...
0
votes
1answer
88 views

[arara]: Reuse compiled preamble with pdflatex and mylatexformat.ltx

When running pdflatex more than once successively, is it possible to: • Compile your preamble packages • Snapshot this moment in compilation • Continue running through the rest of the pdflatex ...
0
votes
0answers
20 views

Is this the best way to define new preamble commands and restructure the already defined ones?

I have a latex class that extends the AMS article class amsart. I have adjusted the margins and wanted to add a few new preamble styled parameters like \author{Name}, e. g., \class{Algebra}. After ...
2
votes
1answer
98 views

Should I place my preamble on a .tex file or on a .sty file

I'm writing my thesis and have decided to place my preamble with packages and custom new commands and macros in there in order to have a cleaner main.tex file. I have placed my preamble in a file ...
1
vote
2answers
569 views

Forest package: How to use \forestset in the preamble?

I'm trying to automate the layout for certain trees that I wish to use repetitively, but I don't seem to be able to get the \forestset command to work in the preamble. In the codes below, I suppose ...
1
vote
1answer
49 views

Block additional document contents after appendices

I'm using the appendix package's appendices environment, and due to style changes for the appendices, placing anything after the appendices doesn't make sense. I'd like to raise an error if anything ...
1
vote
1answer
35 views

Having a literal "@" in TexMaker user commands

I am wanting to make a user command that serves as a one-click preamble. \documentclass[answers,10pt]{article} \usepackage[margin=1.in]{geometry} \input{mystyle.sty} \makeatletter \@ifclassloaded{...
0
votes
2answers
223 views

How to put a logo on the left corner and text on the right corner?

I'm a beginner and I try since yesterday to put a logo on the left corner and text on the right corner, like this : but I just can't do it. Could you please help me? Sorry for my english, I'm a ...
1
vote
1answer
121 views

How to typeset the German letter ß in \address with amsart

I would like to typeset an author's address which contains the German letter ß, but \ss keeps typesetting as "ss". Here is a MWE: % !TEX encoding = UTF-8 Unicode \documentclass{amsart} \...
0
votes
0answers
73 views

How to insert pages in the pre-textual elements in the correct order?

I have a problem in my work with the pre-textual elements. I have to insert three pages between them and they must appear in the bookmarks. I did this in the preamble, but they went on the wrong pages....
0
votes
0answers
63 views

What are the Main LaTeX Commands?

On Texmaker editor in order to overwrite existing default font type to modify it to my custom font I use the commands below, which work fine: \renewcommand{\familydefault}{\sfdefault} \usepackage{...
1
vote
1answer
60 views

Can we store preamble into another Tex file and use them in any other Tex file

Can we store a latex preamble into another file to avoid writing all same stuff in another file.If we can then can we change the title in another Tex file?
5
votes
3answers
306 views

How to name command arguments [duplicate]

Is there a way to give a "name" to the arguments of a command and use them in its definition? What I'd like to do is to be able to get the value of an argument with a "label" like #...

1
2 3 4 5
7