/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

54,774 Subscribers

1

Write a lower subscript without indent

trying to type I_net like this, but when I try it, it makes a large indent like Hlc. what is the code to write the subscript like Inet?

https://preview.redd.it/od6vjpbysh0d1.png?width=468&format=png&auto=webp&s=51c47aec663fb69309d6c5153a836892c588aa0f

0 Comments
2024/05/15
01:25 UTC

2

Having the number of a chapter inside it's {}

Hi

I'm trying to have \chapter{SomethingNot_Changing TheActualNumberOfTheChapter}

Can't find how to do that.

Help welcome.
Many THX

2 Comments
2024/05/14
20:40 UTC

5

Does any one know how I can have a header that looks like this

1 Comment
2024/05/14
19:18 UTC

2

Open-source LaTeX Book in 2024?

Better design, new features and more! https://github.com/AnMnv/eBook

... and this is the most popular open source LaTeX book on github ❤️ https://github.com/AnMnv/eBook

2 Comments
2024/05/14
18:20 UTC

1

How do I uninstall texlive on ubuntu (popOS 22.04)?

I've installed it with the quick install guide with this website https://www.tug.org/texlive/quickinstall.html
Yet I still have problems compiling my tex-file (namely with the minted package not recognized) so I wanted to reinstall it again through the apt-get command.

So...how do I uninstall it?

thanks in advance

4 Comments
2024/05/14
17:20 UTC

2

Can't use \renewcommand inside package

When I write \renewcommand{\th}{\theta} in my document, it works fine, but when I put this same line in a .sty file that I then load, it doesn't work. It acts like the command was never redefined. \newcommand works as usual in both cases. What's going on? I'm using Overleaf.

2 Comments
2024/05/14
16:15 UTC

2

How to use ConTeX on Windows

Hello,

I apologize if my questions seem basic, but I’m curious about the best way to use ConTeX on Windows. Specifically, I’d like to know which TeX distribution to install and whether there’s a recommended distribution. Are MiKTeX or TeX Live all I need? Additionally, could you suggest an editor with ConTeX integration? Is TeXstudio good choice?

Thank you all for your valuable info!

2 Comments
2024/05/14
16:10 UTC

5

Questions / Suggestions for LaTeX workflow using iPad (for notetaking)

Hi, I am studying maths and currently use LaTeX to take my notes in class in real time. This has been effective so far, however the main drawback appears to be when my lecturer draws diagrams to make examples clearer, I have no real way of doing this in LaTeX at the moment. For context, here is a snippet from my notes. I have a few potential methods:

  • TikZ - I have all but discounted this as becoming fast enough at TikZ to use in real time seems nigh impossible / not something I'm interested in pursuing.

  • Creating a more functional workflow using inkscape and VS Code, which I'm somewhat hesitant to do given the overall increased complexity of drawing vector graphics on a laptop.

  • Switching to obsidian, and using my iPad to draw the diagrams and my laptop to write the notes. Any suggestions along these lines would be appreciated although this probably isn't the place!

Some ideas I have had yet not been able to find anything about online:

  • Some way of annotating onto pdfs with apple pencil without the annotations being removed upon recompiling my LaTeX documents. This would be a somewhat messy but easy and effective solution if this is possible.

  • Perhaps the ideal workflow would be some way of drawing / creating quick vector images on my iPad and then having them pop into my LaTeX documents quickly. I currently use OneDrive to store my LaTeX files which makes me think this is a potentially valid approach, however I would very much appreciate suggestions on how to achieve this.

If anyone has had any similar experience, please let me know.

1 Comment
2024/05/14
13:55 UTC

1

How to open REVTeX template on Intellij IDEA?

Running Intellij IDEA with Texify + PDF Viewer plugins on a MikTeX distribution. Have got all the recommended packages on the REVTex site installed (I think) through the MikTeX console.

