/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

62,020 Subscribers

1

tcolorbox cuts off the first letter of the box's content

I am trying to define a callout box environment to mimic those of obsidian (https://help.obsidian.md/Editing+and+formatting/Callouts).

I have managed to get, to my advice, a pretty good looking copy, but the first letter of the content is being cutoff for some reason. For instance, with the following latex code:

\begin{callout}
    RL excels in \textbf{complex} and/or \textbf{uncertain} environments. For instance, the chess game is a rule-based environment , but the set of possible moves is so vast that it is impractical to manually specify all possible situations for a supervised learning approach. RL is a better fit in such cases, as the agent learns directly from experience. 
\end{callout}

the following callbout box is rendered:

https://preview.redd.it/8rnuwf6wos4e1.png?width=794&format=png&auto=webp&s=766d6022a2ef5df93b396de38d61c0c4ec2bbdff

As you can see, the first letter 'R' gets cutoff and I have no idea why. I'd also like to add vertical space between the title and the content. I tried to add \vspace{0.3cm} in the env definition but it adds vertical space on each newline. This is my source code:

%% Callout Boxes 
\definecolor{info-bg}{HTML}{E6F0FC} 
\definecolor{info-title}{HTML}{1977E0}

\definecolor{tip-bg}{HTML}{E5F8F8}
\definecolor{tip-title}{HTML}{15C5C2}

\definecolor{faq-bg}{HTML}{FDF1E5}
\definecolor{faq-title}{HTML}{EC7500}

\definecolor{success-bg}{HTML}{E6F8ED} % Green
\definecolor{success-title}{HTML}{08B94E}

\definecolor{error-bg}{HTML}{FDEAEC}
\definecolor{error-title}{HTML}{E93147}

\definecolor{quote-bg}{HTML}{E6E6E6}
\definecolor{quote-line}{HTML}{6D52D5}

\newcommand{\infoicon}{\faInfoCircle}
\newcommand{\tipicon}{\faLightbulbO}
\newcommand{\faqicon}{\faQuestionCircle}
\newcommand{\successicon}{\faCheckCircle}
\newcommand{\erroricon}{\faTimesCircle}

% Function to map icon names to icon commands
\newcommand{\geticon}[1]{%
  \ifstrequal{#1}{info}{\infoicon}{%
  \ifstrequal{#1}{tip}{\tipicon}{%
  \ifstrequal{#1}{faq}{\faqicon}{%
  \ifstrequal{#1}{success}{\successicon}{%
  \ifstrequal{#1}{error}{\erroricon}{\faInfoCircle}% default icon
}}}}}

\newtcolorbox[auto counter,number within=chapter]{calloutbox-with-label}[2]{
    colback=#1,
    arc=3pt,
    boxrule=0pt,frame hidden,
    enhanced,
    left=10pt,
    right=10pt,
    top=8pt,
    bottom=8pt,
    label=#2,
    breakable,
}

\newtcolorbox[auto counter,number within=chapter]{calloutbox-without-label}[1]{
    colback=#1,
    arc=3pt,
    boxrule=0pt,frame hidden,
    enhanced,
    left=10pt,
    right=10pt,
    top=8pt,
    bottom=8pt,
    breakable
}

\NewDocumentEnvironment{callout}{O{info} o m}{
    \IfValueTF{#2}{\def\callouttitle{#2}}{\def\callouttitle{\capitalisewords{#1}}}
    \IfValueTF{#3}{\def\calloutlabel{#3}}{\def\calloutlabel{}}
    \IfValueTF{#3}{\def\calloutbox{calloutbox-with-label}}{\def\calloutbox{calloutbox-without-label}}

    \vspace{0.1cm}
    \begin{\calloutbox}{#1-bg}{\calloutlabel}
    \textcolor{#1-title}{%
    \geticon{#1} \space \space \bfseries \callouttitle%
    \IfValueTF{#3}{ (\thetcbcounter)}{}%
    }\par
}{
    \end{\calloutbox}
    \vspace{0.1cm}
}
2 Comments
2024/12/04
08:49 UTC

286

Working offline is pretty comfy at times

29 Comments
2024/12/04
05:25 UTC

3

Why are my underlines broken up? How can I fix them?

You should know, I have been using Latex for only three days. I’m sure you remember a time when everyone you needed to do the simplest thing you worked need to look up documentation and add a new package you hasn’t heard of. I’m there.

I tried to underline some text. Really, just the equivalent of Ctrl+U from Word. (I know the difference between Word and Latex.) So, /underline, but the result looks more like an no overline on the next line. How do I adjust the vertical positioning? I don’t, I use soul etc.

Long story short, ulem, soul and I think even the kitz packages give me underlines that are positioned vertically the way I want, but look like this: __ . _ . ____ __ . _

In some attempts I saw them line up with spaces between words and descenders, but there were also some attempts where it breaks up in the middle of a long word with no descenders.

So, how do you all nudge an underline a bit up without the document telling you “ha ha, you suck you stupid human” in Morse code?

8 Comments
2024/12/03
22:44 UTC

24

I just realized

9 Comments
2024/12/03
22:19 UTC

20

Why would anyone want to use cloud based services like overleaf?

It seems obvious that having a local compiler + version control is the only non-frivolous way

34 Comments
2024/12/03
21:56 UTC

0

[Linux/Debian/Ubuntu] Any alternatives to `tlmgr`?

Aloha, folks! 👋

I've got a question for you: is there an alternative to tlmgr for installing external LaTeX packages?

Every time I try to install a package, I keep running into the same issue: "Permission denied." It’s frustrating because the last time this happened, I managed to fix it, but only after a lot of trial and error. I'd rather avoid guessing my way through commands if I can.
Has anyone here tried other package managers for LaTeX, or found a smoother way to handle this? I'd really appreciate any recommendations or advice!

Thanks in advance!

11 Comments
2024/12/03
19:25 UTC

832

texworks vs overleaf meme

81 Comments
2024/12/03
17:50 UTC

1

Fonts to slower reading

Most used fonts are meant for fast reading and have specific features promoting it, like clearly visible and uniform horizontal level of many glyph features. However, sometimes it is desirable to deliberately break away from fast reading. For example, if the document is heavy with diagrams with minimal text, there is no reason to promote fast reading. No, in this case it is desirable to make sure that text was easy to read, but the reader mulled over the text with many important nuances.

What fonts (and their combinations) would you suggest in the case and why? At the moment my best candidate is Comic Neue, but I'm fairly certain there are better options.

0 Comments
2024/12/03
16:50 UTC

2

Package homework slow to compile?

I want to use the homework document template for some of my assignments because it looks nice, but whenever I try to compile a document using it, either on Overleaf or even locally, it takes much longer compared to say article. One of my machines kept telling me I needed Brazilian in Babel to compile homework template for some odd reason which I don’t even speak. I know I could make my own but I’d rather use the one already there because I’m not that savvy. Even a clean document with only a title and a sentence takes about 30 seconds to compile with homework class compared to article which is done instantly.

1 Comment
2024/12/03
16:16 UTC

12

Overleaf looks back up

I have just managed to get into Overleaf and log in. First thing I am doing is downloading all my collections!

7 Comments
2024/12/03
14:58 UTC

0

Reliable sources claim that Overleaf is expected to be available within 12 days

As title says

2 Comments
2024/12/03
14:55 UTC

0

When is overleaf going to be back up

Please……. I have things to turn in

8 Comments
2024/12/03
14:41 UTC

464

On overleaf rn

42 Comments
2024/12/03
14:30 UTC

1

Is Overleaf shut down?

Error 502 is occurring and I’m writing my master thesis 🥲

12 Comments
2024/12/03
14:09 UTC

31

A music for Overleaf downtime and the upcoming deadline!

3 Comments
2024/12/03
14:01 UTC

7

Overleaf seem to be down and help is needed...

Does anyone know what is going on with Overleaf and how to fix this?

First I got this on Chrome and Firefox:

https://preview.redd.it/yuxto8leum4e1.png?width=1918&format=png&auto=webp&s=99701e711ff4748d2d9b3da8a0fb2be8348e1bea

I tried to refresh Overleaf and restart the browser and remove browser data, but now I am getting a 502 error and this message:

https://preview.redd.it/l3utdjxhum4e1.png?width=837&format=png&auto=webp&s=3a874564aa92a2913ec85a7be61428d2e446234e

Does anyone know what to do with this issue?

12 Comments
2024/12/03
13:09 UTC

145

Thesis submission but overleaf is down....

I sort of have to submit my thesis and overleaf has decided to fuck me over....

I have like pdfs of the doc but I wanted to do a last check and make some amendments....

trigger warning: what do I do besides cry and consider jumping off my balcony????

EDIT: CRISIS OVER - IT'S BACK UP!!!!

(Also how did we not realise I was talking about paragliding to distract me?)

131 Comments
2024/12/03
12:56 UTC

0

A voi funziona LateX?

Buongiorno, tra pochi giorni devo consegnare la tesi ma noto che il sito di LateX non carica. Anche a voi? C’è un modo per recuperare i miei file?

3 Comments
2024/12/03
12:43 UTC

132

Overleaf Down?

I was working on my research paper, and all of a sudden, the files failed to load. Now, as I open Overleaf's main page, it shows the following error message:

Overleaf error message page

Did you guys also encounter this problem? It seems that their server has just crashed ...

163 Comments
2024/12/03
12:17 UTC

3

Build time very slow

So I'm using VSCode with Latex Workshop as my main editor. My compiler is TexLive. I have been waiting for 2 minutes for my two page file to finish building (as indicated by the rotating Build arrow). It's taking a very long time.

My laptop is a 6 year old Lenovo Ideapad 330 15IKB. I'm running Windows 11. Should I use TexStudio instead? Please help me.

7 Comments
2024/12/03
07:54 UTC

19

How to remove headers and page number from blank pages?

I want to remove headers and blank pages from the blank pages of my documents. These are the blank pages after a chapter ends.

I am using document class book. I am also using cleardoublepage and thispagestyle{empty}

Here's my code: \include{Dissertation/Chapter1} \cleardoublepage \thispagestyle{empty} \include{Dissertation/Chapter2} \cleardoublepage \thispagestyle{empty} \include{Dissertation/Chapter3} \cleardoublepage \thispagestyle{empty}

I want this page completely blank.

3 Comments
2024/12/02
18:59 UTC

1

Jake's Resume LaTex Template (Overleaf)- Help needed with changing font

Hey guys, i have recently started using LaTex for my resume after hearing positive things about it. I am using the template - Jake's Resume (Anonymous) on Overleaf and tweaking it as I need but I am having troubles figuring out how to change the font to a more modern/simplistic looking font. Any help would be appreciated :)

10 Comments
2024/12/02
16:50 UTC

4

How to write capital Greek letters

15 Comments
2024/12/02
16:23 UTC

1

Problem with viewing a LaTeX-Based eBook (“Math Input Errors”)

Hey everyone,

I’ve encountered an issue with an eBook that was written in LaTeX. On many pages, I’m seeing “math input errors” instead of properly formatted content.

Does anyone know why this might be happening or how I can view the book correctly? I’m not sure if it’s an issue with the eBook reader I’m using or if something went wrong during the book’s conversion process.

I’d really appreciate any advice or tools that could help fix or properly display the book. Thanks in advance!

5 Comments
2024/12/02
15:01 UTC

1

Help fixing formatting bug

So I am very vanilla at latex and I use overleaf due to it being beginner friendly (and also what my university has told me to use many years ago). I was formatting a review article, then tried to apply some formatting I already used in other documents (the tikz style topic), but it got wrecked by the double column format.

Can anyone help me undo this or maybe propose a new alternative? Here are some bug images. I would like for the main section to be on the right, and the subsection on the left, as you can check below. The line should respect the double column format and would be nice if it could be until the end of the page, just like in "Legislação Internacional" in figure 2.

The line without any text in page 1 should be a section named "Discussão", but it was completely erased.

To summer up:
- Topics are named "Introdução", "Discussão" (not shown) and "Conclusão" and would be nice for them to be at the right aling.

- Subtopics are named "NR 16 - Periculosidade" and "Legislação Internacional" and would be nice for them to be at the left align.

Here is the tikz command:

\begin{tikzpicture}[auto, node distance=16.5cm,>=latex']
    \node [name=input] {};
    \node [right of=input] (controller) {\huge\sc \textcolor[HTML]{005B81}{Conclusão}};
    \draw [blueM, line width=1.5pt, -] (input) -- (controller);
\end{tikzpicture}
\vspace{0.5cm}

\vspace{0.25cm}
\begin{tikzpicture}[auto, node distance=15.50cm,>=latex']
    \node [name=input] {};
    \node [left of=input] (controller) {\Large\sc\textcolor[HTML]{005B81}{NR - 16: Periculosidade}};
    \draw [blueM, line width=1.5pt, -] (controller) -- (input);
\end{tikzpicture}

I'm using "\documentclass[11pt,letterpaper,twocolumn]{article}" at the start.

Thanks to everyone who even read to this point :)

https://preview.redd.it/psb0b9ur2g4e1.png?width=677&format=png&auto=webp&s=7e601d0f60a0779bdf558743c59eeb93c35cc417

https://preview.redd.it/ik3muaur2g4e1.png?width=695&format=png&auto=webp&s=dc134877f34d987ebcc57e3180070b8f11bbfcd3

https://preview.redd.it/h3n6b8ur2g4e1.png?width=693&format=png&auto=webp&s=1f8066a7b99a77a8bd25f40c30f054118bbaa2ed

0 Comments
2024/12/02
14:27 UTC

0

JabRef Help: automatically get pdfs using institution credentials

Hello,

In JabRef, if you have the proper links, you can auto download pdfs from online for each of the papers you are citing.

However, there is usually a paywall to access a pdf. This is fine in browser because I can login to my University credentials and get access that way. Can this be done in jabref? I've read around a little and some schools have ezproxies including mine. can that be used? What about google scholar? I know jabref lets you set a custom DOI base.

If you've ever done this successfully, let me know.

Thanks!

0 Comments
2024/12/02
03:31 UTC

37

Explain why the math equation are in middle instead of in expression ?

15 Comments
2024/12/01
22:17 UTC

1

Problems using the Augie font from the emerald package

Several days ago I found the Augie font in an answer to this TeX StackExchange question. I used it in a couple files, and it worked fine. I ran updates in MiKTeX Console a day or two later, and now a hello_world.tex with Augie

\documentclass{book}
\usepackage{emerald}

\begin{document}
% Hello World
{\ECFAugie HELLO WORLD}
\end{document}

gives an error Font OT1/fau/m/n/10=faumw7t at 10.0pt not loadable: Metric (TFM) file not found. <to be read again>.

I did pdflatex --version and I'm apparently on MiKTeX 24.4 now.

When I check C:\Users\<username>\AppData\Local\Programs\MiKTeX\tex\latex I see the emerald folder there.

When I check C:\Users\<username>\AppData\Local\Programs\MiKTeX\tex\latex\emerald\fonts\tfm\emerald I see the faumw7t.tfm file there.

I have no clue what to try next. Any help is appreciated.

3 Comments
2024/12/01
17:55 UTC

1

LaTeX Citations not Working Correctly After Certain Point

In my LaTeX paper (in Overleaf), all of the citations at the start are working perfectly. However, after a point, all the new citations in the paper all show as [?]. The code editor itself shows an error message that Citation \vincent_2023' on page 4 undefined on input line 547.All citations aftervincent_2023` also do this. However, the citation is in the main bibliography .bib file that also contains all the citations that are working. Why is this problem occurring?

Snapshot ofsn-bibliography.bib (google_recommendation is working, but vincent_2023 is not):

u/misc{google_recommendations,
  title = {Recommendations for Regulating AI},
  url = {https://ai.google/static/documents/recommendations-for-regulating-ai.pdf},
  publisher = {Google},
}
u/misc{vincent_2023,
  author = {Vincent, James},
  month = {03},
  title = {Meta’s powerful AI language model has leaked online — what happens now?},
  url = {https://www.theverge.com/2023/3/8/23629362/meta-ai-language-model-llama-leak-online-misuse},
  year = {2023},
  publisher = {The Verge}
}

Snapshot of main.tex:

The careless release of advanced AI has already caused harm—when Meta’s cutting-edge LLaMA model leaked from its select release in just weeks, it became available for anyone to improve, use, or abuse. \cite{vincent_2023}, \cite{rodriguez_2023}. Restricting the release of advanced AI directly addresses this issue, making it less likely a frontier model will be entirely leaked.

I am not sure why this is occurring and would appreciate any support on this.

5 Comments
2024/12/01
03:13 UTC

5

Organizing long academic paper with proofs in the appendix -- alternatives to apxproof?

TL;DR: How to better organize the LaTeX document structure of a long academic paper with many proofs appearing in the appendix?

I'm preparing to combine three papers into my thesis, but their LaTeX source files are poorly organized. My papers are anywhere from 40-80 pages single-spaced, and each is all contained in its own one massive .tex file. I'd like to split each paper's source code into individual input files for better organization.

The main challenge involves managing the proofs, which make up most of each paper (e.g., one paper is 25 pages of 'main' text and 50 pages of proofs). I've been using the apxproof package, which allows me to write something like:

\begin{theorem} 
Let A be an apple. Then A is a fruit.
\end{theorem}

\begin{toappendix}
\begin{proof}
Left as an exercise to the reader.
\end{proof}
\end{toappendix}

I can simply enclose the proof environment with \begin{toappendix} and \end{toappendix}. THe apxproof package conveniently creates the appendix with the appropriate sectioning and migrates the proof there. That way I don't have to type the proof somewhere else completely in the source file.

This is nice, but I'd like to migrate to the more old fashioned way of just writing the proof somewhere and manually telling LaTeX where to put it. Especially because I need to combine three different papers into one gigantic thesis, and the automatic sectioning from apxproof suddenly becomes a massive pain.

Is there a non-tortuous way to do this? Say a paper has 20 different proofs relegated to the appendix. Do I make a different source file per proof? I'm worried I'll miss something if I just move massive chunks of text from one big source file to another big source file.

Looking for a solution that doesn't involve diving into esoteric documentation.

3 Comments
2024/12/01
03:03 UTC

Back To Top