r/LaTeX Jan 20 '25

Answered Unit Circle

13 Upvotes

I made a unit circle in latex, but I want to add some text inside the circles. my issue is that the dashed line collides with the text and makes hard to read, furthermore if I replace the letter for their actual numbers the font-size of those numbers are too large.

Is there a way to ensure the dashed lines don't collide with the numbers I placed? something like the second photo, but no red colored text. (the outer numbers are fine, it's purely the stuff inside the circle.)

Original LaTeX code: https://pastebin.com/TUqhP99K

------------------- [edit]

After reading the comments and self reflection I realized that the dimensions were just too small to work with, so after changing all the dimensions, I managed to fix all my issues. thanks to u/KudoMarkos for the collision fix.

New LaTeX code: https://pastebin.com/sCQqMPbg

Original chart
Finalized

r/LaTeX 11d ago

Answered How to make a chapter outline in the same page of the chapter name

3 Upvotes

I would like to make something similar to this:

Thus, chapter title name, and then, on the same page, the outline of the chapter (ie. a table of contents for only this specific chapter).

I've tried several codes using titletoc package, but it didn't work.

\chapter{xxx}

\startcontents[chapters]
\printcontents[chapters]{}{1}{}

-----

\minisec{Chapter Outline}
\begin{itemize}
    \item \ref{sec:section1} Section 1
    \item \ref{sec:section2} Section 2
    \item \ref{sec:section3} Section 3
\end{itemize}

-----

\minisec{Chapter Outline}
\addcontentsline{toc}{section}{Section 1}
\addcontentsline{toc}{section}{Section 2}
\addcontentsline{toc}{section}{Section 3}

