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
0 answers
25 views

Disable LyX preamble

In LyX, I would like to know if there is a way, for a given document, to disable all parts of the preamble that LyX adds automatically, leaving only the user-defined preamble before compilation occurs ...
user avatar
-2 votes
2 answers
173 views
+50

How to create code in the preamble to give the same result as a prescribed boxed figure with nested caption and numbering

My attempt to create the code begins at line 45 below; I cannot get the boxes to behave properly. The lengths for image-width and caption-width may need to be inserted "by hand" for each ...
user avatar
1 vote
1 answer
41 views

Precompiled preamble + TikZ fadings library

It seems that the fadings library is not compatible with precompiled preambles. MWE: %&mwe \documentclass{article} \usepackage{tikz} \usetikzlibrary{fadings}% Incompatible with precompiled ...
user avatar
  • 1,373
1 vote
0 answers
40 views

How do I add a frame title specifying the section and subsection names whenever a new subsection come up?

I'm very new to StackExchange, let alone LaTeX. The issue here is temporarily adding a frame title to whichever frame comes right after a new subsection is defined. Following is a sample code with an ...
user avatar
0 votes
1 answer
41 views

Creating links to things other than url's and other pdf files

I found this blog post where he talks about how he manages to do his research Ph.D. thesis and maintain his Ph.D. thesis notes. When I create a reference link to a note.xoj file and I click the link, ...
user avatar
1 vote
1 answer
32 views

Create automatic label from a given input command

I created/copied this piece of latex preamble code: \makeatletter \def\@lesson{} \def\@lessonabbr{} \newcommand{\lesson}[4]{ \ifthenelse{\isempty{#3}}{ \def\@lessonabbr{Les #1} \def\@...
user avatar
3 votes
0 answers
135 views

Is it bad to have a large preamble? (~100 lines) / are there any optimizations there could be made to my preamble?

I must say I've been using LaTeX for only a couple of months, so you could say I'm still a beginner. I have a large project that has many modifications applied to it. Every single time I wanted to ...
user avatar
-2 votes
1 answer
67 views

Check these errors

\documentclass[a4paper,twocolumn]{article} \usepackage[utf8]{inputenc} \usepackage{booktabs} \usepackage{array} \usepackage{multirow} %\usepackage[T1]{fontenc} \usepackage[left=1cm,right=1cm,top=0.5cm,...
user avatar
0 votes
0 answers
23 views

Nested Stand-Alone with flash cards not working

I have made flash cards using the flacards document class, but they are from multiple topics across multiple semesters. I want to be able to have a unique footer for each topic/semester, as well as ...
user avatar
  • 11
0 votes
2 answers
182 views

How to adapt \crefrangelabelformat to subexample formatting?

I would like to be able to redefine something which is supposed to be defined in the preamble. In this example and in relation to this question : Cross-referencing: more sublevels, and presets, I want ...
user avatar
0 votes
0 answers
49 views

Can I re-use the same preamble in multiple documents? [duplicate]

I would like to reuse a piece of code from the preamble in multiple .tex documents. I can just copy and paste that code in all my documents, however, if later on I decide to modify the code I need to ...
user avatar
0 votes
0 answers
24 views

Adjust mathfont with \fontdimen in preamble errors

I am using a custom math font using the \setmathfont command from unicode-math. However the exponents don't render properly and are set too low. To adjust this I am using the following: \...
user avatar
  • 11
2 votes
1 answer
37 views

Loading siunitx units in preambule for use in glossary

I'm trying to build a glossary where some terms are constants with units, and I'm hitting the problem than the units of siunitx are not defined. \documentclass{article} \usepackage{glossaries-extra} \...
user avatar
  • 33
0 votes
0 answers
17 views

Using the Import Package to import an 'autonomous' tex file

I am currently updating my CV for some applications. The CV is made via the moderncv package. Now I made some tex files for the applications and would like to import the CV tex to an application file ...
user avatar
  • 123
3 votes
3 answers
161 views

How to detect with expl3 if the code is currently in the preamble?

I would like to know the standard way using expl3 to test whether a command is running within the preamble or inside the main body. My current approach is to use: \cs_if_eq:NNTF \@onlypreamble \@...
user avatar
  • 4,515
0 votes
1 answer
37 views

global@ structures

I'm using a standard model do write my thesis. I'm stucking in a (maybe) silly problem. I want to put some text under the examiners names. The used command is \newcount\@examiner\@examiner0 \...
user avatar
  • 269
0 votes
1 answer
459 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 ...
user avatar
2 votes
1 answer
36 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 ...
user avatar
1 vote
0 answers
90 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} \...
user avatar
  • 11
0 votes
0 answers
48 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: \...
user avatar
  • 267
1 vote
1 answer
39 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 ...
user avatar
  • 13
1 vote
1 answer
82 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 ...
user avatar
2 votes
1 answer
60 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}, ...
user avatar
  • 366
0 votes
0 answers
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 ...
user avatar
  • 366
0 votes
0 answers
15 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{...
user avatar
  • 193
3 votes
2 answers
998 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)...
user avatar
  • 145
1 vote
0 answers
35 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" ...
user avatar
  • 193
2 votes
1 answer
46 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 (...
user avatar
  • 253
1 vote
1 answer
90 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 ...
user avatar
0 votes
2 answers
65 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,...
user avatar
  • 366
0 votes
1 answer
87 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 ...
user avatar
0 votes
0 answers
47 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 ...
user avatar
0 votes
0 answers
40 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 ...
user avatar
0 votes
3 answers
77 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 ...
user avatar
0 votes
1 answer
95 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{...
user avatar
0 votes
2 answers
253 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. ...
user avatar
  • 667
0 votes
1 answer
20 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 ...
user avatar
  • 366
4 votes
1 answer
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]{...
user avatar
  • 105
0 votes
1 answer
64 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 ...
user avatar
  • 366
1 vote
0 answers
101 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 ...
user avatar
0 votes
2 answers
106 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) -- ...
user avatar
1 vote
0 answers
70 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 ...
user avatar
  • 133
0 votes
0 answers
67 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 ...
user avatar
1 vote
2 answers
48 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 = ..., ...
user avatar
  • 466
1 vote
1 answer
127 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: ...
user avatar
  • 35
0 votes
1 answer
381 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 ...
user avatar
0 votes
0 answers
106 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. ...
user avatar
0 votes
1 answer
57 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}[...
user avatar
0 votes
0 answers
58 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 ...
user avatar
  • 580
0 votes
1 answer
79 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 ...
user avatar

1
2 3 4 5
8