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
1
vote
1answer
13 views

\AtEndPreamble hook breaks hyperref with bibliography

In the past I used \usepackage{hyperref} within the \AtEndPreamble{} hook, without problems. At least I think so. However, recently the hook breaks the links to my bibliograpy. Is that a bug or am I ...
4
votes
2answers
81 views

newcommand for math mode only

My preamble contains the following definition \newcommand* {\pdiffat}[3] {\left(\frac{\partial{#1}}{\partial{#2}}\right)_{#3}} which is meant to be used in math mode only. However, overleaf ...
0
votes
1answer
46 views

Error with preamble – the preamble for my homework doesnt even compile

I have huge problems and I feel like I am going in circles now for a while. For my homework, I have to work with the math-packages, but nothing seems to work. I am working with TeXstudio (I could ...
0
votes
0answers
28 views

Texmaker - ! LaTeX Error: File `l3backend-pdfmode.def' not found [duplicate]

I need to include animate package in my text. When I tried that, I got an error: LaTeX Error: File `l3backend-pdfmode.def' not found. So after that I also inserted package l3backend into my ...
0
votes
0answers
27 views

How to assign the same error message—such as key setting preamble only—to multiple keys?

We know how to restrict the setting of a single key to be 'preamble only' from a previous post. That's version 0.1 in the code below. To avoid code duplication for each key necessitating this ...
0
votes
0answers
46 views

pre-compiling long document preamble

I have several long documents (500-1000+ pages), where the pre-amble is itself rather lengthy (say, 15-25 packages being loaded, with multiple option tweaks, lots of custom functions, etc, etc). When ...
0
votes
1answer
36 views

How to determine the options available in the second parameter of latex preamble /DeclareUnicodeCharacter

Context I am using Sphinx and latexpdf to build reStructured documentation for my project. The documentation draws in remote data that it cannot control (only escape/parse etc). My current build ...
0
votes
1answer
61 views

Can be used only in the preamble error - and yes, it's in the preamble

I have these lines \documentclass[../main.tex]{subfiles} \usepackage{float} \usepackage[font=small,skip=2pt]{caption} \usepackage{graphicx} \graphicspath{{Images}{../Images/}} \input{commands} % ...
0
votes
1answer
30 views

Set Section name as a mark for Fancyhdr header

I am using the fancyhdr package in my code and the preamble looks like this \fancyhf{} \pagestyle{fancy} \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \fancyhead[LE,RO]{\thepage} \fancyhead[RE]{\...
0
votes
0answers
35 views

Why the * in \newcommand*? [duplicate]

I saw several examples of user defined macros using \newcommand (without the *), and examples with \newcommand*. Trying both in my test documents doesn't show any difference. So why the asterisk? ...
1
vote
2answers
40 views

How to omit or include paragraph according to a preamble setting?

Is it possible by including a command to the preamble to make several paragraphs in different places in the main document to be included or not according to my will?
0
votes
1answer
37 views

How can I modify the environment of enumerate to put every item in a minipage?

I'm writing a little exam generation package in R that takes a list of questions, randomizes question order and responses, and creates a .pdf. One issue I have is that questions and their responses ...
0
votes
1answer
128 views

Pandoc: not using LaTeX packages

I am using pandoc to convert my .tex-file into a PDF, but my definitions are not being used. Example: \documentclass[12pt,letterpaper]{article} \usepackage[a4paper,margin=1in]{geometry} \usepackage[...
1
vote
1answer
36 views

\renewenvironment for \begin{comment}

In my document, there are several comments like \begin{comment} comment \end{comment} As the comment environment doesn't work, e.g., in footnotes, I want to replace it by the "note" environment. I ...
0
votes
0answers
29 views

What effect \StartShownPreambleCommands has?

It seems to me that the XeTeX is completely insensitive to where do I put \StartShownPreambleCommands or to whether I comment it out. My Q. is what is the intended effect of this command \...
2
votes
2answers
81 views

How to get different chapter titles in TOC

How do I get different chapter titles in TOC, e.g. "Chapter" for the first few chapters and "Appendix" for the last? This is a part of my preamble and my main document: \usepackage[toc,page]{...
0
votes
0answers
32 views

Testing package modifications

How can I add an option to a certain package through the preamble without modifying the *.sty file itself. I need to propose an additional option to the varioref package, I need to test such ...
2
votes
1answer
66 views

Converting pdf to png with htlatex and format controlling problem -resolved

I am using miktex on windows system. I try to convert .tex file to html and then copy it to word. The challenge comes from .pdf figure Converting process can be achieved by the previous post ...
0
votes
0answers
39 views

Is it possible to comment out multiple paragraphs in preamble?

I wonder if there is a way to comment out many paragraphs in preamble. I learned that in the document one can utilize the Comment package. I would like to do the same within the preamble.
1
vote
2answers
108 views

Multi line titles with pandoc

Given the following pandoc preamble: --- title: Data Cleaning and Featurization to Support \\ Data Mining in the SomethingSomething Dataset subtitle: SomeCsClass Final Project with A and B ...
3
votes
2answers
355 views

Add ORCiD logo to moderncv using classic style

I'm trying to add the ORCiD logo to the moderncv using \moderncvstyle{classic}, but I always get an error. For the symbol itself, I tried using academicons package described here: Is there a ...
0
votes
0answers
40 views

Combining multiple tex docs with different documentclass and independent preambles

I am trying to combine different tex documents into a single document. Each document has a different document class and independent preamble. More specifically, I am trying to combine my CV, with my ...
0
votes
0answers
40 views

Compile sub-files independently with standalone

I try to set up an application where no info regarding me is showing on the motivation letter. On the CV on the other hand, it should be. I tried to implement it with the standalone package, where the ...
2
votes
1answer
61 views

Enforcing ImageMagick parameters into tex4ht during magick convert (Windows)

Use of the newer versions of ImageMagick in Windows with MikTeX and tex4ht requires a trick in the preamble to enforce tex4ht to invoke magick convert instead of the previously used convert.exe, which ...
1
vote
1answer
160 views

Text from Preamble in LaTeX document

I'm getting an fl in my document when I compile the the following code: \documentclass{book} \usepackage[utf8]{inputenc} \usepackage[x-1a]{pdfx} \begin{document} \end{document} Can any body tell ...
0
votes
1answer
48 views

Define variables in document so that macro definition goes into preamble

I've written some macros to add OMR characters to the generated document. The OMR characters are needed for an envelope inserter machine. When I want to print OMR characters for a double-sided ...
1
vote
1answer
4k views

'l3regex.sty' not found [duplicate]

I updated my MiKTeX today. Now, I do not get any error without packages but it can not compile my latex files with packages. Uninstalling and reinstalling both Texmaker and Miktex did not work. I ...
1
vote
1answer
351 views

changing name of “nomenclature” not working in lyx

why could it be that the suggested command won't work in Lyx? I am using the "Book (standard) class". Thank you, everyone! \renewcommand\nomname{New Name for Nomenclature} edit: I have to enter the ...
0
votes
1answer
142 views

“LaTeX Error: Can be used only in preamble” for a directive not used except in the preamble

For a markdown doc that has the following preamble: --- title: Cloud Capstone Task1 subtitle: Airline Dataset Queries documentclass: scrartcl author: Stephen Boesch geometry: "fontsize=9pt left=1....
1
vote
1answer
124 views

What preamble or packages do TeX StackExchange answers use?

I want to copy some good answers to my local tex editor in order to review sometimes future. There will be many errors since like ** ** means bold, space x 4 means writing codes, etc. And sometimes ...
0
votes
0answers
31 views

Any Overlapping or Misordering in My Preamble? [duplicate]

I've used both hyperref and url to enable href and url, but heard that they're redundant. Also I realized that ordering \usepackages matters. For example, \usepackage{hyperref} \usepackage[...
2
votes
1answer
74 views

Is it possible to abbreviate a given set of necessary commands in the preamble?

I wonder if it is possible to abbreviate a given set of commands in the preamble? For example, is it possible give a one-line code that abbreviates the commands from \documentclass to \usepackage{}? ...
4
votes
2answers
2k views

Adding google scholar and Researchgate profile to the preamble in moderncv

I'm new to Latex. I am creating my resume using moderncv and I want to add my google scholar and researchgate profiles (icon and clickable link) to the preamble (below the website link in the image). ...
2
votes
2answers
2k views

“LaTeX Error: Can be used only in preamble” even though all directives before begin directive

In the following simplified version of a markdown doc intended for pandoc/latex generation to `pdf: \documentclass{article} \usepackage{unicode-math} \setmainfont{TeX Gyre Schola} \setmathfont{TeX ...
2
votes
1answer
37 views

Can't figure out how to indent with the packages

I'm trying to write my personal statement, and I used some new packages to format it. I can't figure out why it won't let me indent the paragraphs. I've tried \par, \hspace, etc, but I've had no luck. ...
3
votes
1answer
112 views

How do I generate a PDF without compressing the page count?

I need to submit a PDF to an online submission portal that searches the plaintext PDF file for the page count in order to verify that it has the correct number of pages. PdfTeX by default compresses ...
0
votes
3answers
60 views

How to change macro to replace \begin{theorem} … \end{theorem} by \theorem?

To state a theorem, what we do usually : \begin{theorem} ... (statement) ... \end{theorem} I want to change the macro so that I can use \theorem like \section: \theorem ... (statement) ... Is ...
0
votes
2answers
57 views

Error during expanding macro command in preamble

I try to create a command if...else which seems correct when i expand it in body but not in preamble. The package answers seems to be not include because the \Newassociation command is unknown. I try ...
0
votes
2answers
40 views

Title formatting

I have the following code: \title{ \begin{center} CLAXXX Homework X \newline Prof. Professor \newline First Last \newline Day, Month XX, Year \end{center}} \begin{document} \centering \maketitle \...
1
vote
0answers
141 views

Error warning for backward compatibility

Recently I have been using Overleaf and Texworks for my latex and I seem to be getting the error: Package pgfplots Warning: running in backwards compatibility mode (unsuitable tick labels; missing ...
0
votes
1answer
69 views

Use same preamble, title page and TOC across several files

I realized that I use the same preamble across several files. These are mostly articles formatted in precisely the same --- headers, footers, margins, font, etc. Even the title page is formatted the ...
0
votes
1answer
136 views

LuaLaTeX packages for bold math symbols [closed]

I am writing a document, and this is my preamble: \documentclass[11pt]{article} % Packages dealing with fonts \usepackage{mathtools} \usepackage{amssymb} \usepackage{unicode-math} \usepackage{...
1
vote
1answer
154 views

Wrapping preamble in Texstudio

Texstudio offers the handy option to wrap the code corresponding to whole sections, environments, etc. Is there a way to the same with a documents' preamble? I have tried embedding the whole ...
8
votes
2answers
2k views

Palatino Linotype font

The font family attached below is the Platino Linotype font (name from 'MS Word') italicized. Which latex command can be used to automatically generates the font family in math mode throughout the ...
0
votes
2answers
108 views

Can I make the same preamble appear for every document?

I have a lot of commands and packages in my preamble so right now I just have to copy and paste the entire preamble every time I am making a new document. Is there any way to make the same preamble ...
1
vote
1answer
113 views

Define command that can only be used in the preamble

I remember there was a LaTeX macro used internally to define commands that can only be used in the preamble, but I cannot remember its name nor look it up. Which is that command, and how is it used?
1
vote
1answer
190 views

Is it possible to set the draft mode of a document AFTER \documentclass

I am using a precompiled preamble with the \documentclass inside. However, I sometimes want to change the document to 'draftmode'. Recompile the preamble everytime I am doing this is not so ...
0
votes
0answers
68 views

Can I make something like a 'snapshot' of the loaded packages? [duplicate]

Currently may document is not very big, however when using Texworks and have a look at the output prompt what is showing what latex currently does when compiling, nearly 90% of the compilation time it ...
0
votes
1answer
156 views

How to insert pictures with LaTex + dvips + ps2pdf quick build?

I am using a quick build of "LaTex + dvips + ps2pdf + view PDF". What is the easiest way to insert (multiple) pictures? I am fairly comfortable with LaTeX but I have never done this before. So if ...
2
votes
1answer
108 views

\printbibliography by variable years

This is the system I currently have: \defbibcheck{yr2016}{ \iffieldint{year} {\ifnumequal{\thefield{year}}{2016} {\skipentry} {}} {\skipentry} } This should exclude anything except ...

1 2 3 4 5 6