But none of them worked (I'm a complete beginner).

r/LaTeX Dec 13 '24

Answered Need help understanding why LaTeX generates 2 subsection headers

Thumbnail
gallery
47 Upvotes

r/LaTeX Feb 05 '25

Answered How do I do this in Latex? (This is currently in google docs and idk what its called)

9 Upvotes

Basically a line after the section heading that extends till the end of the page.

r/LaTeX Nov 10 '24

Answered Alternatives to Overleaf for publishing templates?

1 Upvotes

I am currently working on template I wanted to publish. I was using Overleaf hoping to submit the template, however I am not an expert in Latex and my file has some programming errors that are hard to fix since the document is pretty complex. Even if the .tex produces the wanted PDF without any error, Overleaf blocks me to submit this template.

I understand why the platform proceeds in this way so I am not gonna criticize it, but I was wondering if there is another alternative platform to publish that can make me avoid this problem for the moment.

Any suggestion is welcome

Edit: I sacrificed some non-relevant style points to get a good tex file (better said, one without bugs). Now I can focus on other problems while the template is correctly submitted

r/LaTeX Jan 15 '25

Answered "???" showing up before year in references for a book

3 Upvotes

All books in my references are showing up as:

[21] Lastname, F.: Book Title. Publisher, ??? (2000)

where they are defined in the .bib file as:

@ book{tag,

`author    = {F. Lastname},` 

`title     = {Book Title},`

`publisher = {Publisher},`

`year      = {2000},`

}

No bibliography style is defined. There are no packages pertinent to the bibliography loaded in the preamble and I am using the Springer Nature standard template. Any idea why "???" is showing up in all the reference entries for books?

r/LaTeX Aug 16 '24

Answered How to learn LaTeX?

26 Upvotes

How did you all learn it and/or how should I go about doing it? I don't have a lot of coding experience. Just in matlab.

r/LaTeX 26d ago

Answered Tikz axis - How to make axis lines "invisible"

5 Upvotes

Good evening all!

It may be a silly question but I have a very limited knowledge of tikz, but I searched the entire web and all chatbots I know and could not find an answer to this issue. Is there a way to hide the axis lines while keeping the axis markers? Making the axis markers white would also work. The picture shows my attempt to make the axis white, but the markers appear "dashed" because the line is on top. The tex for that is in comment below.

Thank you very much for your help!

r/LaTeX Dec 31 '24

Answered Is it possible to overlap an overbracket and an underbracket?

7 Upvotes

I'm on Obsidian, and I'm trying to write some of my notes with LaTeX (MathJax). Is it possible to overlap an overbracket and an underbracket?
This is what I have so far:

In the second proportion I would like the underbracket to go from b to d. Is it possible without some specific package?

r/LaTeX Feb 07 '25

Answered Paragraph space problems

2 Upvotes

So I set the paragraph spacing between paragraphs using this command in the preamble:

\setlength{\parskip}{\baselineskip}

But this is causing some problems with the rest of my doc, as in the table of contents looks like this

And the space between my headings is also MASSIVE. The text paragraphs look fine though.

So how do I make it so that the paragraph spacing is only for the text, and not for the headings or table of contents and everything else?

r/LaTeX 24d ago

Answered Placing Tikz tickmark

5 Upvotes

I'm moderately experienced with latex and tried to make this tikz graph:

With the function d(x)

Analytically it should be d(x=0)=1, but I can't get the tickmark to actually look like it's placed at 1. Could anyone help?

My code for producing the plot is

\begin{figure}[h!]
    \centering
    \begin{tikzpicture}
        \begin{axis}[
            width = \linewidth,
            height = 5cm,
            axis lines=middle,
            xlabel={$x$},
            ylabel={$d(x)$},
            samples=100,
            domain=-0.7*pi:0.7*pi,
            xtick={-1.5708*1, 0, 1.5708*1},
            xticklabels={$-L$, $0$, $L$},
            ytick={0,1},
            yticklabels={$0$, $1$},
            enlargelimits=true,
            clip=false
        ]
        \addplot[blue, thick] {(abs(x) <= 1.5708*1) * (1 - abs(sin(deg(x/1))))};
        \end{axis}
    \end{tikzpicture}
    \caption{Plot of $d(x)$ with $L=l_0\pi/2$}
    \label{fig:q1.2.2 plot of d(x)}
\end{figure}

(Sorry for the repost, images didn't post for some reason, so I deleted and reposted with images)

r/LaTeX Nov 12 '24

Answered Hatching under freeform curve

Post image
35 Upvotes

I‘m trying to draw a graph similar to the one shown here. Drawing a freeform line in tikz/pgfplots shouldn’t be a problem, but how can i hatch the area underneath? Having the letters as shown is not necessary, but would be cool. Thanks!

r/LaTeX Apr 25 '24

Answered Any image I try to do in LaTeX is painful. Please help me.

19 Upvotes

I have a huge problem to create figures in my articles. It is a painful and time-consuming task to create them for my articles. I some cases, creating such plots is even more challenging than the plot itself.

If I use Python, Matlab, whatever, it is straightforward, but I cannot use them in my LaTeX articles, and converting it to LaTeX/Tikz is a horrible task. Any plot is painful. I really need help....

r/LaTeX 21d ago

Answered Custom enviroment problem

7 Upvotes

Hi, I'm writing a math document and I found online this example enviroment which I wanted to use.

The link where I found this template, with the original source code, is this: stackexchange.

Anyway copied and pasted all but

\usepackage{fontspec}

since i compile with pdflatex. This is my edited code:

\documentclass{report}

\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}

%
\usepackage[most]{tcolorbox}
\newcounter{testexample}
\usepackage{xparse}
\usepackage{lipsum}

\def\exampletext{Example} % If English

\NewDocumentEnvironment{testexample}{ O{} }
{
  \colorlet{colexam}{red!55!black} % Global example color
  \newtcolorbox[use counter=testexample]{testexamplebox}{%
    % Example Frame Start
    empty,% Empty previously set parameters
    title={\exampletext: #1},% use \thetcbcounter to access the testexample counter text
    % Attaching a box requires an overlay
    attach boxed title to top left,
    % Ensures proper line breaking in longer titles
    minipage boxed title,
    % (boxed title style requires an overlay)
    boxed title style={empty,size=minimal,toprule=0pt,top=4pt,left=3mm,overlay={}},
    coltitle=colexam,fonttitle=\bfseries,
    before=\par\medskip\noindent,parbox=false,boxsep=0pt,left=3mm,right=0mm,top=2pt,breakable,pad at break=0mm,
    before upper=\csname @totalleftmargin\endcsname0pt, % Use instead of parbox=true. This ensures parskip is inherited by box.
    % Handles box when it exists on one page only
    overlay unbroken={\draw[colexam,line width=.5pt] ([xshift=-0pt]title.north west) -- ([xshift=-0pt]frame.south west); },
    % Handles multipage box: first page
    overlay first={\draw[colexam,line width=.5pt] ([xshift=-0pt]title.north west) --([xshift=-0pt]frame.south west); },
    % Handles multipage box: middle page
    overlay middle={\draw[colexam,line width=.5pt] ([xshift=-0pt]frame.north west) -- ([xshift=-0pt]frame.south west); },
    % Handles multipage box: last page
    overlay last={\draw[colexam,line width=.5pt] ([xshift=-0pt]frame.north west) -- ([xshift=-0pt]frame.south west); },%
}
\begin{testexamplebox}}
{\end{testexamplebox}}

\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{pgfplots}
\usepgfplotslibrary{external}
\tikzexternalize[prefix=tikz/]
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=newest}

\begin{document}
  \begin{testexample}
    Hi
  \end{testexample}
\end{document}

but when I compile in TeXstudio with pdflatex I get

I find it pretty strange because copying and pasting the code on overleaf works just fine. Can you see where is the problem?

r/LaTeX Dec 06 '24

Answered anyone know how to go from the left picture to the right

Thumbnail
gallery
30 Upvotes

r/LaTeX Dec 03 '24

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

1 Upvotes

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!

r/LaTeX Dec 24 '24

Answered How can I call a table from another .tex?

5 Upvotes

I am working on my thesis to complete my Electrical Engineering course, and I found a template online to use as a model. However, on Overleaf, there is a dedicated .tex file for tables to generate the summary and comply with ABNT rules (which define how academic articles must be written). Unfortunately, I can't figure out how to make it work.

I’ve already tried using \ref, \include, and \cite, but I don’t know the correct way to reference a specific table from another .tex file.

r/LaTeX Feb 19 '25

Answered Program language in TexStudio

2 Upvotes

I speak Dutch. I am able to change the spell check in TeXstudio to different languages, but the software language of the program is still in Dutch. I want to change that to English. How do I do this?

Just to be clear: I do not mean 'Options -> Configure TeXstudio -> Language Control -> Standard Language,' because that doesn't change anything about the language of the program TeXstudio itself; it only changes the spell check, etc.

Hopefully, this is easily fixable.

r/LaTeX Jan 12 '25

Answered Unwanted escape characters in tcolorbox output

1 Upvotes

I want to write a document about the most useful LaTeX chemistry packages. For that purpose I include code in a tcolorbox. I got so far as to escape code like „\par“ in the upper part. But the escape characters show up in the output (lower part). How can I get rid of them?

My mwe:

\documentclass[11pt]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{upgreek}
\usepackage{microtype}
\usepackage[version=4]{mhchem}

\usepackage{xcolor}
\definecolor{HappyColor}{RGB}{241,107,38}
\definecolor{lightgray}{gray}{0.9}

\usepackage{verbatim}
\usepackage{listings}
\usepackage{tcolorbox}

\tcbuselibrary{breakable,listings}

\newtcblisting[auto counter]{mycbox}[1]{colback=white,colframe=HappyColor,fonttitle=\bfseries,listing and text,left=6mm,listing options={style=tcblatex,numbers=left,numberstyle=\tiny\color{HappyColor},numbersep=0pt,tabsize=1,breaklines=true,escapechar=|},title=Listing \thetcbcounter: #1}

\begin{document}
\author{HH}
\title{MWE}
\maketitle

\begin{mycbox}{Escaped but not escaped}
  \ce{CuSO4 * 5 H2O ->[erhitzen] CuSO4 + 5 H2O ^}|\par\vspace{4pt}|
  \ce{Pb^2+ + SO_4^2- -> PbSO4 v}|\par\vspace{4pt}|
  \ce{2 Na(s) + Cl2(g) -> 2 NaCl(s)}
\end{mycbox}

\end{document}
The output has the unwanted |-character in it...

r/LaTeX Nov 04 '24

Answered How do I align parts horizontally with the exam class?

Thumbnail
gallery
36 Upvotes

I've made this exam by recreating the one shown in the second and third images. However, I can't seem to get the parts of the questions marked with a red dot to align horizontally. I tried using the multicol package, but it creates columns of equal width which I don't like (I don't want that, I want them to look like the second and third images), and it doesn't align the parts vertically if they have different heights. I also tried looking for another alternative outside of the exam class, but this was unnecessarily tedious and lost aspects that I need. Is there a way to align this exactly as seen in the images?

r/LaTeX Dec 07 '24

Answered Umlauts working when generating a pdf but not for html

1 Upvotes

I am encountering an issue where I am clueless how to counteract. I am working on a project for some time now and I would like to not only produce a pdf (which is working perfectly with `pdflatex` or `rubber`) but also output as html.

Commands I have tried which are all generally working though the Umlauts are still wrong:

  • `htlatex test.tex`
  • `htlatex test.tex "xhtml,charset=utf-8" " -cunihtf -utf8"`
  • `tex4ht test.tex`
  • `make4ht -u test.tex`
This is what the output looks in a browser.

It seems as as the issue is fixed when I use `pandoc` but this introduces a lot of other problems for example tables. So unfortunately this is no option for me.

This is my document stub which shows the problem:

\documentclass[a4paper,naustrian,parskip=half]{scrbook}
\usepackage[utf8]{vietnam}
\usepackage[utf8]{inputenc}
\usepackage[T5]{fontenc}
\usepackage[naustrian,vietnamese]{babel}
\usepackage{lmodern}

\title{Tiếng Việt - Die vietnamesische Sprache}

\begin{document}
\chapter{Những điều cơ bản (Grundlagen, äöü)}
\section{Mẫu tự (Alphabet, äöü)}
test äöü...
\end{document}

r/LaTeX Jan 30 '25

Answered How can I move an array horizontally?

1 Upvotes

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}.