How on earth do I open the REVTex template? I've tried copying the code from Overleaf but it doesn't compile. No PDF preview opens.

Another question: within the same project, I deleted the original X.tex and created a new file Y.tex with a different name. When I run the compiler, it still tries to compile X.tex and says that it isn't found. Why is this the case?

Total newbie here, have been working really happily on my own custom Word template with embedded fonts but thought I'd spend some time trying LaTeX out... feeling like I should give up every certification I've ever owned at the moment.

0 Comments
2024/05/14
11:20 UTC

2

Formatting Discrete Mathematics Equations In LaTex using Codio

Hello I’m a student taking a Discrete Mathematics class at my university. I understand the material, but have to submit my problem set assignments via LaTex through Codio?

Are there any articles, videos, walking you step-by-step on how to format math equations using LaTex?

Thank you so much for your assistance everyone!

3 Comments
2024/05/14
06:04 UTC

1

Mini vim window from inkscape-shortcut-manager

Hello everyone,

I just started learning LaTeX and after following the resources below I finally have (almost) everything setup on macos. The only feature I'm having trouble getting to work is the mini vim window from (to type and render LaTeX directly in inkscape) inkscape-shortcut-manager. Does anyone know if it's possible to get it to work with my current setup or have suggestions for an alternative method?

My setup : alacritty, neovim, vimtex, skim

Thank you all in advance!

https://castel.dev
https://pbb.wtf/posts/VSCode-LaTeX-Inkscape/ (for Harpoon and Karabiner-Elements)

0 Comments
2024/05/13
22:56 UTC

26

Fuck pfgplots

Just fuck it I hate it, to sum up the past 3 hours or so I have been writting the same fucking thing over and over and over again, and just nothing.

This is the damn code

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}

\begin{axis} 
\addplot{x^2}
\end{axis}
\end{tikzpicture}

\end{document}

For context I am using two different editors, one of them is texstudio it is not working correctly because it has a problem with ^ symbol for some fucking reason, it says that I have to write in math mode, but addplot{function} is not implied in math mode as far as I know.

The other thing is it is compiling and giving an error at the same time, but when you write something that does not include ^ it compile without error, but once you try to go back to the function that has ^ it does not go back, also it does not plot the function right, espically if the bounds (end points) are not defined.

The other fuck is overleaf, that one does various things.

If the code is not in an axis block it produce the number 2 where the figure is supposed to be, if it is in the axis block it does not compile.

But the werid thing is that if you copy paste a code from another source it works.

Last info might give the impression that it might be some syntax error but I can assure you it is not.

21 Comments
2024/05/13
16:54 UTC

5

VimTeX compilation issues with nvim

Problem solved sorta: Check my comment below for more info if you are curious.

One of the reasons I switched to nvim was because of the extended amount of time it takes to compile on overleaf, but now using nvim I am having trouble with the time it takes to compile. I have followed this tutorial for installing nvim for vimtex https://www.youtube.com/watch?v=ELdTohuzTnA (https://github.com/benbrastmckie/.config)for reference.

Basically, I write the file <leader> w and the file attempts to compile but I get message that says VimTeX: Compiler stopped. Then I try building it <leader> b and I get a message that says VimTeX: Compiler started in continuous mode which then turns into VimTeX: Compilation failed! after a few seconds. Then I have to build it again which yields Compiler stopped and finally I build it once more and I get the message that VimTeX: Compiler completed and I see my file updated on my PDF viewer.

I have ran the :messages command after every compilation attempt and it doesn't tell me that I have any errors in my file and additionally this happens with every latex file that I have no matter what. I uploaded screenshots of my nvim/init.lua, .config/nvim/init.lua, and nvim/lua/neotex/core/init.lua files in that order. And there are also some pictures of the messages I get after compiling.

I simply don't know what else to look at or do. ChatGPT didn't even have any useful suggestions either lol.

TLDR: New to VimTeX. In order to update my pdf with document changes, I have to compile 4 times. Don't know what the problem is. Thanks for any

