/r/LaTeX

Photograph via snooOG

Whether you are just getting started with LaTeX and wondering what the fuss is about, here to share the clever trick you've discovered, or need urgent help with your bibliography, welcome to the LaTeX subreddit!


Resources:

Getting started

Topic specific resources

Dedicated users of this sub may write to the mods for a custom flair :)


Related subs

/r/LaTeX

64,735 Subscribers

0

Overleaf only compiles one \input file in my main section

Hi I hope this makes sense, I'm very new to using overleaf.

I split up my sections into separate file in the overall workspace. I've been using

\input{name}

To incorporate the different files/sections I have. It works fine when it's just one \input{name} but when I try to include more than one, overleaf doesn't compile them and only shows me one \input{name} file.

5 Comments
2025/02/04
03:29 UTC

3

Please help me center this table (code in comments)

4 Comments
2025/02/03
23:21 UTC

0

Try this with AI. You're welcome.

output the following text by converting what is between brackets from english to latex via math notation and putting what is between square brackets into display mode:

Clearly (braces around x) is a subset of (script A). Hence [A is parlallel to B]

7 Comments
2025/02/03
12:17 UTC

2

MiKTeX updates fail: Fix: Peer certificate cannot be authenticated with given CA certificates

Does anyone know a quick an easy fix to make MikTex updates work in win11?

https://preview.redd.it/pifr9h4tpwge1.png?width=794&format=png&auto=webp&s=46343707b3696797e7ad0f5cd14c6c2347eba827

I cannot use TeXstudio because I cannot install the updates of MiKTeX after installing MiKTeX .

I receive this error when I try to install MiKTeX updtes.

Fix: Peer certificate cannot be authenticated with given CA certificates

I already downloaded https://crt.sh/?d=9314791

and import it in

https://preview.redd.it/u5hw2cyfpwge1.png?width=263&format=png&auto=webp&s=27da57f32391c3bb59cc8413c143be94d3214f1b

https://preview.redd.it/pa6wj0g8pwge1.png?width=727&format=png&auto=webp&s=bf39f54aeac4786a5c00a345530ad5b3ccd1225c

I also restarted Win11 to no avail.

Thanks

3 Comments
2025/02/03
11:10 UTC

0

Using Overleaf how do i make Latex to cite correctly

My professor require me to use chicago Author-Date style. Now I tried following code given to me by ChatGPT

\usepackage[style=chicago-authordate,backend=biber]{biblatex}

It however does not give the the required citations which are. Author. Date. "Title"........

It also does not give me Author and Date in the short reference but only the Author. Does anyone know a fix?

4 Comments
2025/02/03
08:50 UTC

3

Can you make a command with two optional parameters?

I know that you can use \newcommand{\name}[number of parameters][default for #1]{function}, but can I make two parameters be optional? I made a function to make my friends’ and my lives a little easier on homework by making it faster to type eg dy/dt. I have \newcommand{\dd}[2][t]{\frac{d{#2}}{d{#1}}. The default independent variable is t because it’s the most common on our homework. I would like to be able to have #2 be empty by default, so \dd gives d/dt without the need for open curly brackets.

18 Comments
2025/02/02
23:54 UTC

0

Choix de l’éditeur LaTeX

Bonjour tout le monde ! Il y a quelques temps j’écrivais tous mes rapports sur overleaf, mais souhaitant un éditeur plus personnalisable et «fiable » je suis passé à VS code. Je suis satisfait des résultats mais j’entends pas mal de gens conseiller d’utiliser neovim avec le plugin vimtex, qu’en pensez vous ? Je précise que je ne m’y connais pas du tout en codage (notamment via le terminal) et que les seuls languages que je connais sont R et LaTeX. J’aimerais donc des retours et des avis sur les deux éditeurs pour enfin pouvoir de décider ! Merci beaucoup pour votre aide :)

5 Comments
2025/02/02
22:53 UTC

0

Can I get Latex support here? If so, why am I getting "Undefined control sequence"?

Why does my compiler (overleaf.com) say that "\end{align*}" at the end of this code is an "Undefined control sequence"? (Also, how do I post code in this sub?)