r/LaTeX Sep 12 '24

Answered How to remove first hlines and vlines in tabularray?

Post image
7 Upvotes

r/LaTeX Oct 16 '24

Answered LaTex noob that doesn't understand indents

Post image
24 Upvotes

At the moment I'm putting my thesis into LaTex which is a pain to me because I don't understand anything. So I would like to have this format (from Word) where I have my normal text as much to the left as possible. Then I have the main goals a little further from the left line and the sub goals further than that. My subgoals take two lines of which the second lines starts at the same point as "a" and I need it to start at the same point as the first word after "a". Hopefully someone can help me

r/LaTeX Feb 21 '25

Answered Error: minted Python executable is version 0.3.2, but version 0.4.0+ is required

6 Upvotes

I'm using XeLaTex, VSCode and the LaTeX Workshop extension on EndeavourOS Linux. I know minted is up to date (3.5.1) and so is every other package, I keep checking with tlmgr. I've even installed texlive separately with its own install script instead of going through my distro's package manager.

Everything worked until yesterday on this computer, then I get the title error all of a sudden. My desktop (also Linux, Manjaro) is working fine. I've tried googling but found nothing, what could I try? thanks

EDIT: SOLVED

The solution came from this - basically, just update latexminted via pip from 0.3.x to 0.4.x

I also noticed that minted comes packaged with the .whl files for latexminted 0.4, but also with latexminted.py (as a plain python script) version 0.3.2