https://preview.redd.it/bw1i7ns7280d1.png?width=2294&format=png&auto=webp&s=937ceca1500471fd73afe6fb702fa3bfb836c4cd

https://preview.redd.it/v9ophns7280d1.png?width=2020&format=png&auto=webp&s=a9a2174bbe82b4d5ae45671884d8eb3b244ebfb5

https://preview.redd.it/752zwos7280d1.png?width=2294&format=png&auto=webp&s=e14b11af3f38ff9a7ed0a5b76d9416967b721544

https://preview.redd.it/0uqp080b280d1.png?width=1606&format=png&auto=webp&s=4b1222e4b6dd2a3934644b16ddd2bc57459301a8

https://preview.redd.it/3jwfce5f280d1.png?width=1060&format=png&auto=webp&s=58d59857b514b9aba9d9d667d225472ea66eea73

https://preview.redd.it/z18x7jvf280d1.png?width=562&format=png&auto=webp&s=ca8db54f32a8ad2f4dce70c0a8487c5c471b1728

https://preview.redd.it/bficrski280d1.png?width=1068&format=png&auto=webp&s=58b291c04055e9e9bee3d0f6510219a35abce376

https://preview.redd.it/2p4kl42j280d1.png?width=612&format=png&auto=webp&s=4a953b936daa9751b1f65f5ba064d40851e4f315

12 Comments
2024/05/13
16:41 UTC

222

After questionable amounts of time and ungodly doses of caffeine i have done it. I rewrote my latex to svg renderer, in python, with a mathjax backend. I can die in peace.

32 Comments
2024/05/13
10:54 UTC

0

Bug when pagenumbering

I'm using the command \pagenumbering{Roman} right after \begin{document}

I get a very weird bug that the roman number VIII looks with an ugly square next to it IN THE INDEX ONLY.

in the page itself, the VIII looks fine, but when It's written in the index, its ugly.

This is the way I'm enumerating the first roman pages in the index:

\addcontentsline{toc}{section}{Lista de ejercicios}

\input{Preliminar/Ejercicios}

\newpage

I write this same thing in the other ones and they look fine, it's just the number eight VIII

https://preview.redd.it/6qpmztvo940d1.png?width=1405&format=png&auto=webp&s=6c6ba7000ff2f3488dcf17547b49a9b2fb3d9092

EDIT, SOLVED: u/LupinoArts suggested a code before \begin{document}

\makeatletter
\renewcommand{\@pnumwidth}{3em}% default is 1.55em
\makeatother

"This is not a bug, but intended to be a visual aid to locate overfull hboxes: In standard LaTeX, this value is the space reserved for the page number in the table of contents and list of figures/tables. The page number is printed inside a hbox of that width and the black rectangles indicate that the content of that box is larger than the box allows. Depending on what packages and document class you use, the actual macro you need to adjust may be another one, but for that we would need a more complete code example."

6 Comments
2024/05/13
03:54 UTC

7