\documentclass[12pt,fleqn]{exam}
\pagestyle{plain}
\parskip=8pt
\parindent=0pt
\topmargin=-.8in
\textheight=9.5in
\oddsidemargin -0.05 in
\textwidth 6.6 in
\usepackage{graphicx,amsmath,amssymb}
\pagestyle{head}
\begin{document}
\begin{questions} 
\question (3 points)  Solve the equation $7(x-1)+4=3-2x$.
\textbf{Solution}: 
\begin{align*}
    7(x-1) + 4 &= 3 - 2x \\
    7x - 7 + 4 &= 3 - 2x \\
    7x - 3 &= 3 - 2x \\
    7x - 3 + 2x &= 3 - 2x + 2x \\
    9x - 3 &= 3 \\
    9x - 3 + 3 &= 3 + 3 \\
    9x &= 6 \\
    \frac{9x}{9} &= \frac 69 \\
    \bm{x} &= \bm{\frac 23}
\end{align*}

.....

7 Comments
2025/02/02
18:37 UTC

3

Cross reference between two .tex files in Overleaf

I am writing a paper in Overleaf and I am required to split the appendix into an independent.tex file for submission. I create 'supplementary.tex' for appendix and in 'main.tex' I am using following lines to cite tables and figures from 'supplementary.tex'. I tried to set each file as main file and recompile from scratch, but the reference in main.tex always show as '??'. Appreciate for any support and suggestion

\usepackage{xr}

\externaldocument{supplementary}

2 Comments
2025/02/02
15:21 UTC

3

IEEE Journal: single column page in double column document

I am using \documentclass[journal]{IEEEtran}and want to have a single page, the title page, to be in a single column format. I tried inserting a cover page with\include{} but, it has to follow the formatting of the main document. Is there any way to accomplish this?

3 Comments
2025/02/02
11:59 UTC

15

Switching from overleaf to vscode

I wrote a master's thesis on overleaf and I'm happy with it. Now I am tackling the task of writing a thesis and it seems preferable to switch to local software for greater security. So I installed vscode, the latex workshop plugin and mactex on my MacBook. After downloading my overleaf project, it opens correctly but it is impossible to have the pdf with a correct bibliography. Citations appear in key form and not to the required APA standards. Any idea? Thank you so much !

14 Comments
2025/02/02
10:39 UTC

5

Is there any way to have sans serif greek in math mode?

I want to use Helvetica for all of my document but I'm having trouble with sans serif lowercase greek letters. I tried \mathsf but it doesn't work. Can anyone help me please, thanks in advance!

2 Comments
2025/02/01
20:19 UTC

1

Does \hspace*{-2cm} not work on align*?

It works fine on array and tabular. I want a whole align* moved 2cm to the left. How do I do that? I use amsbook, in case that matters. Thanks.

1 Comment
2025/02/01
19:05 UTC

2

How do I change the math font using Babel?

Currently, in my document, I am using:

\babelfont{rm}{Avrile Serif} \babelfont{sf}{Avrile Sans} \babelfont{tt}{CMU Typewriter Text}

And I want for these fonts to also display in math mode, and I have no idea how to do it.

Has anybody solved this problem?

1 Comment
2025/02/01
16:52 UTC

0

Bibliography on Beamer

Hi! I'm using Beamer for the first time and trying to use citations and make a bibliography, but every time I try to introduce a citation, I get the following error: "TeX capacity exceeded, sorry [parameter stack size=20000]." (it appears right by the \end{frame} command).

According to Google, that's somehow related to recursion but I'm still not sure what that means or how to fix it. I've never had problems with bibliographies before using Beamer.

Thank you in advance!

2 Comments
2025/02/01
16:51 UTC

48

Is Vim/NeoVim actually a productivity boost for LaTeX?

I originally used Tex Studio to write my thesis, which was my first serious LaTeX work. I moved to VSCode a couple of years ago and it is generally OK, but I am hearing mixed things about Vim/NeoVim and productivity boosts.

I'm in pure math if that is relevant.

