New answers tagged

4

With the package nicematrix. \documentclass{article} \usepackage{nicematrix} \usepackage{xcolor} \begin{document} \renewcommand\arraystretch{1.8} $\begin{NiceMatrix}% [ hvlines, columns-width=auto, first-row, code-for-first-row = \color{red}, first-col, code-for-first-col = \color{red} ] & x & +6 \\ x & x^2 & 6x \\ ...


5

Like this? You have many possibilities, one of them is use \multicolumn command which hasn't border lines: \documentclass{article} \usepackage[table]{xcolor} \newcommand\mcc[1]{\multicolumn{1}{c}{#1}} % <--- \setlength{\parskip}{\baselineskip} \title{FACTORbox} \author{Algebra Teacher Who Struggles with LaTeX Tables} \date{January 2021} \begin{...


0

Whenever I want to prevent a figure to be plotted beyond a certain part of the document, I use \FloatBarrier from the placeins package. In your case, I would insert the float barrier just after the diagram, like so: \documentclass{article} \usepackage{rotating} \usepackage[nonumberlist]{glossaries} \usepackage{placeins} \setglossarystyle{altlist} \...


2

Before we start, a few words of warning It is implied by the linked answer, but just to make it explicit for other users: apalike is simply not intended to be used with numeric citations. This can be seen from the fact that the style does not compute the longest citation label and does not pass the longest label on to the thebibliography environment. A .bbl ...


0

A solution with XeTeX or LuaLaTeX: \documentclass{article} \usepackage{fontspec} \usepackage{unicode-math} \usepackage{xcolor} \usepackage{lipsum} %text fonts \setmainfont{STIX Two Text} \setsansfont{GFS Neohellenic} %math fonts \setmathfont{STIX Two Math} \setmathfont{GFS Neohellenic Math}[version=sansmath] \newcounter{myenv} \newenvironment{myenv}[1][]% ...


0

Here is an example you can customize. I have defined two environemnts. The first one is similar to yours; the second one is a list environment, which is probably more suited to your needs. The style of the paragraph is defined in the \myenvstyle macro: \newcommand{\myenvstyle}{% \fontfamily{Cochineal-LF}\selectfont\color{mycolor}\Large} while the color is ...


0

You are making a couple of errors there. Mainly you are confusing macros which take argument(s) (like \textcolor and \textbf), and macros which don't (in this case the switches \color and \bfseries). \textcolor expects two arguments (well, it's a wee bit more complicated than that but let us skirt this issue): the colour and the text to be set in that colour,...


0

\setlength{\calwidth}{6in} for instance, works for me


1

Here is a suggestion based on the code linked in the question: \documentclass %[parskip=half] {scrreprt} \usepackage{lipsum}% only for dummy text \usepackage{xcolor} \usepackage{graphicx} \usepackage{etoolbox} \colorlet{feline}{darkgray}% change the color of chapter numbers here \makeatletter \newsavebox{\feline@chapter} \newcommand\feline@chapter@...


1