Why does my flowdiagram look like this :((

I have a project that is about integrals. So I wanted to make a flow diagram of the different methods they can be applied. Well, every time I add some text in it. It turns into a whole mess. Can someone pls tell me how I can keep the text within the box without the box getting wider and moving to a different place.

This is what it looks like rn

This is what I want it to look like

5 Comments
2024/05/12
20:28 UTC

1

Efficiently Managing Spacing Between Paragraphs and Images in LaTeX Reports

Hello, I'm trying to create a report using LaTeX, but I'm unsure if it's a good idea to write a paragraph in just one line, resulting in a very long line with all my paragraph text. what is the best practice about this ?

Additionally, how do you efficiently manage spacing between paragraphs and images, as well as between paragraphs themselves? I currently use \setlength{\parskip}{0cm} and \setlength{\parskip}{0.635cm} respectively, but I find myself constantly copying and pasting this code. I haven't found a better solution. How do you handle this?

1 Comment
2024/05/12
17:11 UTC

4

how solve Overfull \hbox warning

I write simply this on my document:

\begin{itemize}

\item couplage triangle : V=220V, f=50Hz, n=1430$\text{tr}\cdot\text{min}^{-1}$, $\text{P}_u$=1.5kW, cos($\phi$)=0.82\degres, I=6.1A

\item couplage étoile : V=380V, f=50Hz, n=1430$\text{tr}\cdot\text{min}^{-1}$, $\text{P}_u$=1.5kW, cos($\phi$)=0.82\degres, I=3.5A

\end{itemize}

but I have a warning about "Overfull \hbox (13.49037pt too wide) in paragraph at lines 32--33"

I try to use \justify with the package "\usepackage{ragged2e}" but nothing I want to stay with my margin so I don't change my margin with \newgeometry

4 Comments
2024/05/12
13:49 UTC

5

Is it possible to disable inline math highlighting in TexStudio?

I'm hoping someone might know if and how this might be possible. I use TexStudio but the approach would probably be the same if someone can do it in TeXmaker.

Basically, I never use inline math mode and likely never will, but use $ signs frequently. I generally escape them with \ but I'd really like to just disable this functionality entirely if I can.

I have a hazy memory of once maybe changing the $ to some other symbol I was less likely to use to indicate going into inline math mode, but I couldn't find anything that looked relevant in the settings or in my search results.

6 Comments
2024/05/12
13:15 UTC

3

Changing 'et al.' to 'i inn.' with agsm

Hello,

I am looking for a way to change citation 'et al.' to 'i inn.' ('and others' in polish language.)

i am using following setup for my bibliography in Overleaf:
\usepackage[polish]{babel}
\usepackage{natbib}
\bibliographystyle{agsm}

When citing (with citep{}) multiple authors i receive e.g. (Young et al., 2008).

I would like to receive (Young i inn., 2008), so simply change it from latin to polish.

I had similar issue with 2 authors where i wanted to change "and" to "i", i worked it out with commands below, however i can't find similar way for 'et al.'

\setcitestyle{citesep={i}, aysep={,}}
\newcommand*{\harvardand}{i}

Here are example authors for my citation which ends up with 'et al.'

author={Young, S.M. and Gong, J.J. and Van der Stede, W.A. and Sandino, T. and Du, F.}

Do you know anyway how to change it in agsm?

2 Comments
2024/05/12
12:55 UTC

5

To draw a pair of squares with tikz package.

Hello!

I have the following code to draw a scheme:

\begin{center}
\begin{tikzpicture}[node distance=2cm,>=Stealth,font=\sffamily]

% Nodes (Events)
\node[circle, draw] (1) {1};
\node[circle, draw, above right=of 1] (2) {2};
\node[circle, draw, right=of 2] (4) {4};
\node[circle, draw, below right=of 1] (3) {3};
\node[circle, draw, right=of 3] (5) {5};
\node[circle, draw, right=of 5] (6) {6};

% Edges (Activities)
\draw[->] (1) -- node[above] {D(4)} (2);
\draw[->] (1) -- node[right] {A(5)} (3);
\draw[->] (2) -- node[above] {E(4)} (4);
\draw[->] (3) -- node[above] {B(5)} (5);
\draw[dashed,->] (4) -- node[above] {} (5);
\draw[->] (5) -- node[above] {C(2)} (6);

\end{tikzpicture}
\end{center}

But I need to draw these pairs of squares above the circles, highlighted in the image. What should I do?

https://preview.redd.it/17q33n8ypzzc1.png?width=772&format=png&auto=webp&s=8ce6f2e59c6566fee509f340f77fb49ad6852921

Thanks!

10 Comments
2024/05/12
12:37 UTC

8

Looking for word-processor for academic writing with LaTeX export (and Zotero support)

Hi all, the title says it: I'm looking for a word-processor to do my long-form writing. I hope this is not seen as an offence here; I'm very much into LaTeX and used it many times to directly write my articles. But I noticed that the markup distracts my thinking, so I just wish for an app that allows me to separate the steps: 1) Writing down my ideas with less formatting and more focus on contents, 2) typesetting it in LaTeX.