Does anyone have any actual experience and can give some idea about whether the fairly significant investment in time initially actually pays dividends in terms of writing speed/snippets/general editing?

It is also possible I am not fully using the capabilities of VSCode for this too.

39 Comments
2025/02/01
12:44 UTC

2

TexWorks bib

Hello!

I would like to add a bibliography from a .bib file in texworks. I want the whole bib file to print, as it is a bibliography. No matter what guide I follow I can't get this to happen. It either doesn't compile giving no useful errors, or compiles without anything displayed from the bib.

To be honest, I cannot tell if it is a skill issue and I am being moronic, but I'm doing my best ahahahah.

As it stands, I have in preamble

\usepackage{biblatex} \addbibresource{BP01.bib}

and in the document

\nocite{*} \printbibliography \end{document}

4 Comments
2025/01/31
17:41 UTC

0

Help with customising section numbers

If I have a section within a chapter is there a way of having only the section number displayed, for example if I have the second section in the third chapter, I want the number with it to just be 2 not 3.2.

2 Comments
2025/01/31
17:22 UTC

1

ifthenelse not working with /def

Good evening.

I am trying to make a small script on a custom class where the user can select between two strings (let's pretend they are "abc" and "xyz") and based on that value, LaTeX shall change the footer and header image of the whole document. I made the following code which works pretty fine:

\newcommand{\group}{abc}% group
\newcommand{\logo}{}
\newcommand{\footer}{}

\ifthenelse{\equal{\group}{abc}}
{
\renewcommand{\logo}
{
/Common/abc.png
}
\renewcommand{\footer}
{
foo
}

}

\ifthenelse{\equal{\group}{xyz}}
{
\renewcommand{\logo}
{
/Common/xyz.png
}
\renewcommand{\footer}
{
foo
}
}

(I hope it's understandable, the "Code thing" from Reddit was not working...)

However, if I change the \newcommand{\group}{abc} into \newcommand{\group}[1]{\def\@group{#1}} in order to make the user type the string from the document instead the class, I get errors like: Argument of \group has an extra }. \ifthenelse{\equal{\group}{abc}} which is completely nonsense because it's not having extra brackets anywhere (?)

Can you help me figuring out what am I missing?

4 Comments
2025/01/31
17:15 UTC

5

WoW Target Marker in LaTeX

https://preview.redd.it/gebyw8uuwcge1.jpg?width=256&format=pjpg&auto=webp&s=69cfbedb0057aae6a0be352c80a7d827c8dc90b6

Hello everyone,

I got myself into a silly project for my WoW guildmates by creating a math-related document in LaTeX to explain a boss mechanic. My problem is the following: I can't find a package that allows me to use WoW target markers in LaTeX. Surely, I must be the only idiot who wants to use them in a LaTeX document, so maybe I have to create it myself.

How can I create my own package to add those symbols?

Thanks in advance for any answers or advice!

21 Comments
2025/01/31
16:38 UTC

5

Align sub figures with different caption length

https://preview.redd.it/3e79wq6zacge1.png?width=961&format=png&auto=webp&s=eb3a6b7d0ae8b791d6258091cda1cd11b0fa8da9

I am writing a small report for one of course in Latex and I was wondering if its possible to align those two subfigures even though the first one has a longer caption?
Thanks in advance for every response

4 Comments
2025/01/31
14:34 UTC

50

Is this font available in LaTeX?

23 Comments
2025/01/31
13:13 UTC

1

How can I move an array horizontally?

I have an array that cuts too deep into the gutter, Amazon KDP always rejects that and says insufficient gutter. But on the side of the page there is plenty of margin, and I know KDP allows writing in the margins, because I use plenty of \marginnote. How can I move an entire array, say, 2 cm to the right or left, i. e. away from the gutter but extruding in the margin? I use amsbook, in case that matters. Thanks.

Update 44 minutes later, I think I found it, \hspace*{-1cm}.

4 Comments
2025/01/30
22:15 UTC

17

Can someone do this graphic with latex?

I've been trying to make this graphic work, but not even Gemini could figure it out.

17 Comments
2025/01/30
19:55 UTC

1

How to make an Å in Latex

I want to use the unit Angstrom in my code, but the next character gets swallowed no matter what i do any suggestions?

I tried:
\AA
\r{A}
Å --> the unicode Character

I tried all of them with:
\AA~
\text{\AA}
\texttt{\AA}
\AA\text{}
\AA\text{~}
\AA\texttt{}
\AA\texttt{~}
$mathrm{\AA}$
\AA \quad
I really got no idea but It always leads to the same results --> pic whith the code: with 6.42~\ang by more

(Defined my own \ang command \newcommand{\ang}[1]{\AA} )

22 Comments
2025/01/30
17:18 UTC

1

Custom font for LaTeX document with Math support and font identification.

(Maybe this question is better asked in a typography subreddit, but I does include LaTeX specific questions.)
I would like to create a LateX template that looks in style very similar to this:

https://preview.redd.it/qgzx5sfcb5ge1.png?width=2548&format=png&auto=webp&s=7e88bf2696a54e491a88cb5502c4c1e79bad9b34

This is a from the book "Artin, Algebraic Geometry, Notes for a Course" but I did not find the specific fonts used anywhere. So my questions are:

What font is used for the main text?
What font is used for the math text? (In particular, what font is used for the blackboard letters and calligraphy letters?)

Using "Whatthefont" I found a font that looks very similar and that I like: https://www.myfonts.com/de/products/eloquence-complete-family-package-212538?srsltid=AfmBOooAEiKpJhNH7IWLcWBHNg0mhaFGUXj1kB2eZNz04VxezO37T233

Would it be possible to make a similar looking LaTeX template using this font? Since the font is not designed with math support in mind, would I also have to acquire additional fonts for math mode text?

2 Comments
2025/01/30
15:07 UTC

3

Project hierarchy with tikz/externalize and subfiles

Hi guys,

I'm working on a fairly large document (200+ pages, with lots of circuitikz and pgfplots), at first I started using subfiles to speed up the editing but even that reached a limit and forced me to also use tikz/externalize.

My issue is that I'm working on both overleaf and a local LaTeX installation on windows, synched by github.

My project folder is something like

root
|-main.tex
|-settings
|-content
--|-part1
----|-text.tex
----|-ch1
------|-text.tex
----|-ch2
----|-text.tex
--|-part2
----|-text.tex
----|-ch1
------|-text.tex
----|-ch2
----|-text.tex

And so on.

I managed to have tikz create a directory .tikz/ directory in the folder in which each text.tex file is located using some shell escape, and I've confirmed that it works both on Windows and overleaf.

root
|-main.tex
|-settings
|-content
--|-part1
----|-text.tex
----|-.tikz/
----|-ch1
------|-.tikz/
------|-text.tex
----|-ch2
------|-.tikz/
------|-text.tex
--|-part2
----|-text.tex
----|-.tikz/
----|-ch1
------|-.tikz/
------|-text.tex
----|-ch2
------|-.tikz/
------|-text.tex

I have the following issues:

  • This setup work properly when run from the main file, and when run from any subfile if no modifications to the project have been made to any tikz picture.
  • This setup work properly when only run from the main file, if any modification has been made to any tikz picture.

Right now, I've solved this by removing subfile and running the entire document, which is now really fast compared to before, but I'd like to have the flexibility of subfiles back.

Also, I'm looking for a way to keep the tikz externalized file even if i change the order of the pictures in the document, or if I add one at the beginning, right now I have to re-generate the entire subfile.

4 Comments
2025/01/30
10:54 UTC

117

It is possible to do this in latex?

I have seen this useful tip to write an abstract and I would like to use this when doing clarification in my notes, so I was wondering if there is a way to make this.

I know that with the to-do package it's possible to do something similar, but without the highlight of the related text.

Thanks for reading.

PD: Also if anyone is writing an abstract this is very helpful.

12 Comments
2025/01/30
08:13 UTC

489

i was feeling creative

14 Comments
2025/01/30
03:47 UTC

Back To Top