Improved answer \documentclass[chapterprefix=off]{scrreprt} \usepackage{lipsum} \usepackage{anyfontsize} \newcommand{\HUGE}{\fontsize{40}{44pt}\selectfont} \renewcommand{\chapterlinesformat}[3] {\mbox{#3}\hfill\HUGE{\mbox{\thechapter}}\\[10pt] \hrulefill } \begin{document} \chapter{First} \lipsum \end{document} Below is the original answer that ...


1

The way you've set up the macro \summ, taking 1 optional and 2 required arguments, you probably shouldn't write \summ{1}{2}{3}; instead, do give \summ[i]{1}{2} a try. You'll find out that it expands to \sum\limits_{i=1}^{2}. I think that defining \summ to take an optional argument is unnecessarily complicated. How about dropping the conditional and simply ...


0

Here is a way to display 2011/3: \begin{align*} &\text{ }\text{ }\text{ }670\\ 3 &\overline{\big)2011}\\ &\underline{\text{ }18}\\ &\text{ }\text{ }\text{ }21\\ &\text{ }\text{ }\underline{\text{ }21}\\ &\text{ }\text{ }\text{ }\text{ }\text{ }\text{ }1 \end{align*} Tweak the spacing on different long divisions. As barbara beeton ...


0

Different approach, enough to be logically separate. How about: Making the bibliography a \cventry, moving it up a bit with a suitable negative \vspace and moving its heading into the CV and redefining its own heading as {}? MWE \documentclass[11pt]{moderncv} \moderncvstyle{classic} \moderncvcolor{red} %%%% adjust the page margins \usepackage[scale=0.78, ...


0

Total hack. Taking one of the bibliography environment code examples in the manual (p106), and adding 73pt to the left margin produced this: This implies that there must be a proper solution. MWE \documentclass[11pt]{moderncv} \moderncvstyle{classic} \moderncvcolor{red} %%%% adjust the page margins \usepackage[scale=0.78, top=0.5in, bottom=0.5in, footskip=...


2

You question 1 should be solved by the following macro \diamondscheme. The lines are drawn too, you need not tikz. The size is controlled by the \diaw parameter. It is set to 1.5cm in this example. % definition \newdimen\diaw \diaw=1.5cm \def\diamondscheme#1#2#3#4{% \vbox to\diaw{ \kern-1ex \hbox to\diaw{\hss$#1$\hss} \vss \...


0

You can define different page styles for odd and even pages with fancyhdr. \documentclass[latin,english]{book} \usepackage{babel} \usepackage{Libertinus} \usepackage{fancyhdr} \usepackage{microtype} \pagestyle{fancy} \fancyhead[L]{\textsc{Cicero}} \fancyhead[RE]{\textit{On the Ends of Good and Evil Things}} \fancyhead[RO]{\textit{\foreignlanguage{latin}{De ...


2

This (added to the preamble) ought to do it \makeatletter \defbibheading{subbibliography}[\refname]{% \section*{#1}% \if@twoside\markright{\abx@MakeMarkcase{#1}}\fi \ifmemoirbibintoc {\phantomsection \addcontentsline{toc}{section}{\numberline{}#1}} {}} \makeatother found in biblatex.def. I added the \numberline{} part. Though, personally I ...


1

To reproduce showed image, try the following: \documentclass{article} \usepackage{xcolor} % <--- %\title{\LaTeX} \begin{document} \[ \colorbox{black}{\color{white}\textit{\LaTeX}} % <--- \] \end{document}


1

As you load titlesec, I would use \titleps via the [pagestyles] option, which has a \sectiontitle command. Here is a code for a two-sided layout: \documentclass[a4paper, twoside, 12pt, fleqn]{article} \usepackage{lastpage} \usepackage[pagestyles]{titlesec} % \titleformat{\section}[display]{\centering\Large\bfseries}{}{0pt}{\underline} \usepackage{lipsum} \...


0

To get the right headers you have to use the correct marks. In your case \leftmark should respond to your need: \documentclass[a4paper, 12pt, fleqn]{article} \usepackage{fancyhdr} \usepackage{titlesec} \usepackage{lastpage} \usepackage{lipsum} \titleformat{\section}[display] {\centering\Large\bfseries} {Unit \thesection} {0pt} {} \pagestyle{fancy} ...


0

You wrote, all figures must appear after the page they are first mentioned, and separate of any text. If multiple figures are mentioned on the page they can follow on separate pages. ... I can't perform a \clearpage because I can not have a page that is mostly empty, the pages must remain full. The afterpage package may be your friend. \documentclass{...


5

\begin{figure}[p!] should work, but you will then have to redefine \floatpagefraction so that small figures can be on a float page of their own (it defines the minimum part of the page that need to be occupied by floats to be allowed to form a float page.) \documentclass{article} \usepackage{lipsum} \renewcommand\floatpagefraction{0} %default 0.5 \begin{...


1

This example does what you ask, but you would have to put it into context in order to say it is a general solution. \documentclass{article} \usepackage{lipsum} \usepackage{afterpage} \usepackage{color} \usepackage[demo]{graphicx} %------------------------------------------------ % Inspired by: % https://tex.stackexchange.com/a/334993/231952 \usepackage{...


6

The flafter package (in the base latex distribution) will prevent floats floating "backwards" to the top of the current page. So if you put the figure source at the point of the first reference to the figure then your requirement should be met.


3

The idea is to use \titlespacing instead of planting negative spacings in \titleformat. % Sections formatting \titleformat{\section} {\scshape\raggedright\large} {} {0em} {} [\color{black}\titlerule] \titlespacing*{\section} {0pt} {6pt} {3pt} Adjust the values to suit. I also made several changes to the code in order to avoid all other \...


2

If I understand the question correctly you can use \leaders You could use \dotfill but that uses dots, but it is easy to make a similar command using a dash. \documentclass[english]{book} %------------------------------------------------------------------------------------ % % \usepackage[fleqn]{amsmath} % \usepackage{amsthm,amssymb} % \usepackage{tikz} % ...


6

You're setting the secnumdepth counter to 0. This implies that all sectional units at level 0 or higher (counting downward: -1, -2) will be numbered, while lower-level units (level 1, 2, 3, ...) will remain unnumbered. In most cases (this included), \section is set at level 1, \subsection is set at level 2, etc. So, \setcounter{secnumdepth}{0} removes the ...


2

Something like this? (Observe that I've stuck the four equations in a minipage.) \documentclass{article} \usepackage{amsmath} \begin{document} \begin{enumerate} \item[38.] \addtocounter{equation}{6} \quad$\begin{array}{||c c||} \hline D & I \\ [0.5ex] \hline\hline 2y & e^y\\ \hline 2 & e^y \\ \hline 0 & e^y \\ \hline \end{...


1

You could use \DeclareTOCStyleEntries[...]{tocline}{figure,table} with the same options as for chapter,section,... but without the prefix toc: \DeclareTOCStyleEntries[ raggedpagenumber, linefill=\tocpageseparator, numwidth=3em, pagenumberbox=\tocpagenumberbox ]{tocline}{figure,table} Note that you can use this command for chapter,section,.....


4

Your morecomment setting is saying that comments begin with ! and end with c. Do this instead. morecomment=[l]{!} C is already defined as a comment in the fortran77 style so you shouldn't need to declare it. All of this is untested.


14

You aren’t selecting the Fortran-77 dialect in your listing. According to the language-definition manual, the c and C comments were removed for Fortran-90 and later, since otherwise CONTAINS could start a comment. The listing version of Fortran 77 does not define ! comments, which I believe your compiler is making available as an extension to Fortran-77. ...


0

Another option is to add this functionality to the .bst file. I define one simple function with the surnames of those whom I want to bold, and another function to check if a name is in the surname list. Here is the code. FUNCTION{ boldees }{ "Jones and Smith" } INTEGERS { boldptr np } % determine if a name should be bolded % simply modify the ...


8

You need nothing really special. I'd avoid all those 20pt that are too much. Just to avoid issuing \displaystyle each time, I used dcases from mathtools. The physics package redefines \div (which is not a good thing); instead of loading it just for that, use a simple definition of \Div. In order to simplify input, I defined a \pder command and also a \vect ...


3

Here are a few tips and tricks before my answer While your example is fairly minimal, I would still recommend removing packages that are not necessary for compilation. Examples: physics,babel. I would recommend steering clear of the package physics. It is somewhat infamous as a behemoth. It attempts to do too much, and does none of them particularly well. ...


3

You might find some of the environments in mathtools useful for this. In particular, dcases is like cases, but each line is in display mode, and spreadlines changes the line spacing of aligned environments. I also used aligned, from amsmath, to add more alignment points. I also took the liberty of defining a \vectorsym macro, for readability and so you can ...


3

No need to employ a cases environment. I suggest you employ an alignedat environment instead. \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amsmath} % for 'alignedat' environment \usepackage{amssymb,physics} \begin{document} \begin{equation} \addtolength{\jot}{5pt} \left\{ \begin{alignedat}{2} \...


3

You could do that very simply with floatrow: \documentclass{article} \usepackage{array} \usepackage[demo]{graphicx} \usepackage[export]{adjustbox}% for move images baseline to vertical center of image \usepackage{caption} \usepackage{floatrow} \begin{document} \begin{figure}[!ht] \centering% \setlength{\columnsep}{2em} \begin{floatrow}[2] \...


4

Use the subcaption package. \documentclass[10pt,a4paper]{article} \usepackage[ngerman]{babel} \usepackage{graphicx} \usepackage[left=1.00cm, right=1.00cm, top=1.00cm, bottom=1.00cm]{geometry} \usepackage{subcaption} \begin{document} \begin{figure}[htp] \centering \begin{subfigure}[t]{0.45\textwidth} \centering \...


5

You can use a [t]op-aligned (or anchored) minipage for each image; if the images are both the same size, it will line up the captions as expected: \documentclass{article} \usepackage{amsmath,graphicx} \begin{document} \begin{figure} \mbox{}\hfill \begin{minipage}[t]{0.45\textwidth} \centering \includegraphics[width=\linewidth]{example-image-a}...


1

I solved it. I used subfloats to and an extra caption for it. \begin{figure}[!tbp] \centering \subfloat[\textbf{RMSE-Auswertung}]{\includegraphics[width=0.48\textwidth]{images/RMSE.pdf}\label{fig:RMSE}} \hfill \subfloat[\textbf{Lernrate-Auswertung}]{\includegraphics[width=0.48\textwidth]{images/LR.pdf}\label{fig:LR}} \caption{\textbf{(\ref{fig:...


3

You'll have to change the formatting of the numbers to be circled: \documentclass{article} \usepackage{algorithm,algorithmic} \usepackage{circledsteps}% https://tex.stackexchange.com/q/7032/5764 \newcommand{\circlenum}[3]{\Circled{\small #1{#2}}} \algsetup{linenosize=\circlenum} \begin{document} \begin{algorithm} \caption{An algorithm} \begin{...


1

I don't think there's a difference between alignat{1} and align. Here's how I would do it: \documentclass{article} \usepackage{nccmath, mathtools} \usepackage{amssymb} \usepackage{braket} \begin{document} \begin{subequations} %\label{eq:bell_states} \noindent\centering \begin{minipage}{0.48\textwidth} \begin{...


0

If it's a network folder, you can give the absolute path with \href{run:/serverpath} or \href{run:///serverpath} For example \href{run:///192.198.1.5/data}{Network Folder} If it's a local folder, you can give the absolute path with \href{run://FolderPathOnC:Drive} For example \href{run://Users/Name/Downloads}{My Downloads Folder} Tested with Adobe ...


0

The issue was caused by a missing "%" and was fixed already in the template (see: github.com/andygrunwald/FOM-LaTeX-Template/issues/186) Old version with bug: \renewbibmacro*{cite}{% \iffieldundef{shorthand} {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} {\usebibmacro{cite:label}% \setunit{\printdelim{...


2

Some comments and suggestions: I wouldn't use '1', '2', etc to denote the subsection numbers in the appendix, as that will needlessly invite confusion as the sections in the main body of the document are numbered '1', '2, etc as well. Hence, I'd like to suggest that you keep the default numbering of the subsections in the appendix, viz., 'A.1', 'A.2', etc. ...


0

Do you want something how this? I have used \section*{\appendixname\, Code} with a bit of space \, (or you can put \quad) because the two words are very close to each other that they seem to be united. \documentclass[a4paper,12pt]{article} \usepackage[title,titletoc]{appendix} \begin{document} \begin{appendices} \section*{\appendixname\, Code} \end{...


12

I’m going to give some alternatives, if you don’t mind. You already got a good answer to the question of which e that is. There is a codepoint for “Euler’s constant” defined in Unicode, ℇ (U+2107), which is \Eulerconst in some packages. It’s not widely-used, and the consensus is that most fonts’ glyphs for it are ugly. On the other hand, \mathrm{e} is ...


6

Just be sure to load a Times Roman text and math font and you're all set: \textit{e}, $e$, and $\mathit{e}$ will all generate the desired glyph. If you load the newtxmath math font package, $\mathscr{e}$ may also be of interest. \documentclass{article} \usepackage{newtxtext,newtxmath} % Times Roman clone text and math font packages \begin{document} \textit{...


12

I think this is simply an "e" in a Times clone. Your image seems to have been produced with mathptmx. \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{mathptmx} \begin{document} \[ e \equiv \lim_{n\to\infty} \biggl( 1 + \frac{1}{n} \biggr)^n = 2.7182818284590452353602874713526624977572\hdots \] \end{document} Note however that ...


Top 50 recent answers are included