Ideally, the app should:

  • Export to LaTeX
  • Support Zotero citations
  • Have document history
  • Use very basic markup, ideally markdown - no options to change fonts etc.

Ideally the word-processor uses markdown, which allows me everything I need (headings, lists etc.). Document history is very important for me - Overleaf offers this in a nice way, but that's LaTeX again. And I'm aware that I could set this up using git or another system myself, but I'm rather looking for a ready-made product. I'm willing to pay for that, of course.

Any ideas? I'm also open for suggestions regarding workflows to achieve this in e.g. Obsidian, although, as written above, I don't want to spend too much time into setups, and I also work on different computers, so synchronization (of my work plus the setup) is important.

Thanks! Sebastian

23 Comments
2024/05/12
11:47 UTC

11

Help with citation multiple defined? (Overleaf)

Hello, i make this post because i dont know what i'm doing wrong. I am writing an article on Overleaf and im using a .bib file for my references. When i recompile, this warning appears:

https://preview.redd.it/6blri00pwwzc1.png?width=592&format=png&auto=webp&s=5e0fd9e6ef063cc63be1a2d4907920a8a7f6422d

When the only time i use \cite{Orion96} is at the main .tex file. I have a lot of references, meaning a lot of warnings.

Thanks, and sorry for bad english.

EDIT: I found the solution that worked for my problem. I dont know why it works, but it works. Here i share the link of the solution (before i tried to post on Tex Exchange or post another example)

I should have specified that the article that i am writing is an A\&A article and the problem was in the aa.cls file.

Anyways, thank you for all of your answers :)

20 Comments
2024/05/12
03:13 UTC

8

I just posted a template I use for homework, any feedback?

Here is the repo for it.

https://github.com/ekiim/tma-template

It uses latexmk.

What do you think of my use of the cls file? It's my first "template" after a looooong time using latex naively.

1 Comment
2024/05/12
00:01 UTC

2

AUCTeX on a chromebook?

has anyone tried to do that and had success with it

it's running debian gnu/linux 12 (bookworm)

5 Comments
2024/05/11
19:05 UTC

11

Title

Does anyone know how to get title and author name flushed left like this?

I have tried adding \flushleft command within the title and author brackets, however, it only works for the title. And I still get error messages, so I suspect there is a better way.

Any help appreciated!

4 Comments
2024/05/11
14:30 UTC

6

Latex Diagram

Hello everybody im new here and i didn't find a way to make this diagram with latex

need some help !

https://preview.redd.it/4dgz206rkszc1.png?width=646&format=png&auto=webp&s=8dbb7f1fcace791c696f6421d39b43e389419676

6 Comments
2024/05/11
12:35 UTC

0

Arabic Babel: Package inputenc Error: Keyboard character used is undefined

When using lot of languages with Babel, it just compiles fine, but with Arabic it gives that error all along the file on commands that were working in other languages

afaik Babel's arabic.ldf seems to try to use inputenc cp1256. And I don't understand at all. With PDF it won't work because Arabic needs UTF-8 and arabic.ldf already invoke inputenc cp1256, so impossible to change and Arabic don't work with it. And with LuA/Xe, it use uselessly inputenc where it's not needed with those, occuring an error

0 Comments
2024/05/10
18:48 UTC

8

Cross posting: apt install texlive-full leaves broken environment

0 Comments
2024/05/10
14:10 UTC

1

Different Math Fonts?

Hey there,

I was just wondering if there are other 'math font' types? Things other than amsmath and amssymb.

Thanks :)

3 Comments
2024/05/10
12:59 UTC

Back To Top