parent_url
stringlengths 41
46
| parent_score
stringlengths 1
4
| parent_body
stringlengths 25
35.5k
| parent_user
stringlengths 37
42
| parent_title
stringlengths 12
150
| accepted
bool 2
classes | body
stringlengths 4
36.7k
| score
stringlengths 1
4
| user
stringlengths 37
42
| answer_id
stringlengths 1
6
| __index_level_0__
int64 0
322k
|
---|---|---|---|---|---|---|---|---|---|---|
https://tex.stackexchange.com/questions/692422
|
0
|
I have a long table that doesn't extend to the next page. I am using a journal template. I tried using `longtable` but it didn't work. I tried `table`, `tabularx` and `longtable` but it didn't work as it doesn't adjust the width properly. The table stays on one page and half of the table disappears.
Kindly check my code and let me know what is the mistake. Thank you very much in advance.
```
\begin{longtable}{\fulllength}{CCCCCCCC}
%\begin{table}[H]
\begin{adjustwidth}{-\extralength}{0cm}
\newcolumntype{C}{>{\centering\arraybackslash}X}
%\begin{tabularx}{\fulllength}{CCCCCCCC}
\toprule
\textbf{Sensing material} & \textbf{Structure type} & \textbf{Fabrication technique} & \textbf{Temperature (\textdegree C)} & \textbf{VOCs detected} & \textbf{Detection range} & \textbf{Data analysis technique} & \textbf{Ref.}\\
\midrule
SnO\textsubscript{2} and WO\textsubscript{3} & Villi-like nano structure & Electron beam evaporation & 212 & nitrogen oxide, ammonia, ethanol, acetone, toluene, benzene, carbon monoxide, & 899 ppt – 10 ppm & PCA & \cite{RN5229}\\
\midrule
MOS (NiO, CuO, Cr\textsubscript{2}O\textsubscript{3}, SnO\textsubscript{2} and WO\textsubscript{3}) & Nano pattern of multi-array sensing & Lithography & 380 & toluene, nitrogen oxide, ammonia, ethanol, acetone, hexane, propanol & 5 ppm & PCA & \cite{RN5230}\\
\midrule
SnO\textsubscript{2} & Nanowire gradient & Vapor solid method & 326 & isopropyl alcohol, ethanol, carbon monoxide & 2 – 10 ppm & LDA & \cite{RN5133}\\
\midrule
Pd/SnO\textsubscript{2} & Nanowire sensor array & Vapor solid & 150 & isopropyl alcohol & 1 – 50 ppm & LDA & \cite{RN5134}\\
\midrule
TiO\textsubscript{2}, SnO\textsubscript{2}, ITO, WO\textsubscript{3} & Nanorod array & Oblique angle deposition & 250 & hydrogen, carbon monoxide, nitrogen dioxide & 10 – 200 ppm & - & \cite{RN5132}\\
\midrule
Si-SiO\textsubscript{2}, Pd-SiO\textsubscript{2}, Pt-SiO\textsubscript{2}, Ti-SiO\textsubscript{2} & Microwire sensor chip & Flexible flame spray pyrolysis & 400 & formaldehyde, acetone, ethanol, ammonia & 3 ppb & - & \cite{RN483}\\
\midrule
WO\textsubscript{3} & Nanofibers & Electrospinning & 350 & hydrogen sulfide, acetone & 1 – 5 ppm & PCA & \cite{RN5131}\\
\midrule
Cu\textsubscript{2}O & Nanospheres & silanization & 180 & ethanol, ethylacetate, toluene, hexane, tetrahydrofuran & 25 – 200 ppm & PCA & \cite{RN5231}\\
\midrule
Gold & Nano-islands & In-situ iterative seeding and growth & RT & acetone, ethanol, propionaldehyde, acetophenone, benzyl alcohol, benzaldehyde & 1 – 1000 ppm & PCA & \cite{RN5232}\\
\midrule
Pt, Pd-doped SnO\textsubscript{2}/RGO & Nanohybrids & Hydrothermal & 180 & hydrogen, hydrogen sulfide, nitrogen dioxide & 0.04 – 40 ppm & PCA, LDA, Hierarchical Cluster Analysis & \cite{RN5233}\\
\midrule
Thermo-cycled MOS sensors & MOS films & Thermal deposition & 260 - 290 & hexane, butyl acetate & 50 – 175 ppm & - & \cite{RN287}\\
\midrule
Commercial PEN3, CAPINose & TGS sensors & - & RT & ethanol & 10 vol.\% & Average resistance & \cite{RN286}\\
\midrule
SnO\textsubscript{2}, WO\textsubscript{3}, ZnO, In\textsubscript{2}O\textsubscript{3} & Nanofilms & Screen printing & 26 - 426 & formaldehyde, carbon monoxide, nitrogen dioxide, toluene, ammonia & 0.6 – 1000 ppm & - & \cite{RN276}\\
\midrule
ZnTiO\textsubscript{3} & Nanoarrays & Hydrothermal, CVD & 350 & acetone & 1.2 – 12.5 ppm & - & \cite{RN296}\\
\midrule
Au/SnO\textsubscript{2}, Pt/SnO\textsubscript{2}, Ni/SnO\textsubscript{2}, ITO/SnO\textsubscript{2} & Multiplexed nanotube arrays & Spray pyrolysis & RT & hydrogen, benzene, nitrogen dioxide & 50 – 4000 ppm & LVA & \cite{RN5224}\\
\midrule
Warwick OLFaction (WOLF) E-nose & MEMS MOS-based commercial thick and thin film sensors & - & RT & acetone, 1-propanol, iso-propanol, iso-butylene & 2 – 10 ppm & PCA & \cite{RN120}\\
\midrule
Pt, Cu, and Ag decorated TiO\textsubscript{2} and ZnO functionalized GaN & Nanowire & Lithography, CVD, Chemical Etching & RT & nitrogen dioxide, sulfur dioxide, hydrogen, ethanol & 0.1 – 10000 ppm & PCA, SVM, k-NN, Decision Tree & \cite{RN5237}\\
\midrule
Au decorated WO\textsubscript{3}, SnO\textsubscript{2} and NiO & Thin films, nanostructures & electron-beam evaporation & 100 – 300 & acetone, toluene, ammonia, hydrogen sulfide & 10 ppm & PCA & \cite{RN5238}\\
\midrule
Commercial MOS sensors & TGS sensors & - & RT & ethanol, acetone & - & partial least squares discriminant analysis & \cite{RN5239}\\
\midrule
Commercial MOS sensors & TGS Sensors & - & RT & nitrogen dioxide, carbon monoxide & 0 – 50 ppm & PCA, C-means clustering, back propagation neural network & \cite{RN5240}\\
\midrule
Pure and Fe-doped In\textsubscript{2}O\textsubscript{3} & nanofibers & Electrospinning & 250 – 450 & benzene, xylene, toluene, ethanol, formaldehyde & 0.1 – 1000 ppm & PCA & \cite{RN5137}\\
\bottomrule
%\end{tabularx}
\end{adjustwidth}
%\noindent{\footnotesize{* Tables may have a footer.}}
%\end{table}
\end{longtable}
```
|
https://tex.stackexchange.com/users/301650
|
LaTeX table does not extend to the next page
| false |
* Unfortunately you not provide MWE (Minimqal Working Example), a small but complete document. Consequently page layout and used document class are unknown.
* If you refer to use "classic" packages for writing long tables, use of the `xltabular` package is good choose, but also exist newer quite versatile `tabularray` package based on LaTeX3, which offers new features in writing tables (for details see package documentations for details).
* Your table is quite wide, so for nice looks it need wider ˙\textwidth`(which can be defined by`geometry`package or you may consider to write your table in the landscape page orientation. Beside this, for better spacing text in table cells, I would recommend to use`\small` font size.
* For units and quantities I suggest to use ˙siunitx` package.
* To make some column headers narrower, for then I would use abbreviations and their meaning explain in table notes.
* By reducing lines spread in table for about 10% is possible to fit table on two pages.
* So, possible solution for your table can be also the following:
```
\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
%% define some additional hyphenation points:
\hyphenation{electro-spinning di-oxide hydro-thermal mon-oxide micro-wire
nano-arrays nano-fi-bers nano-films nano-hybrids
nano-spheres nano-struc-tures nano-tube nano-wire nano-wires
prop-anol}
\usepackage[version=4]{mhchem} % for '\ce' macro
\usepackage{ragged2e}
\usepackage{tabularray}
\UseTblrLibrary{amsmah, booktabs, siunitx}
\begin{document}
\begingroup
\sisetup{range-units = single, range-phrase = --}
\begin{longtblr}[
entry=none, % <---
label=none, % <---
note{a} = {T: Temperature},
note{b} = {DAT: Data Analysis Techniques},
]{colsep = 3pt,
colspec = {@{} *{3}{X[l]} c X[1.8, l] *{2}{X[l]} l @{}},
cells = {font=\small\linespread{0.9}\selectfont},
row{3-Z}= {rowsep=5pt},
row{1} = {font=\footnotesize\bfseries,m},
rowhead = 1,
}
%% table body
\toprule
{Sensing\\ material}
& {Structure\\ type}
& {Fabrication\\ technique}
& {T\TblrNote{a}\\ (\unit{\degreeCelsius})}
& {VOCs\\ detected}
& Detection range
& DAT\TblrNote{b}
& Ref. \\
\midrule
\ce{SnO3} and \ce{WO3} & Villi-like nano structure & Electron beam evaporation & 212 & nitrogen oxide, ammonia, ethanol, acetone, toluene, benzene, carbon monoxide, & \qty{899}{ppt} -- \qty{10}{ppm} & PCA & \cite{RN5229}\\
MOS (\ce{NiO}, \ce{CuO}, \ce{Cr2O3}, \ce{SnO3} and \ce{WO3}) & Nano pattern of multi-array sensing & Lithography & 380 & toluene, nitrogen oxide, ammonia, ethanol, acetone, hexane, propanol & \qty{5}{ppm} & PCA & \cite{RN5230}\\
\ce{SnO3} & Nanowire gradient & Vapor solid method & 326 & isopropyl alcohol, ethanol, carbon monoxide & \qtyrange{2}{10}{ppm} & LDA & \cite{RN5133}\\
\ce{Pd}\slash \ce{SnO3} & Nanowire sensor array & Vapor solid & 150 & isopropyl alcohol & \qtyrange{1}{50}{ppm} & LDA & \cite{RN5134}\\
\ce{TiO2}, \ce{SnO3}, ITO, \ce{WO3} & Nanorod array & Oblique angle deposition & 250 & hydrogen, carbon monoxide, nitrogen dioxide & \qtyrange{10}{200}{ppm} & -- & \cite{RN5132}\\
\ce{Si}-\ce{SiO2}, \ce{Pd}-\ce{SiO2}, \ce{Pt}-\ce{SiO2}, \ce{Ti}-\ce{SiO2} & Microwire sensor chip & Flexible flame spray pyrolysis & 400 & formaldehyde, acetone, ethanol, ammonia & \qty{3}{ppm} & -- & \cite{RN483}\\
\ce{WO3} & Nanofibers & Electro\-spinning & 350 & hydrogen sulfide, acetone & \qtyrange{1}{5}{ppm} & PCA & \cite{RN5131}\\
\ce{Cu2O} & Nanospheres & silanization & 180 & ethanol, ethylacetate, toluene, hexane, tetrahydrofuran & \qtyrange{25}{200}{ppm} & PCA & \cite{RN5231}\\
Gold & Nano-islands & In-situ iterative seeding and growth & RT & acetone, ethanol, propionaldehyde, acetophenone, benzyl alcohol, benzaldehyde & \qtyrange{1}{1000}{ppm} & PCA & \cite{RN5232}\\
\ce{Pt}, \ce{Pd}-doped \ce{SnO3}\slash RGO & Nanohybrids & Hydro\-thermal & 180 & hydrogen, hydrogen sulfide, nitrogen dioxide & \qtyrange{0.04}{40}{ppm} & PCA, LDA, Hierarchical Cluster Analysis & \cite{RN5233}\\
Thermo-cycled MOS sensors & MOS films & Thermal deposition & 260--290 & hexane, butyl acetate & \qtyrange{50}{175}{ppm} & -- & \cite{RN287}\\
Commercial PEN3, CAPINose & TGS sensors & -- & RT & ethanol & 10 vol.\% & Average resistance & \cite{RN286}\\
\ce{SnO3}, \ce{WO3}, \ce{ZnO}, \ce{In2O3} & Nanofilms & Screen printing & 26--426 & formaldehyde, carbon monoxide, nitrogen dioxide, toluene, ammonia & \qtyrange{0.6}{1000}{ppm} & -- & \cite{RN276}\\
\ce{ZiTiO3} & Nanoarrays & Hydro\-thermal, CVD & 350 & acetone & \qtyrange{1.2}{12.5}{ppm} & -- & \cite{RN296}\\
\ce{Au}\slash \ce{SnO3}, \ce{Pt}\slash \ce{SnO3}, \ce{Ni}\slash \ce{SnO3}, ITO\slash \ce{SnO3} & Multiplexed nanotube arrays & Spray pyrolysis & RT & hydrogen, benzene, nitrogen dioxide & \qtyrange{50}{4000}{ppm} & LVA & \cite{RN5224}\\
Warwick OLFaction (WOLF) E-nose & MEMS MOS-based commercial thick and thin film sensors & -- & RT & acetone, 1\nobreakdash-\hspace{0pt}propanol, iso-propanol, iso-butylene & \qtyrange{2}{10}{ppm} & PCA & \cite{RN120}\\
\ce{Pt}, \ce{Cu}, and \ce{Ag} decorated \ce{TiO2} and \ce{ZnO} functionalized \ce{GaN} & Nanowire & Lithography, CVD, Chemical Etching & RT & nitrogen dioxide, sulfur dioxide, hydrogen, ethanol & \qtyrange{0.1}{10000}{ppm} & PCA, SVM, k-NN, Decision Tree & \cite{RN5237}\\
Au decorated \ce{WO3}, \ce{SnO3} and \ce{NiO} & Thin films, nanostructures & electron-beam evaporation & 100--300 & acetone, toluene, ammonia, hydrogen sulfide & \qty{10}{ppm} & PCA & \cite{RN5238}\\
Commercial MOS sensors & TGS sensors & -- & RT & ethanol, acetone & -- & partial least squares discriminant analysis & \cite{RN5239}\\
Commercial MOS sensors & TGS Sensors & -- & RT & nitrogen dioxide, carbon monoxide & \qtyrange{0}{50}{ppm} & PCA, \mbox{C-means} clustering, back propagation neural network & \cite{RN5240}\\
Pure and \ce{Fe}-doped \ce{In2O3} & Nanofibers & Electro\-spinning & 250--450 & benzene, xylene, toluene, ethanol, formaldehyde & \qtyrange{0.1}{1000}{ppm} & PCA & \cite{RN5137} \\
\bottomrule
\end{longtblr}
\endgroup
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/18189
|
692473
| 321,234 |
https://tex.stackexchange.com/questions/692483
|
2
|
I came across a LaTeX template for a report with the following documentclass options:
```
\documentclass[
11pt,
twoside,
table,
openright,
openany
]{report}
```
What is the `table` parameter doing?
|
https://tex.stackexchange.com/users/146754
|
`table` option in report documentclass
| false |
Any such options are passed to all packages, if no package uses it you get an `unused global option` warning, but it is not an error.
|
7
|
https://tex.stackexchange.com/users/1090
|
692484
| 321,236 |
https://tex.stackexchange.com/questions/692466
|
0
|
As I don't want my sections ... paragraphs to stay unnumbered, I wrote `\setcounter{tocdepth}{5} \setcounter{secnumdepth}{0}`. With `cleveref` I cannot refer to unnumbered sections as "section" at all.
To be more clear: I defined a new ref-format `\RenewDocumentCommand\fullref{m}{\namecref{#1} \nameref{#1} \vpageref{#1}}`, which should give something like "section *sectiontitle* on page 2" or "subsection *sectiontitle* on page 4.
```
% uses-*- MODE: latex; TeX-engine: luatex; coding: utf-8; -*-
\documentclass{scrartcl}
\usepackage[main=ngerman]{babel}
\usepackage[german,final]{varioref}
\usepackage{hyperref}
\usepackage[german,nameinlink]{cleveref}
\makeatletter
\RenewDocumentCommand\fullref{m}{\namecref{#1} \nameref{#1}
\vpageref{#1}}
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{0} % <---
\makeatother
\begin{document}
\section{I'm Section}
\label{sec:section}
bla
see \namecref{sec:subsubsection}
see \fullref{sec:subsubsection}
\newpage
\subsection{I'm Subsection}
\label{sec:subsection}
bla
bla
see \namecref{sec:section}
see \fullref{sec:section}
see \namecref{sec:subsection}
see \fullref{sec:subsection}
\newpage
\subsubsection{I'm Child of Subsection}
\label{sec:subsubsection}
\end{document}
```
|
https://tex.stackexchange.com/users/28175
|
How to use cleveref's \namecref for unnumbered sections?
| true |
You could try the following. This requires a current LaTeX.
```
\documentclass{scrartcl}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\RenewDocumentCommand\fullref{m}{\namecref{#1} \nameref{#1}
\vpageref{#1}}
\setcounter{secnumdepth}{0} % <---
\makeatletter
\AddToHookWithArguments{cmd/@sect/before}{\def\cref@currentlabel{[#1][??][??]??}}
\makeatother
\crefname{section}{section}{sections}
\crefname{subsection}{subsection}{subsections}
\crefname{subsubsection}{subsubsection}{subsections}
\begin{document}
\section{I'm Section}\label{sec:section}
bla
see \namecref{sec:subsubsection}, \cref{sec:subsubsection}
see \fullref{sec:subsubsection}
\subsection{I'm Subsection}\label{sec:subsection}
bla
see \namecref{sec:section}
see \fullref{sec:section}
see \namecref{sec:subsection}
see \fullref{sec:subsection}
\subsubsection{I'm Child of Subsection}
\label{sec:subsubsection}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/2388
|
692487
| 321,238 |
https://tex.stackexchange.com/questions/692470
|
7
|
How to add \* to some (i.e. not all) section numbers?
—
**Before**
2.1 Differentiation
2.2 Integration
**After**
2.1 Differentiation
2.2\* Integration
—
* The documentclass is jlreq.
* I don’t want to use a package because it can break the style.
* I need the starred sections to be included in a table of contents.
* There will be cross-references to some of starred sections. The section number should be displayed in the cross-reference with the asterisk.
—
**Small sample document**
```
% !TEX TS-program = lualatex
\documentclass[book]{jlreq}
\begin{document}
\tableofcontents
\chapter{Calculus}
\section{Differentiation}
\section{Integration}
\end{document}
```
|
https://tex.stackexchange.com/users/301680
|
Adding * to some section numbers
| false |
Here's a solution which sets up a new command, `\starredsection`. It meets all four of the OP's requirements. Its limitations are (a) any `\label` command must be included in the argument of `\starredsection` and (b) no optional argument is recognized.
The ToC page:
The first main page:
```
% !TEX TS-program = lualatex
\documentclass[book]{jlreq}
\newcommand\starredsection[1]{%
\begingroup % localize scope of next instruction
\renewcommand\thesection{\arabic{chapter}.\arabic{section}*}
\section{#1}
\endgroup}
\begin{document}
\tableofcontents
\chapter{Calculus}
\section{Differentiation}
\starredsection{Integration\label{sec:integ}}
\subsection{Hello}
\section{Whatever}\label{sec:what}
\noindent
Cross-references to sections \ref{sec:integ} and \ref{sec:what}.
\end{document}
```
|
5
|
https://tex.stackexchange.com/users/5001
|
692491
| 321,239 |
https://tex.stackexchange.com/questions/692489
|
0
|
I have a citation in my caption and it should also appear in the List of figures. However in the bibliography hyperref generates a reference of this citation to the previous chapter of the LOF. For instance:
```
Chapter 1 |
Chapter 2 |
Figure -> caption:(\cite{Hawking})
Chapter 3 |
LOF |
BIB
[1] Hawking 2.1 3
```
I do not want the last reference (3) in my Bibliography. Can someone help?
Thank you in advance
Minimal example:
```
\documentclass[a4paper,12pt,headings=normal,twoside,parskip,bibliography=totoc,index=toto,final,numbers=noenddot]{scrreprt}
\usepackage[bookmarks,
bookmarksopen=true,
colorlinks=true,
linkcolor=black,
pdfpagelayout = TwoPageRight,
citecolor=blue,
urlcolor=blue,
backref,
linktocpage]{hyperref}
\usepackage{natbib}
\begin{document}
\chapter{One}
\chapter{Two}
\section{TwoPointOne}
\begin{figure}
\centering
\caption{Caption \cite{Hawking1998}}
\end{figure}
\chapter{Three}
\listoffigures
\addcontentsline{toc}{chapter}{LOF}
\bibliographystyle{unsrt}
\bibliography{bib}
\end{document}
```
|
https://tex.stackexchange.com/users/301698
|
Hyperref generates a wrong reference in the Bibliography
| false |
You can disable the backrefs in the list of figures locally:
```
\backrefsetup{disable}
\listoffigures
\backrefsetup{enable}
```
|
1
|
https://tex.stackexchange.com/users/2388
|
692492
| 321,240 |
https://tex.stackexchange.com/questions/692490
|
8
|
I was trying to solve 'Exercise 20.20' from the TeX Book which asks to create a macro `\punishment` capable of repeating a given sentence n times using the Plain TeX format. My first attempt was the following:
```
% not working
\def\punishment#1#2{
\newcount\ii\ii=0
\loop {
\advance\ii by 1
\message{\the\ii}
{#1}
} \ifnum\ii<#2 \repeat
}
```
But this gives the error `! TeX capacity exceeded, sorry [main memory size=5000000].` Moreover the messages printed in the terminal `1 1 1 1 1 ...` show that the counter remains fixed to 1 and that the loop goes on forever.
Could you explain why I had to *remove the curly braces* in order to obtain the following working solution?
```
% working
\def\punishment#1#2{
\newcount\ii\ii=0
\loop
\advance\ii by 1
\message{\the\ii}
{#1}
\ifnum\ii<#2 \repeat
}
```
More specifically, why did the first attempt behave that way?
|
https://tex.stackexchange.com/users/246101
|
Why do curly braces break this loop?
| true |
`{...}` forms a group, and `\advance\ii by 1` is a local assignment so reverted at the end of the group.
so `\ii` is always 0 in `\ifnum\ii<#2` and it loops forever.
Your definition may not be used in plain tex at all, if you use plain tex you get the error
```
Runaway definition?
#1#2->
! Forbidden control sequence found while scanning definition of \punishment.
<inserted text>
}
<to be read again>
\newcount
l.2 \newcount
\ii\ii=0
?
```
as `\newcount` is `\outer` so not allowed in a definition.
In latex it is not an error but still you should move `\newcount` outside the definition so you only allocate one counter not a new counter each time the macro is used.
|
14
|
https://tex.stackexchange.com/users/1090
|
692494
| 321,242 |
https://tex.stackexchange.com/questions/692490
|
8
|
I was trying to solve 'Exercise 20.20' from the TeX Book which asks to create a macro `\punishment` capable of repeating a given sentence n times using the Plain TeX format. My first attempt was the following:
```
% not working
\def\punishment#1#2{
\newcount\ii\ii=0
\loop {
\advance\ii by 1
\message{\the\ii}
{#1}
} \ifnum\ii<#2 \repeat
}
```
But this gives the error `! TeX capacity exceeded, sorry [main memory size=5000000].` Moreover the messages printed in the terminal `1 1 1 1 1 ...` show that the counter remains fixed to 1 and that the loop goes on forever.
Could you explain why I had to *remove the curly braces* in order to obtain the following working solution?
```
% working
\def\punishment#1#2{
\newcount\ii\ii=0
\loop
\advance\ii by 1
\message{\the\ii}
{#1}
\ifnum\ii<#2 \repeat
}
```
More specifically, why did the first attempt behave that way?
|
https://tex.stackexchange.com/users/246101
|
Why do curly braces break this loop?
| false |
Braces have a dual job in TeX:
1. they can be used to form a group, or
2. they can enclose a single ***undelimited*** argument to a macro.
In the latter case, there is no group involved: if you do
```
\def\foo#1{(#1)}
\foo{\it italics} and still italics
```
you will see that `\it` is not scoped, but continues on. Indeed, the argument passed to `\mytext` is just `italics` and macro replacement produces
```
(\it italics) and still italics
```
Conversely, if you do
```
\def\foo{(}
\foo{\it italics} and upright text
```
you will get
```
({\it italics} and upright text
```
because there was no argument grabbing, so the isolated left brace opens a group.
Now we can look at the definition of `\loop`:
```
527 \def\loop#1\repeat{\def\body{#1}\iterate}
528 \def\iterate{\body \let\next\iterate \else\let\next\relax\fi \next}
529 \let\repeat=\fi % this makes \loop...\if...\repeat skippable
```
(line numbers refer to `plain.tex`). Well, `\loop` seems to take an argument, doesn't it?
Yes, but the argument is ***delimited*** and consists of everything up to the first occurrence of `\repeat` at the same brace level. In this case TeX strips braces only if the argument turns out to have the form
```
{<tokens>}
```
and stripping those outer braces doesn't lead to unbalanced braces.
In your case the argument is
```
{•\advance\ii by•1•\message{\the\ii}•{#1}•}•\ifnum\ii<#2•
```
where `•` denotes a space token, so no brace stripping is done and the isolated left brace opens a group. At the end of the group, the value of `\ii` is reverted back to what it was before, which explains why you always get `1`, because after the group `\ii` is given back the value `0`.
If you instead do
```
\newcount\ii\ii=0
\def\punishment#1#2{
\loop {
\advance\ii by 1
\message{\the\ii}
{#1}
\ifnum\ii<#2 }\repeat
}
```
you will see that it works, because the outer braces are stripped off as they don't leave unbalanced ones.
Of course, this is not the best way to program the loop, for several reasons:
1. those outer braces are useless and hinder readability of the code;
2. there's plenty of spurious spaces;
3. there's no line breaking.
Note that `\newcount` is outer in plain TeX (you shouldn't test plain TeX code with LaTeX), so it cannot appear inside the replacement text of a macro, so I moved it outside.
The initialization `\ii=0` should instead go inside the macro.
```
\newcount\ii
\def\punishment#1#2{%
\ii=0
\loop
\advance\ii by 1
\message{\the\ii}%
#1\endgraf % \par wouldn't work in plain
\ifnum\ii<#2\repeat
}
```
I'd not use braces around `#1`. Why `\repeat` just after `#2`?
OK, let's do a test.
```
\newcount\ii
\def\punishment#1#2{%
\ii=0
\loop
\advance\ii by 1
\message{\the\ii}%
#1
\ifnum\ii<#2
\repeat
}
\newcount\test
\test=4
\punishment{Test}{4}
\punishment{Test}{\test}
\bye
```
The output ought to be the same, shouldn't it?
Move `\repeat` or add `\relax` just after `#2` to get
Exercise: find out why.
|
8
|
https://tex.stackexchange.com/users/4427
|
692500
| 321,244 |
https://tex.stackexchange.com/questions/692470
|
7
|
How to add \* to some (i.e. not all) section numbers?
—
**Before**
2.1 Differentiation
2.2 Integration
**After**
2.1 Differentiation
2.2\* Integration
—
* The documentclass is jlreq.
* I don’t want to use a package because it can break the style.
* I need the starred sections to be included in a table of contents.
* There will be cross-references to some of starred sections. The section number should be displayed in the cross-reference with the asterisk.
—
**Small sample document**
```
% !TEX TS-program = lualatex
\documentclass[book]{jlreq}
\begin{document}
\tableofcontents
\chapter{Calculus}
\section{Differentiation}
\section{Integration}
\end{document}
```
|
https://tex.stackexchange.com/users/301680
|
Adding * to some section numbers
| true |
You can use a conditional and mark “difficult” sections with
```
\section+{Title}
```
This also allows the standard optional argument to `\section`, so you can still do
```
\section+[Short title]{Long title}
```
as usual. A `\label` can go anywhere: inside the main argument or also outside. Also `\section*` will work as usual.
```
\documentclass[oneside]{book}
\usepackage[a6paper,margin=1.5cm]{geometry}
\pagestyle{plain}
\NewCommandCopy{\latexsection}{\section}
\RenewDocumentCommand{\section}{t+sO{#4}m}{%
\IfBooleanT{#1}{\difficultsectiontrue}
\IfBooleanTF{#2}{%
% called as \section*
\latexsection*{#4}%
}{%
\latexsection[#3]{#4}%
}%
\difficultsectionfalse
}
\newif\ifdifficultsection
\renewcommand{\thesection}{%
\thechapter.\arabic{section}%
\ifdifficultsection *\fi
}
\renewcommand{\thesubsection}{%
\thechapter.\arabic{section}.\arabic{subsection}%
}
\begin{document}
\tableofcontents
\chapter{Calculus}
We have section~\ref{diff} and section~\ref{int}
\section{Differentiation}\label{diff}
\subsection{Preliminaries}
\section+{Integration}\label{int}
\subsection{Preliminaries}
\end{document}
```
I also redefined `\thesubsection` so it won't have a `*`.
Production note: the first three lines in the above code are only aimed to obtain a smaller picture of the output.
|
8
|
https://tex.stackexchange.com/users/4427
|
692501
| 321,245 |
https://tex.stackexchange.com/questions/692498
|
1
|
I've seen this topic:[How to reset exercise counter in XSIM](https://tex.stackexchange.com/questions/679798/how-to-reset-exercise-counter-in-xsim) but thats's not exactly what I want.
I am creating a document which contains exercices for my students.
Each page contains exercices for only one student and I would like to reset the counter of exercise after each new page.
It almost works with `\xsimsetup{exercise/within=page}` and (for each student):
```
\newpage
\setcounter{page}{1}
```
The counter of exercise is reset with each page but the counter gives "Exercise 1.1", Exercise 1.2", on each page. So the first number is the number of the page, and the second number is the number of the exercise. I don't want "1.1", "1.2", but just "1", "2".
So how do I get rid off the number of the page.
While writing this, I wonder if maybe there is a command in the Xsim package which simply resets the counter of the page? If so, I could type this command after each `newpage` without considering the number of the page.
|
https://tex.stackexchange.com/users/249670
|
Resetting counter exercise for each page with Xsim package
| true |
In fact, a simple `setcounter{exercise}{0}` works fine
|
1
|
https://tex.stackexchange.com/users/249670
|
692503
| 321,246 |
https://tex.stackexchange.com/questions/692186
|
0
|
I am revising a paper before submitting it, and I realized I really dislike when a line ends with an article, and the "articled" word follows on the next line. I found no strict rule for this problem in English, but typographists still recommend avoiding it.
I looked into `\nolinebreak` and `\nobreak` but did not figure out how to apply them automatically throughout the text. I presume there might be a way to check the length of the last word on the line and prevent breaking if it is under four letters of length, which would solve everything, but I could not come up with a solution like that in `LaTeX`.
I am aware of using ~ instead of whitespace between the article and the word, but that seems too laborious.
|
https://tex.stackexchange.com/users/278080
|
Preventing text lines to end with a grammatical article (or with short words)
| false |
This is only really feasible in luatex as otherwise you don't really have access to the words before linebreaking. In English it's not normally a problem but this seems to a common requirement for certain languages.
A related question/answer is:
[How to make all articles stay together with the~following word?](https://tex.stackexchange.com/q/502266/1090)
In English such a restriction would be very odd, for example in my browser the last words on the line in your question are in almost all cases less than 4 letters (`an`, `in`, `the`, `I`, `too`) and it looks fine to me.
|
1
|
https://tex.stackexchange.com/users/1090
|
692504
| 321,247 |
https://tex.stackexchange.com/questions/513960
|
0
|
Kindly please help me soon, I must submit my paper as soon as possible and still there is a problem and white space and though I used htp for table, my table come between the text! also, I've searched a lot and still have this problem, after a long table there is a white space that the section can be in that space. My LaTeX code is as below:
```
\documentclass{cta-author}
\usepackage{natbib}
\usepackage{longtable}
\usepackage{lineno,hyperref}
\usepackage{lineno}
\usepackage{parskip}
\usepackage[utf8]{inputenc}
\usepackage{framed} % Framing content
\usepackage{multicol} % Multiple columns environment
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage{resizegather}
\usepackage{booktabs}
\usepackage{bm}
\usepackage[font=small,skip=0pt]{caption}
\usepackage{setspace}
\begin{document}
{text}
\subsection{text}
\begin{table}[!t]
\caption{text1}
\label{table1}
\centering
\resizebox{0.48\textwidth}{!}{%
%{\small \begin{center}
\begin{tabular}{|l|}
%\begin{longtable}{l}
% \centering
\toprule\toprule
{text}
\bottomrule\bottomrule
\end{tabular}
}
\end{table}
\begin{table}[h]
\caption*{\raggedright Continuation of Table \ref{table1}:}
\label{table2}
\centering
\resizebox{0.48\textwidth}{!}{%
\begin{tabular}{|l|}
\toprule\toprule
{text3}
\end{tabular}}
\vspace{-5pt}
\end{table}
\section{Simulation Results}
\label{section 2}
{text}
\\
\raggedbottom
\begin{table}[htp]
\caption{Simulation}
\label{Table4}
\centering
\begin{spacing}{1.5}
\small\addtolength{\tabcolsep}{-15pt}
\begin{tabular}{l c}
\toprule\toprule
{text5}
\bottomrule\bottomrule
\end{tabular}
\end{spacing}
\vspace{-10mm}
\end{table}
{text}
\end{document}
```
|
https://tex.stackexchange.com/users/200265
|
How to remove white space after table and before new section?
| false |
Use `\vspace*{-\baselineskip}` after the image or table.
As to make it global (I.e., after each image or table), I do not know how except via using custom style.
E.g.,
```
\newenvironment{rLongtable}{
\vspace*{-\baselineskip}
\begin{longtable}
}
{
\end{longtable}
\vspace*{-1.7\baselineskip}
}
```
|
0
|
https://tex.stackexchange.com/users/296109
|
692505
| 321,248 |
https://tex.stackexchange.com/questions/692510
|
0
|
I have created my first newenvironment! I had it working, and then I must have done something and it has stopped. The intent is to create an "aside" environment that puts a vertical space, then sets things in sans serif, then another space and normal font.
When I run the MWE below, it puts in the first space, and goes to sans serif, but doesn't put the second space or switch back. I've been staring at it for 30 minutes and I can't figure it out.
```
\documentclass[openany, final]{memoir}
\usepackage{dialogue}
\OnehalfSpacing
\makeatletter
\renewcommand\partnumberlinehook[1]{%
\settowidth{\@tempdima}{\bfseries #1 }%
}
\makeatother
\newenvironment{aside}
{
\vspace{0.2in}
\begin{sffamily}
}
{
\end{sffamily}
\vspace{0.2in}
}
\begin{document}
Then they take the bandages off and, as expected, my vision hasn't changed but
my eyes look much better.
\aside{The car crash and the eye surgery happened at around the same time, but
\ldots I don't remember which happened first and, at this point, there's no one
left alive who can tell me. I sort of \emph{think} that the eye surgery was
first. But I don't really know. And my thinking this is based on thinking, not
on the sort of sense of time that most people seem to have.
I think this is related to my NLD, I've heard of this sort of thing in some
other people withe NLD, but it's not the center of the diagnosis. It happens
with more minor life events too. I don't remember when things happened, or in
what order they happened.}
I've survived being hit by a cab, having eye surgery, and 7th grade, but 8th
grade is even worse.
\end{document}
```
When I run it in my full document, I get a different error, of "begin{\sffamily} ended by \end{document} but I can't figure out a good MWE for that.
|
https://tex.stackexchange.com/users/4719
|
Problem with new environment not reading some commands
| true |
Environments use a syntax `\begin{name}...\end{name}` not `\name{...}`
Separately beware white space from ends of lines (avoided here by adding `%` and make sure to end the paragraph (`\par`) before adding vertical space.
The `dialog` package appears incompatible with the memoir class so I commented that out.
```
\documentclass[openany, final]{memoir}
%\usepackage{dialogue}
\OnehalfSpacing
\makeatletter
\renewcommand\partnumberlinehook[1]{%
\settowidth{\@tempdima}{\bfseries #1 }%
}
\makeatother
\newenvironment{aside}
{\par
\vspace{0.2in}%
\begin{sffamily}%
}
{%
\end{sffamily}%
\par
\vspace{0.2in}%
}
\begin{document}
Then they take the bandages off and, as expected, my vision hasn't changed but
my eyes look much better.
\begin{aside}
The car crash and the eye surgery happened at around the same time, but
\ldots I don't remember which happened first and, at this point, there's no one
left alive who can tell me. I sort of \emph{think} that the eye surgery was
first. But I don't really know. And my thinking this is based on thinking, not
on the sort of sense of time that most people seem to have.
I think this is related to my NLD, I've heard of this sort of thing in some
other people withe NLD, but it's not the center of the diagnosis. It happens
with more minor life events too. I don't remember when things happened, or in
what order they happened.
\end{aside}
I've survived being hit by a cab, having eye surgery, and 7th grade, but 8th
grade is even worse.
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/1090
|
692511
| 321,251 |
https://tex.stackexchange.com/questions/34604
|
300
|
How do I enter Unicode characters in LaTeX? What packages do I need to install and what escape sequence do I type to specify Unicode characters in an ASCII source file?
|
https://tex.stackexchange.com/users/334
|
Entering Unicode characters in LaTeX
| false |
I found the following tweak helpful when you are dealing with very specific (often weird-looking) unicodes. For instance, if you want to render the Cuneiform Sign Dugud character (U+12082), simply copy-paste the following into a `.tex` file and compile it:
```
\documentclass[]{article}
% The required package
\usepackage{unicode-math}
% The definitioning of the (locally installed) font family
% that supports the unicode symbol
\newfontfamily\NotoSansCuneiform{Noto Sans Cuneiform}
% The definitioning of the literal custom unicode symbol
% The font command and the unicode must be encapsulated within "\text{}",
% otherwise the text will be rendered in Noto Sans Cuneiform
% all the way to the end of the document
\newcommand{\}{\text{\NotoSansCuneiform }}
\begin{document}
The Cuneiform Sign Dugud (U+12082) has the following glyph: \.
\end{document}
```
The following is the screenshot of the entire code (in case your browser cannot render it):
And the following is the screenshot of the output after rendering using KDE Kile:
Look how easy it is to display the U+12082 character!
While [Davislor](https://tex.stackexchange.com/a/554858/301715)'s approach of using `\symbol{"12082}` is definitely working, you can copy-paste the above code into a word processor with some compatible font family. Then the Cuneiform Sign Dugud character (plus a leading "\") will be displayed *literally*, instead of just the number "12082".
However, there are three things to note when using this method:
* You must ensure that the local font family that you are using is compatible with the unicode character that you want to render (e.g., using Unicode Map application in your computer to view a font's supported unicodes).
* Each unicode character must be defined *individually*. And if there are two glyphs that are mapped by two distict font families, both fonts must be defined in the document as well.
* As [ChrisN](https://tex.stackexchange.com/a/34607/301715) has pointed out, the above LaTeX code should be compiled using [XeTeX](https://en.wikipedia.org/wiki/XeTeX). This is because the command `\newfontfamily{}` is not supported by PDFLaTeX (the default compiler in several LaTeX editors).
|
1
|
https://tex.stackexchange.com/users/301715
|
692514
| 321,253 |
https://tex.stackexchange.com/questions/692515
|
0
|
For testing purposes, I'm trying to reproduce my geometry/layout without using `geometry` package (It is only loaded to use the `showframe` option).
So far, it works fine. But in my main document I use a command to produce a fully automated twocolumn section with the `multicol` package. If I now replace the `\newgeometry` command, which works perfectly fine in the main document, with my adapted layout dimensions, the layout itself changes, **but** the columns still are typesetted using the former `textwidth` of my initial layout dimensions, as indicated by `showframe`.
Here's my MWE:
```
\documentclass[a4paper,english,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\usepackage[showframe]{geometry}
\usepackage{multicol}
\setlength\oddsidemargin{-5.4mm}
\setlength\evensidemargin{34.6mm}
\setlength\topmargin{-23.4mm}
\setlength\headheight{4.2mm}
\setlength\headsep{8.8mm}
\setlength\marginparsep{4.5mm}
\setlength\marginparwidth{40.5mm}
\setlength\footskip{10.5mm}
\setlength\marginparpush{1.8mm}
\setlength\voffset{0mm}
\setlength\hoffset{0mm}
\setlength\textwidth{130mm}
\setlength\textheight{262mm}
\NewDocumentCommand{\columnpart}{+m}{
\newpage
\begingroup
\setlength\oddsidemargin{-5.4mm}
\setlength\evensidemargin{12.1mm}
\setlength\topmargin{-23.4mm}
\setlength\headheight{4.2mm}
\setlength\headsep{8.8mm}
\setlength\marginparsep{4.5mm}
\setlength\marginparwidth{18mm}
\setlength\footskip{10.5mm}
\setlength\marginparpush{1.8mm}
\setlength\voffset{0mm}
\setlength\hoffset{0mm}
\setlength\textwidth{152.5mm}
\setlength\textheight{262mm}
\setlength\columnsep{1cm}
\begin{multicols*}{2}
#1
\end{multicols*}
\endgroup
\newpage
}
\begin{document}
\blindtext
\columnpart{\blindtext[5]}
\blindtext
\end{document}
```
What do I have to change, to make `multicols` adapt the new `textwidth` set inside the command without using additional packages?
|
https://tex.stackexchange.com/users/297560
|
Despite layout change (without geometry package) `multicols` still use former textwidth
| true |
Ok, I may have overlooked something in the `geometry` package. Just inserted the following lines taken from the `geometry` package (`\Gm@changelayout` definition) at the end of the code inside the newcommand:
```
\setlength{\columnwidth}{\textwidth}%
\setlength\columnsep{5mm}%
\if@twocolumn%
\advance\columnwidth-\columnsep
\divide\columnwidth\tw@%
\@firstcolumntrue%
\fi%
\setlength{\hsize}{\columnwidth}%
\setlength{\linewidth}{\hsize}%
```
Now it works. Sorry for wasting anybodys time due to my lack of thoroughness ;)
|
1
|
https://tex.stackexchange.com/users/297560
|
692520
| 321,255 |
https://tex.stackexchange.com/questions/692523
|
0
|
I want to solve Exercise 5.7 in the TeXBook by Donald E. Knuth.
```
Define control sequences **\beginthe**<block name> and **\endthe**<block name>
that provide a “named” block structure.
In other words,
**\beginthe{beguine}\beginthe{waltz}\endthe{waltz}\endthe{beguine}**
should be permissible, but not
**\beginthe{beguine}\beginthe{waltz}\endthe{beguine}\endthe{waltz}.**
```
1. How do I even create my own csname \beginthe?
I have tried this and it kind of works:
**\def\beguine#1{\csname beginbeguine \endcsname}**
\begin{beguine}
Hello world!
\end{beguine}
which gives
```
ello World!
```
However, this does not work
**\def\beguine#1{\csname beginthebeguine \endcsname}**
\beginthe{beguine}
Hello World!
\endthe{beguine}
2. How do I make the **\beginthe{waltz}...\endthe{waltz}** environment nested inside the **\beginthe{beguine}...\endthe{beguine}** environment?
|
https://tex.stackexchange.com/users/301720
|
Exercise 5.7 in TeX - define control sequences with grouping
| false |
You say
>
> I have tried this and it works:
>
>
>
>
>
> ```
> \def\beguine#1{\csname beginbeguine \endcsname}
>
> \begin{beguine} Hello world! \end{beguine}
>
> ```
>
>
But it should give an error that `\begin` is not defined. Do not use latex for testing plain tex code, many commands have different definitions, even if they have the same name.
The TeX Book gives the answer:
```
\def\beginthe#1{\begingroup\def\blockname{#1}}
\def\endthe#1{\def\test{#1}%
\ifx\test\blockname
\endgroup
\else
\errmessage{You should have said \string\endthe{\blockname}}%
\fi}
```
Note Knuth's answer here just provides named groups, unlike LaTeX `\begin` it does not use `\csname` to attach specific code to the start and end of the group.
|
3
|
https://tex.stackexchange.com/users/1090
|
692524
| 321,256 |
https://tex.stackexchange.com/questions/692522
|
1
|
I am using a modified "twenty seconds" CV template found here:
<https://www.overleaf.com/latex/templates/twentyoneseconds/xmvbqtfmnycf>
(simply open in Overleaf for an MWE)
When I try to remove one or more of the contact data (e.g. line 43, cvsitepersonal, it doesn't compile anymore. Any suggestions?
|
https://tex.stackexchange.com/users/96525
|
How can I safely remove contact icons from Twenty-One CV template?
| false |
To omit any of these personal coordinates, leave the contents of the macro empty. Replace e.g.
```
\cvgithub{name-surname-github}
```
by
```
\cvgithub{}
```
Because of an error in `twentyonesecondcv.cls`, this does not work for `\cvsitepersonal`: The icon will remain, with an empty space beside it.
There are two possibilities: work around the error, or fix it.
**Work around:** If you need neither `\cvgithub` nor `\cvsitepersonal`, omitting `\cvgithub` (i.e., writing `\cvgithub{}`) will also let `cvsitepersonal` disappear, problem solved.
**Fix the error:** In the file `twentyonesecondcv.cls`, search for the line
```
\ifthenelse{\equal{\cvgithub}{}}{}{\textsc{\large\icon{\Mundus}} & \href{https://\cvsitepersonal}{\textcolor{mainblue}{{\cvsitepersonal}}}\\}
```
and replace `\cvgithub` by `\cvsitepersonal`. Make sure to pick the correct line: The second line starting with `\ifthenelse{\equal{\cvgithub}{}}` needs fixing, while the first one really deals with `cvgithub`. After fixing, `\cvsitepersonal{}` will let the line about the personal website disappear, as it should.
|
1
|
https://tex.stackexchange.com/users/110998
|
692525
| 321,257 |
https://tex.stackexchange.com/questions/630377
|
3
|
I'd like to do something that I think many people would like to do, but the tools don't seem to exist.
The short form of my question is whether there is a library (C++ or Java) to parse a PDF produced by LaTeX and render it "in pieces," say a paragraph at a time, so that the rendering program can intersperse the rendered PDF with interactive widgets. Display PostScript would have been the way to do this, but that died years ago.
The goal is to use LaTeX to produce the text-based aspects of a presentation, while allowing the use of interactive tools. For example, suppose you want to explain how a lever works. LaTeX can be used for the static aspects of the discussion, including some static figures. But the user should also be able to interactively play with the inputs that affect how a lever works -- moving the fulcrum around or changing the weights on each end, say. The reader could print the document to read off-line normally, but they could also interact with it when on-line.
The path of least resistance is to use browser-based tools, but HTML/JS is pretty poor when it comes to anything more than a few simple formulas. Another solution is to insert hyperlinks in the PDF that lead to HTML pages, and that would work, but it's a Rube Goldberg approach, and it wouldn't be a smooth experience for the reader.
|
https://tex.stackexchange.com/users/224083
|
Selective Rendering of PDF
| false |
[Asymptote](https://ctan.org/pkg/asymptote) is a C-like language that can be included directly into your LaTeX documents. If you can persuade all your end users to only use Adobe Acrobat to display their PDFs, then Asymptote can embed interactive diagrams directly inside your PDF. Here's a [TUGboat article demonstrating a few interactive diagrams](https://www.math.ualberta.ca/%7Ebowman/publications/tb98bowman.pdf). All the content can be printed off just like any other PDF.
My personal experience with Asymptote is very limited, and I've never worked with the interactive portions of Asymptote. Although it seems to meet all the requirements stated in your question, I wouldn't recommend it unless you can *really* really ensure all your end user are using Adobe Acrobat. HTML can still do a good job of displaying math with MathJax, and JavaScript + SVG can work wonders for creating interactive diagrams.
|
0
|
https://tex.stackexchange.com/users/91603
|
692535
| 321,262 |
https://tex.stackexchange.com/questions/692534
|
1
|
I posted my first question [here](https://tex.stackexchange.com/questions/692512/making-interactive-slides-in-texworks).
`samcarter_is_at_topanswers.xyz` helped me with the correct answer. Now following that question, I got another query. Is it possible to show h1=(1,2,3,4) on both slides too? and also if I want to show in first slide h1=(1,2,3,4) but in the other slide say h3=(1,2,3,4) ? Here is the sample code:
```
\documentclass[10pt,aspectratio=1610]{beamer}
\usepackage{natbib}
%\usepackage{enumerate}
%\usepackage{amsmath}
%\usepackage{amssymb}
%\usepackage[utf8]{inputenc}
%\usepackage{mwe}
%\usepackage{etoolbox}
%\usepackage{bookmark}
\usepackage{subcaption}
\usepackage{lipsum}
\usepackage{tabularx}
\usepackage{pdflscape}
%\usepackage{float}
%\usepackage{amsmath}
\usepackage{ragged2e}
\usepackage{blindtext}
%\usepackage{amsfonts}
%\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{bigints}
\usepackage{caption}
%\usepackage{xcolor}
\usepackage{stackengine}
\usepackage{multirow}
%\usepackage{hyperref}
\usepackage{textgreek}
%\usepackage{color, colortbl}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\usepackage{fancyvrb}
\usepackage{fvextra}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\tiny
\setbeamertemplate{footline}[text line]{%
\parbox{\linewidth}{\vspace*{-8pt}some text\hfill\insertauthor\hfill\insertpagenumber}}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{framesubtitle}{fg=white!40!black}
\usetheme{Madrid}
\usecolortheme{seagull}
\makeatletter
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=3.2ex,dp=1.6ex,right]{author in head/foot}%
\usebeamerfont{author in head/foot} \insertshortauthor \hspace{1mm} \expandafter\ifblank\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=3.2ex,dp=1.6ex,left]{date in head/foot}%
\hspace{1mm} \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\setbeamerfont{institute}{size=\fontsize{10pt}{10pt}}
\setbeamerfont{title}{size=\fontsize{16pt}{16pt}}
\setbeamerfont{author}{size=\fontsize{14pt}{14pt}}
%\usepackage{graphicx}
\usetheme{Madrid}
\setbeamertemplate{caption}[numbered]
\setbeamerfont{framesubtitle}{size=\Large}
\setbeamercovered{transparent}
\begin{document}
\makeatletter
\patchcmd{\beamer@subsubsectionintoc}
{\vfill}
{\vskip\itemsep{5ex}}
{}
{}
\makeatother
\hypersetup{
bookmarksnumbered=true
}
\setcounter{tocdepth}{5}
\makeatletter
\patchcmd{\beamer@subsubsection}
{\Hy@writebookmark{\the\c@subsubsection}{#2}}%
{\Hy@writebookmark{\the\c@subsubsection}{\numberline{\thesection.\thesubsection.\thesubsubsection}#2}}%
{}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% I just copy pasted some codes. I actually do not get what they mean.%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{tmp}
\newcommand<>\Highlight[1]{%
\stepcounter{tmp}%
\only#2{\begin{tikzpicture}[remember picture,overlay]
\fill[gray!60!black,opacity=1]
([xshift=-.2em,yshift=2ex]pic cs:start-\thetmp)
rectangle
([xshift=.2em,yshift=-1ex]pic cs:end-\thetmp);
\end{tikzpicture}}%
\tikzmark{start-\thetmp}#1\hfill\tikzmark{end-\thetmp}%
}
\begin{frame}
\frametitle{frametiTle}
\framesubtitle{framesubtiTle}
{\large \textbf{A BIG LINE}}
\begin{flalign}
&\; \hspace{5mm} \visible<2->{\Highlight<2>{h1=(\textcolor{blue}{1,\,2},\,\textcolor{red}{3,\,4})},}&& \nonumber\\
\hspace*{3mm} \text{\uncover<1>{1 some line some line some line some line some line\vspace*{-5mm}}}&\nonumber
\; \uncover<1>{\genfrac{}{}{0pt}{}{\nearrow}{\searrow}}\\
&\;\hspace{5mm} \uncover<1>{h2=(1,\,2,\,3,\,4),}&&\nonumber
\end{flalign}
\hspace*{2mm} \uncover<1>{2 another line another line another line another line another line another line another line another line.\vspace{3mm}}\\
\visible<2-> {3 third line:third line:third line:third line:third line:
\begin{alignat}{1}
(a+b)^2
&=(a+b)^2(a+b)^2(a+b)^2(a+b)^2(a+b)^2(a+b)^2\textcolor{green}{(a+b)^2(a+b)^2(a+b)^2}\nonumber \\
(a+b)^2
&=(a+b)^2(a+b)^2(a+b)^2(a+b)^2(a+b)^2(a+b)^2\textcolor{green}{(a+b)^2(a+b)^2(a+b)^2}\nonumber
\end{alignat}
$=(a+b)^2(a+b)^2(a+b)^2$.\vspace{.2cm}\\%
last line last linelast linelast line $\textcolor{green}{(a+b)^2(a+b)^2(a+b)^2}$ \vspace{.2cm}\\
$\textcolor{red}{(a+b)^2(a+b)^2(a+b)^2}$}
\end{frame}
\end{document}
```
|
https://tex.stackexchange.com/users/297879
|
Making interactive slides in texworks #2
| false |
To replace text between slides, say `h1` with `h3`, you can use `\alt<>{some text}{another text}`.
And as said before, please clean up your code. Only use what you need for this particular presentation. All the extra code and manual formatting make your code very prone to problems.
```
\documentclass[10pt,aspectratio=1610]{beamer}
\usepackage{natbib}
%\usepackage{enumerate}
%\usepackage{amsmath}
%\usepackage{amssymb}
%\usepackage[utf8]{inputenc}
%\usepackage{mwe}
%\usepackage{etoolbox}
%\usepackage{bookmark}
\usepackage{subcaption}
\usepackage{lipsum}
\usepackage{tabularx}
\usepackage{pdflscape}
%\usepackage{float}
%\usepackage{amsmath}
\usepackage{ragged2e}
\usepackage{blindtext}
%\usepackage{amsfonts}
%\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{bigints}
\usepackage{caption}
%\usepackage{xcolor}
\usepackage{stackengine}
\usepackage{multirow}
%\usepackage{hyperref}
\usepackage{textgreek}
%\usepackage{color, colortbl}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\usepackage{fancyvrb}
\usepackage{fvextra}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\tiny
\setbeamertemplate{footline}[text line]{%
\parbox{\linewidth}{\vspace*{-8pt}some text\hfill\insertauthor\hfill\insertpagenumber}}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{framesubtitle}{fg=white!40!black}
\usetheme{Madrid}
\usecolortheme{seagull}
\makeatletter
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=3.2ex,dp=1.6ex,right]{author in head/foot}%
\usebeamerfont{author in head/foot} \insertshortauthor \hspace{1mm} \expandafter\ifblank\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=3.2ex,dp=1.6ex,left]{date in head/foot}%
\hspace{1mm} \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\setbeamerfont{institute}{size=\fontsize{10pt}{10pt}}
\setbeamerfont{title}{size=\fontsize{16pt}{16pt}}
\setbeamerfont{author}{size=\fontsize{14pt}{14pt}}
%\usepackage{graphicx}
\usetheme{Madrid}
\setbeamertemplate{caption}[numbered]
\setbeamerfont{framesubtitle}{size=\Large}
\setbeamercovered{transparent}
\begin{document}
\makeatletter
\patchcmd{\beamer@subsubsectionintoc}
{\vfill}
{\vskip\itemsep{5ex}}
{}
{}
\makeatother
\hypersetup{
bookmarksnumbered=true
}
\setcounter{tocdepth}{5}
\makeatletter
\patchcmd{\beamer@subsubsection}
{\Hy@writebookmark{\the\c@subsubsection}{#2}}%
{\Hy@writebookmark{\the\c@subsubsection}{\numberline{\thesection.\thesubsection.\thesubsubsection}#2}}%
{}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% I just copy pasted some codes. I actually do not get what they mean.%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{tmp}
\newcommand<>\Highlight[1]{%
\stepcounter{tmp}%
\only#2{\begin{tikzpicture}[remember picture,overlay]
\fill[gray!60!black,opacity=1]
([xshift=-.2em,yshift=2ex]pic cs:start-\thetmp)
rectangle
([xshift=.2em,yshift=-1ex]pic cs:end-\thetmp);
\end{tikzpicture}}%
\tikzmark{start-\thetmp}#1\hfill\tikzmark{end-\thetmp}%
}
\begin{frame}
\frametitle{frametiTle}
\framesubtitle{framesubtiTle}
{\large \textbf{A BIG LINE}}
\begin{flalign}
&\; \hspace{5mm} \Highlight<2>{\alt<1>{h1}{h3}=(\textcolor{blue}{1,\,2},\,\textcolor{red}{3,\,4})},&& \nonumber\\
\hspace*{3mm} \text{\uncover<1>{1 some line some line some line some line some line\vspace*{-5mm}}}&\nonumber
\; \uncover<1>{\genfrac{}{}{0pt}{}{\nearrow}{\searrow}}\\
&\;\hspace{5mm} \uncover<1>{h2=(1,\,2,\,3,\,4),}&&\nonumber
\end{flalign}
\hspace*{2mm} \uncover<1>{2 another line another line another line another line another line another line another line another line.\vspace{3mm}}\\
\visible<2-> {3 third line:third line:third line:third line:third line:
\begin{alignat}{1}
(a+b)^2
&=(a+b)^2(a+b)^2(a+b)^2(a+b)^2(a+b)^2(a+b)^2\textcolor{green}{(a+b)^2(a+b)^2(a+b)^2}\nonumber \\
(a+b)^2
&=(a+b)^2(a+b)^2(a+b)^2(a+b)^2(a+b)^2(a+b)^2\textcolor{green}{(a+b)^2(a+b)^2(a+b)^2}\nonumber
\end{alignat}
$=(a+b)^2(a+b)^2(a+b)^2$.\vspace{.2cm}\\%
last line last linelast linelast line $\textcolor{green}{(a+b)^2(a+b)^2(a+b)^2}$ \vspace{.2cm}\\
$\textcolor{red}{(a+b)^2(a+b)^2(a+b)^2}$}
\end{frame}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/36296
|
692536
| 321,263 |
https://tex.stackexchange.com/questions/33345
|
82
|
I have a table where the last columns fall off the page. Instead of making the text smaller I would like the table to not adhere to the margin of where it begins. I would like to move it to the left. I am using `flushleft`, which is not working. Here is the code:
```
\begin{figure}
\begin{flushleft}
\begin{tabular}{l|l|l|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\multicolumn{21}{l}{a)text}\\ \hline
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10& 11& 12& 13& 14& 15& 16& 17& 18& 19& 20\\ \hline
day1&9.2&8.6&8.1&6.3&7.7&7.3&8.0&8.4&5.9&6.8&7.3&7.6&9.0&7.4&6.6&7.0& 5.3&7.0&8.0&5.2\\
day2&6.7&6.9&0&7.0&0&8.1&9.0&6.1&0&6.9&0&7.3&7.8&5.3&0&8.9&0&8.4&8.4&7.5\\
day3&0&5.2&0&0&7.5&0&0&8.2&0&0&5.4&0&0&8.3&0&0&7.7&0&0&7.3
\end{tabular}
\end{flushleft}
\caption{\label{fig:text}text experiment}
\end{figure}
```
What can be modified? What possible solutions exist?
|
https://tex.stackexchange.com/users/1026
|
making a table fit on a page by moving it left
| false |
You can use the *adjustwidth* environment from the changepage package to shift your table to the left. This environment allows you to widen or shorten the page width from the left or the right. Here is an example of how you can use it.
Step 1: Use the package
```
\usepackage{changepage}
```
Step 2: Add *\begin{adjustwidth}{-2cm}{}* after starting table, and add *\end{adjustwidth}* before the table ends.
```
\begin{center}
\begin{adjustwidth}{-2cm}{}
\begin{tabular}{ c c c }
cell1 & cell2 & cell3 \\
cell4 & cell5 & cell6 \\
cell7 & cell8 & cell9
\end{tabular}
\end{adjustwidth}
\end{center}
```
That's it. Thumbs up if it helped. Thank You!
|
1
|
https://tex.stackexchange.com/users/232864
|
692539
| 321,266 |
https://tex.stackexchange.com/questions/692549
|
2
|
How can I add some vertial space above and underneath the vector (and the line) with keeping the two entries in the second column vertically centered?
```
\documentclass{article}
\usepackage{multirow}
\usepackage{amsmath,amssymb,amsfonts,amsthm,mathrsfs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{cc}
\hline
\multirow{2}{*}{ $\begin{pmatrix} 0 \\ 0 \end{pmatrix} $} & $0$ \\ & $0$ \\
\hline
\end{tabular}
\end{table}
\end{document}
```
|
https://tex.stackexchange.com/users/212488
|
Adding vertical space in multirow table
| false |
By use of `tabularray` package is simple:
```
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{amsmath}
\usepackage{amssymb,amsthm,mathrsfs}
\begin{document}
\begin{table}
\centering
\begin{tblr}{hline{1,Z} = solid, % draw the first and last \hline
colspec = {*{2}{Q[c, mode=math]}}
}
\SetCell[r=2]{}
\begin{pmatrix}
0 \\ 0
\end{pmatrix} & 0 \\
& 0 \\
\end{tblr}
\end{table}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/18189
|
692554
| 321,272 |
https://tex.stackexchange.com/questions/692215
|
0
|
How do `\left |` and `\right |` actually work, specifically when packages like `fontspec` or `mathspec` are involved and unicode fonts are used?
I sort of understand how other kinds of brackets and parentheses are constructed from parts in the `U+2300` Unicode block.
What glyph is actually used to typeset **vertical bars** in that kind of context? Not `U+007C` or `U+2223`? Or are there some tricks involved?
Besides other sources and searches I've tried to look it up in the TeX distro itself, had high hopes for `tex/plain/base`, but - no luck?
|
https://tex.stackexchange.com/users/210048
|
How do \left | and \right | actually work?
| false |
After digging in the sources I'm giving sort of a half-answer to my own question, subject to eventual elaboration by people better with these matters.
So, when using unicode fonts `fontspec` package (eventually helped by `mathspec` or `unicode-math`) is almost a given. The difference **between** getting *scaling vertical bar delimiters* in legacy CMEX or not getting them at all **and** getting scaling vertical bar delimiters *in the font of your choice* is made by using (or not using) `\DeclareMathDelimiter{|}...`
I'm leaving out the rest of the parameters intentionally, as these depend on how you are specifically proceeding with `fontspec` and such; `fontspec` seems to leave out that kind of definition for `|`.
|
1
|
https://tex.stackexchange.com/users/210048
|
692556
| 321,274 |
https://tex.stackexchange.com/questions/692564
|
4
|
I like to include font information in a colophon in some documents, and I'd like it to be automatic. I started by using the `\showfont` command that is used in various questions on this board, to wit:
```
\newcommand{\showfont}{
encoding: \f@encoding,
family: \f@family,
series: \f@series,
shape: \f@shape,
size: \f@size
}
```
But the family provided by `\f@family` didn't correspond to the family I specified when I set it up, e.g., instead of "Source Sans Pro" it would give me "SoureSansPro(1)". I've tried to address this by learning a little `expl3`, but I'm stuck. The MWE below defines a macro `\decamelize` that grabs the initial letters of an argument and inserts a space in between each lowerUPPER letter pair. It works fine on ordinary text, but fails when I use it on `\f@family`.
I'm very new at `expl3`. Among the many things I don't understand in this is that I need to use `\expandafter` for the MWE to run to completion, but even then it doesn't work the same way it does on ordinary text as input.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{xparse}
\setmainfont{Source Sans Pro}
\ExplSyntaxOn
%% a function to change FooBarBaz10 into 'Foo Bar Baz'
\NewDocumentCommand{\decamelize}{m}
{
\gtk_camel:n { #1 }
}
\cs_new:Nn \gtk_camel:n {
% clear result queue
\seq_clear:N \l_tmpa_seq
% get the opening letters of the text
\regex_extract_all:nnN { ^ [a-zA-Z]+ } { #1 } \l_tmpa_seq
\seq_get_left:NN \l_tmpa_seq \l_my_tl
% Insert a space into every lowercaseUPPERCASE character pair
\regex_replace_all:nnN { ([a-z])([A-Z]) } { \1 \~ \2 } \l_my_tl
\l_my_tl
}
\ExplSyntaxOff
%Now adjust \showfont to include the multi-word families
\makeatletter
\newcommand{\showfont}{
encoding: \f@encoding,
family: \expandafter\decamelize\f@family,
series: \f@series,
shape: \f@shape,
size: \f@size
}
\makeatother
\begin{document}
% This works, gives 'Source Sans Pro'
%\decamelize{SourceSansPro(10)}
%this does not work when \f@family is provided
\showfont Aa
\end{document}
```
|
https://tex.stackexchange.com/users/14432
|
Expanding CamelCase for readability using fontspec information
| false |
Use this:
```
family: \expandafter\decamelize\expandafter{\f@family},
```
First, two `\expandafter`s are processed with the result `\decamelize{SourceSansPro(0)}`, then your `\decamelize` macro is processed.
|
6
|
https://tex.stackexchange.com/users/51799
|
692565
| 321,276 |
https://tex.stackexchange.com/questions/3782
|
345
|
I am having the following equation:
```
\begin{equation}
Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P(O \mid \lambda ) \sum_s \sum_m \sum_t \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left( \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t - \hat{\mu}_m^{(s)}\right) \right)
\end{equation}
```
which does not very well fit on one line. How can I split this over two lines? What I have in mind is that I specify the splitting place, and that the first line is left aligned and the second line right aligned to make clear that it is still the same equation.
The linebreak `\\` does not work.
|
https://tex.stackexchange.com/users/459
|
How can I split an equation over two (or more) lines
| false |
I'm not an expert in LaTeX, but I get nice results using equation\* in each line and equation in the last one. For example:
```
\begin{equation*}
\Delta H_{f_{comb}} + \Delta H_{T_0 \rightarrow T_1}^{aire} + \Delta H_{T_0 \rightarrow T_1}^{comb} = \sum_i{\left[h_{f}^{comb_i} + \int_{T_0}^{T_1}{C_{p}^{comb_i}(T)\cdot dT} + \right.}
\end{equation*}
\begin{equation}
+ \left.\left(\int_{T_0}^{T_1}{\left[C_{p}^{O_{2}}(T)+C_{p}^{N_{2}}(T)\cdot\frac{78}{21}+C_{p}^{Ar}(T)\cdot\frac{1}{21}\right]\cdot dT}\right)\cdot \left(x_i + \frac{y_i}{4}\right)\cdot (1+p_{extra})\right]\cdot n_{comb_i}
\end{equation}
```
Which gives me the following
You can then align the equations as you like.
And also, if you have any \left or \right brackets or parenthesis you can just close them or open them using \left. or \right.
Maybe this is way too complicated and there may be easier workarounds, but it works for me.
|
1
|
https://tex.stackexchange.com/users/301753
|
692567
| 321,277 |
https://tex.stackexchange.com/questions/692564
|
4
|
I like to include font information in a colophon in some documents, and I'd like it to be automatic. I started by using the `\showfont` command that is used in various questions on this board, to wit:
```
\newcommand{\showfont}{
encoding: \f@encoding,
family: \f@family,
series: \f@series,
shape: \f@shape,
size: \f@size
}
```
But the family provided by `\f@family` didn't correspond to the family I specified when I set it up, e.g., instead of "Source Sans Pro" it would give me "SoureSansPro(1)". I've tried to address this by learning a little `expl3`, but I'm stuck. The MWE below defines a macro `\decamelize` that grabs the initial letters of an argument and inserts a space in between each lowerUPPER letter pair. It works fine on ordinary text, but fails when I use it on `\f@family`.
I'm very new at `expl3`. Among the many things I don't understand in this is that I need to use `\expandafter` for the MWE to run to completion, but even then it doesn't work the same way it does on ordinary text as input.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{xparse}
\setmainfont{Source Sans Pro}
\ExplSyntaxOn
%% a function to change FooBarBaz10 into 'Foo Bar Baz'
\NewDocumentCommand{\decamelize}{m}
{
\gtk_camel:n { #1 }
}
\cs_new:Nn \gtk_camel:n {
% clear result queue
\seq_clear:N \l_tmpa_seq
% get the opening letters of the text
\regex_extract_all:nnN { ^ [a-zA-Z]+ } { #1 } \l_tmpa_seq
\seq_get_left:NN \l_tmpa_seq \l_my_tl
% Insert a space into every lowercaseUPPERCASE character pair
\regex_replace_all:nnN { ([a-z])([A-Z]) } { \1 \~ \2 } \l_my_tl
\l_my_tl
}
\ExplSyntaxOff
%Now adjust \showfont to include the multi-word families
\makeatletter
\newcommand{\showfont}{
encoding: \f@encoding,
family: \expandafter\decamelize\f@family,
series: \f@series,
shape: \f@shape,
size: \f@size
}
\makeatother
\begin{document}
% This works, gives 'Source Sans Pro'
%\decamelize{SourceSansPro(10)}
%this does not work when \f@family is provided
\showfont Aa
\end{document}
```
|
https://tex.stackexchange.com/users/14432
|
Expanding CamelCase for readability using fontspec information
| true |
The macros `\f@encoding`, `\f@family` and so on can be considered as token list variables.
What you need then is to apply the “decamelizing” process to the contents of a token list variable. So the idea is to do
```
\cs_new_protected:Nn \gtk_decamelize:n { ... }
\cs_generate_variant:Nn \gtk_decamelize:n { V }
```
so to be able to call
```
\gtk_decamelize:V \f@family
```
But this would require `\makeatletter`, so there's another handy variant available:
```
\cs_generate_variant:Nn \gtk_decamelize:n { v }
```
whereby you can call
```
\gtk_decamelize:v { f@family }
```
Note that your “decamelizing” function should be protected, because `\regex_...` commands aren't expandable. There's no need to split the token list: you can easily remove any `(<digits>)` trailing part.
```
\documentclass{article}
\usepackage{fontspec}
%\usepackage{xparse}% no longer needed
\setmainfont{Source Sans Pro}
\ExplSyntaxOn
\NewDocumentCommand{\showfont}{}
{
encoding:~\tl_use:c { f@encoding },~
family:~\gtk_decamelize:v { f@family },~
series:~\tl_use:c { f@series },~
shape:~\tl_use:c { f@shape },~
size:~\tl_use:c { f@size }
}
\cs_new_protected:Nn \gtk_decamelize:n
{
\tl_set:Nn \l_tmpa_tl { #1 }
% Remove (<digits>) at the end
\regex_replace_once:nnN { \([0-9]*\) \Z } { } \l_tmpa_tl
% Insert a space into every lowercaseUPPERCASE character pair
\regex_replace_all:nnN { ([a-z])([A-Z]) } { \1 \~ \2 } \l_tmpa_tl
\tl_use:N \l_tmpa_tl
}
\cs_generate_variant:Nn \gtk_decamelize:n { v }
\ExplSyntaxOff
\begin{document}
\showfont
\end{document}
```
This isn't foolproof, though: for instance, DejaVu fonts don't have a space before ‘Vu’.
|
2
|
https://tex.stackexchange.com/users/4427
|
692569
| 321,278 |
https://tex.stackexchange.com/questions/692564
|
4
|
I like to include font information in a colophon in some documents, and I'd like it to be automatic. I started by using the `\showfont` command that is used in various questions on this board, to wit:
```
\newcommand{\showfont}{
encoding: \f@encoding,
family: \f@family,
series: \f@series,
shape: \f@shape,
size: \f@size
}
```
But the family provided by `\f@family` didn't correspond to the family I specified when I set it up, e.g., instead of "Source Sans Pro" it would give me "SoureSansPro(1)". I've tried to address this by learning a little `expl3`, but I'm stuck. The MWE below defines a macro `\decamelize` that grabs the initial letters of an argument and inserts a space in between each lowerUPPER letter pair. It works fine on ordinary text, but fails when I use it on `\f@family`.
I'm very new at `expl3`. Among the many things I don't understand in this is that I need to use `\expandafter` for the MWE to run to completion, but even then it doesn't work the same way it does on ordinary text as input.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{xparse}
\setmainfont{Source Sans Pro}
\ExplSyntaxOn
%% a function to change FooBarBaz10 into 'Foo Bar Baz'
\NewDocumentCommand{\decamelize}{m}
{
\gtk_camel:n { #1 }
}
\cs_new:Nn \gtk_camel:n {
% clear result queue
\seq_clear:N \l_tmpa_seq
% get the opening letters of the text
\regex_extract_all:nnN { ^ [a-zA-Z]+ } { #1 } \l_tmpa_seq
\seq_get_left:NN \l_tmpa_seq \l_my_tl
% Insert a space into every lowercaseUPPERCASE character pair
\regex_replace_all:nnN { ([a-z])([A-Z]) } { \1 \~ \2 } \l_my_tl
\l_my_tl
}
\ExplSyntaxOff
%Now adjust \showfont to include the multi-word families
\makeatletter
\newcommand{\showfont}{
encoding: \f@encoding,
family: \expandafter\decamelize\f@family,
series: \f@series,
shape: \f@shape,
size: \f@size
}
\makeatother
\begin{document}
% This works, gives 'Source Sans Pro'
%\decamelize{SourceSansPro(10)}
%this does not work when \f@family is provided
\showfont Aa
\end{document}
```
|
https://tex.stackexchange.com/users/14432
|
Expanding CamelCase for readability using fontspec information
| false |
If you pass the whole family token to your camel case function
```
family: \decamelize\f@family,
```
You can arrange to expand the argument before the regex so
```
\regex_extract_all:neN { ^ [a-zA-Z]+ } { #1 } \l_tmpa_seq
```
instead of `\regex_extract_all:nnN`
That variant isn't pre-declared so you also need
```
\cs_generate_variant:Nn \regex_extract_all:nnN {ne}
```
|
2
|
https://tex.stackexchange.com/users/1090
|
692570
| 321,279 |
https://tex.stackexchange.com/questions/692562
|
0
|
In the following code, I have two documents sharing the same input file (myeq.tex), which has a labeled equation. In Document 1, the equation would be referred to as equation 1 since it is the first occurrence of that equation in Document 1. In Document 2, however, it will be equation (2).
How can I force Document 2 to see it from Document 1s perspective (i.e. equation 1 instead of 2)?
myeq.tex:
```
\begin{equation}
\label{eq1}
x + y = z
\end{equation}
```
Document 1:
```
\documentclass[12pt]{article}
\usepackage{amsmath,amsfonts}
\begin{document}
\input{myeq.tex}
This equation \eqref{eq1}.
\end{document}
```
Document 2:
```
\documentclass[12pt]{article}
\usepackage{amsmath,graphicx,latexsym,amssymb,exscale,relsize,caption,subfig,textcomp,tikz,stackrel,setspace,float}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[]{document1.tex}
\begin{document}
\begin{equation}
x + y = z
\end{equation}
\input{myeq.tex}
This equation \eqref{eq1}.
\end{document}
```
Thanks a lot
|
https://tex.stackexchange.com/users/301749
|
eqref from another documents perspective
| true |
some comments added inline:
---
```
\begin{equation}
\label{eq1}% bad style to use numbers in labels
x + y = z
\end{equation}
```
---
```
\documentclass[12pt]{article}
\usepackage{amsmath,amsfonts}
\begin{document}
\input{myeq.tex}
This equation \eqref{eq1}.
\end{document}
```
---
```
\documentclass[12pt]{article}
\usepackage{amsmath,graphicx,latexsym,amssymb,exscale,relsize,caption,subfig,textcomp,tikz,stackrel,setspace,float}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[d1:]{document1}% no .tex extension
\begin{document}
\begin{equation}
x + y = z
\end{equation}
\input{myeq.tex}
This equation \eqref{eq1} which is a copy of \eqref{d1:eq1} from document1.
\end{document}
```
---
|
2
|
https://tex.stackexchange.com/users/1090
|
692571
| 321,280 |
https://tex.stackexchange.com/questions/692574
|
0
|
Look at this code:
```
% Preview source code
%% LyX 2.3.6 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,14pt]{extarticle}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Times New Roman}
\setsansfont[Mapping=tex-text]{Times New Roman}
\setmonofont{Anonymous Pro}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2.5cm,rmargin=1cm,headheight=1cm,headsep=0.5cm,footskip=1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{-2}
\setlength{\parindent}{1.27cm}
\usepackage[xetex]{color}
\definecolor{shadecolor}{rgb}{0, 1, 1}
\usepackage{framed}
\usepackage{enumitem}
\usepackage{setspace}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}
\onehalfspacing
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=false]
{hyperref}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newlength{\lyxlabelwidth} % auxiliary length
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{ragged2e}
\usepackage{indentfirst}
\PassOptionsToPackage{no-math}{fontspec}
\usepackage{mathspec}
\usepackage{titlesec}
\AtBeginDocument{
\setlist[enumerate]{
left=\parindent,
itemindent=2cm,
noitemsep
}
\setlist[itemize]{
left=\parindent,
itemindent=2cm,
noitemsep,
label=\symbol{"2500}
}
}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\newcounter{subsectioncnt}
\newlength\sectionskip
\setlength{\sectionskip}{\baselineskip}
\addtolength{\sectionskip}{7pt}
\titleformat
{\subsection}
[block]
{\normalsize\bfseries\center}
{}
{0pt}{
\stepcounter{subsectioncnt}
1.\arabic{subsectioncnt}.\hspace{0.5em}
}[]
\titlespacing*{\subsection}{0pt}
{\sectionskip}
{\sectionskip}
\titleformat
{\section}
[block]
{\normalsize\bfseries\center}
{}
{0em}{}[]
\titlespacing*{\section}{0pt}
{\sectionskip}
{\sectionskip}
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\begin{document}
\setcounter{page}{0}
\lhead{}
\chead{}
\rhead{}
\cfoot{\uline{Placeholder}}
\renewcommand{\headrulewidth}{0pt}
\begin{Center}\begin{singlespace}
\noindent\begin{minipage}[t]{1\columnwidth}%
\begin{shaded}%
place
holder\end{shaded}%
\end{minipage}
Placeholder
Placeholder
Placeholder
Placeholder
\end{singlespace}\vspace{4\baselineskip}
Placeholder
Placeholder
Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder
Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder
Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder
Placeholder Placeholder Placeholder Placeholder
Placeholder
\vspace{6\baselineskip}
\end{Center}\begin{FlushRight}
Placeholder
Placeholder
Placeholder
\vspace{\baselineskip}
Placeholder
Placeholder
\end{FlushRight}\pagebreak{}
\setcounter{page}{1}
\cfoot{\thepage}
\section{Behold the list items}
\subsection{Enumerated ones}
\begin{enumerate}
\item A list item.
\item Another list item.
\end{enumerate}
\subsection{Itemized ones}
\begin{itemize}
\item A bit more of list items
\item More of them
\end{itemize}
\section{Behold the end of the document}
The end.
\pagebreak{}
\tableofcontents{}
\end{document}
```
If you click on the first entry in ToC, it will send you to the title page, instead of the actual section. Why does it happen and how can I fix that?
If it matters I am just trying on LyX/XeLaTeX combination to see if I can get required result within reasonable time/effort. This said, I am not very enthusiastic about @ stuff.
|
https://tex.stackexchange.com/users/296156
|
First ToC entry points to wrong place
| true |
Remember that with very few examples `hyperref` should be loaded as the last package. Especially after `titlesec`.
Making sure `hyperref` is the last package loaded solves the problem for me, the `Behold the list items` title in the toc jumps to the correct page.
|
1
|
https://tex.stackexchange.com/users/3929
|
692575
| 321,282 |
https://tex.stackexchange.com/questions/671031
|
2
|
I am confronted to a long-proof problem like in [this question](https://tex.stackexchange.com/questions/66532/proofs-in-beamer), which entails breaking a block between two frames, and also to the problem that I am creating an article and I do not want the proof environment to be broken there, like in [that closed question](https://tex.stackexchange.com/questions/153395/).
How can I combine both ideas ?
|
https://tex.stackexchange.com/users/103608
|
Break block between two frames in presentation but not in article mode
| false |
Beamer blocks are -- by default -- not breakable. However you can replace them by breakable tcolorboxes and use `\framebreak` to break your block as you like.
The `\framebreak` macro is defined to only act in presentation mode, thus it won't interfere with your article.
```
\documentclass{article}
\makeatletter
\@ifclassloaded{beamer}{\usecolortheme{orchid}}{\usepackage{beamerarticle}}
\makeatother
\usepackage{lipsum}
\usepackage[most]{tcolorbox}
\useinnertheme{tcolorbox}
\tcbset{breakable,title after break=\insertblocktitle}
\begin{document}
\begin{frame}[allowframebreaks]
\begin{proof}
\lipsum[1]
\framebreak
\lipsum[1]
\end{proof}
\end{frame}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/36296
|
692584
| 321,285 |
https://tex.stackexchange.com/questions/692587
|
7
|
I don't need the documentation for every single package that I have installed (it would take several GB on my disk for no reason). However, I'd like to download the documentation for a small number of packages that I frequently need to look up. I'd like to be able to just run `texdoc` and see the documentation, rather than needing to look up the correct file on CTAN or texdoc.org.
I know that it's possibly to enable installation of documentation globally by running `tlmgr option docfiles 1`. Can I ask `tlmgr` to only install documentation for certain packages that I list?
Bonus question: if it's possible to do the same thing for sources, I'd be happy to hear about it. I imagine that if one is possible, the solution for the other shouldn't be too different. If not, ignore this.
|
https://tex.stackexchange.com/users/14965
|
Installing documentation only for certain packages
| true |
Quickly looking at the manual for `tlmgr` (`tlmgr help`) it lists
```
install [option...] pkg...
Install each pkg given on the command line, if it is not already
installed. It does not touch existing packages; see the "update" action
for how to get the latest version of a package.
By default this also installs all packages on which the given pkgs are
dependent. Options:
--dry-run
Nothing is actually installed; instead, the actions to be performed
are written to the terminal.
--file
Instead of fetching a package from the installation repository, use
the package files given on the command line. These files must be
standard TeX Live package files (with contained tlpobj file).
--force
If updates to "tlmgr" itself (or other parts of the basic
infrastructure) are present, "tlmgr" will bail out and not perform the
installation unless this option is given. Not recommended.
--no-depends
Do not install dependencies. (By default, installing a package ensures
that all dependencies of this package are fulfilled.)
--no-depends-at-all
Normally, when you install a package which ships binary files the
respective binary package will also be installed. That is, for a
package "foo", the package "foo.i386-linux" will also be installed on
an "i386-linux" system. This option suppresses this behavior, and also
implies "--no-depends". Don't use it unless you are sure of what you
are doing.
--reinstall
Reinstall a package (including dependencies for collections) even if
it already seems to be installed (i.e, is present in the TLPDB). This
is useful to recover from accidental removal of files in the
hierarchy.
When re-installing, only dependencies on normal packages are followed
(i.e., not those of category Scheme or Collection).
--with-doc
--with-src
While not recommended, the "install-tl" program provides an option to
omit installation of all documentation and/or source files. (By
default, everything is installed.) After such an installation, you may
find that you want the documentation or source files for a given
package after all. You can get them by using these options in
conjunction with "--reinstall", as in (using the "fontspec" package as
the example):
tlmgr install --reinstall --with-doc --with-src fontspec
```
Thus if you have an installation without doc and src you can install it for a single package via
```
tlmgr install --reinstall --with-doc --with-src packagename
```
(my home PC has limited space, so I do the same if needed)
|
9
|
https://tex.stackexchange.com/users/3929
|
692589
| 321,287 |
https://tex.stackexchange.com/questions/692581
|
4
|
Every computer program evaluating anything has to distinguish between variables and procedures. This is a typical example from SICP:
```
(define (eval exp env)
(cond ((self-evaluating? exp) exp)
((variable? exp) (lookup-variable-value exp env))
((quoted? exp) (text-of-quotation exp))
((assignment? exp) (eval-assignment exp env))
((definition? exp) (eval-definition exp env))
((if? exp) (eval-if exp env))
((lambda? exp) (make-procedure (lambda-parameters exp)
(lambda-body exp)
env))
((begin? exp)
(eval-sequence (begin-actions exp) env))
((cond? exp) (eval (cond->if exp) env))
((application? exp)
(apply (eval (operator exp) env)
(list-of-values (operands exp) env)))
(else
(error "Unknown expression type: EVAL" exp))))
```
If the expression is a variable it is looked up in the environment. And if the expression is an application it gets executed.
In TeX the following seems to assign a value to a variable:
```
\magnification=1200
```
But this is called a control sequence:
```
\input MS
```
It seems to me that a control sequence (an application) looks the same as a variable. How is it possible that the the evaluator in TeX can distinguish them? Is it because `\magnification` is not a variable but a accessor-function returning the value of the variable?
|
https://tex.stackexchange.com/users/175011
|
How does TeX distinguish between variables and procedures?
| false |
In TeX, `\magnification` refers to the internal integer register `\mag`. You can use the value when TeX is looking for an integer, for instance
```
\count255=\mag
```
will store in the integer register `\count255` the current value of `\mag`.
The TeXbook would call `\mag` a “parameter”, but I believe that using “register” is clearer.
If TeX is *not* looking for an integer, then `\mag` will trigger the lookup, so that eventually TeX will store an integer in the register, so upon finding
```
\mag=1200
```
the stated value will be stored in the register. Actually, plain TeX provides `\magnification` that uses a similar syntax, but does more than setting `\mag`.
The same is true for every register: when TeX is looking for a <dimen>, say when you want to do `\kern`, you can type
```
\kern 1in
```
or
```
\kern \parindent
```
There's no distinction between variables and “procedures” in TeX. As shown before, register names can be used when a value is needed or they are the trigger for assigning a value, depending on the context.
Macro packages, for instance LaTeX, try to better separate the two aspects, so you say
```
\setlength{\parindent}{15pt}
```
instead of `\parindent=15pt` (or the more cryptic, but equally valid `\parindent15pt`). Or you can say
```
\setlength{\parindent}{2\parindent}
```
if you want to double the currently stored value for the parameter, but this is a particular programming style that cannot be enforced: if a user types in
```
\parindent=2\parindent
```
the effect is the same.
Conversely, `\input` is a primitive that triggers reading a file in order to feed the input token stream. Other primitives do other tasks. Sometimes it's a typesetting task, sometimes not.
Comparing TeX to other programming languages is a dead-end, I'm afraid.
|
8
|
https://tex.stackexchange.com/users/4427
|
692593
| 321,289 |
https://tex.stackexchange.com/questions/692576
|
3
|
I want to define an environment, that uses `\vskip` to put some space before and after. Usually it will be used in the normal text, but sometimes I want to push to the bottom of a page with `\vfill`. When the environment is placed at the bottom of a page due to the current text on a page without `\vfill` the `\vskip` afterwards is ignored - but not when using `\vfill`.
Is there a way to get the same behaviour in both cases (ignoring the `\vskip`)?
Even without an environment this happens as the following MWE shows.
```
\documentclass{article}
\begin{document}
test
\vfill % \vskip\baselineskip is added and causes a blank line at the bottom of the page
% without that \vfill no space (glue) is inserted at the end (see below)
test
\vskip\baselineskip
\end{document}
```
After a little search on this side I found the command `\showoutput` to see what's going on in the document. I tried to find out what is the reason for that difference and achieve what I want ... without any success. Here's the relevant part (I think) of `\showoutput` for that example. The difference is just a single line with or without `\vfill`.
```
...\hbox(6.15+0.11)x345.0, glue set 313.84fil, direction TLT
....\localpar
.....\localinterlinepenalty=0
.....\localbrokenpenalty=0
.....\localleftbox=null
.....\localrightbox=null
....\hbox(0.0+0.0)x15.0, direction TLT
....\TU/lmr/m/n/10 t
....\TU/lmr/m/n/10 e
....\TU/lmr/m/n/10 s
....\TU/lmr/m/n/10 t
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue 0.0 plus 1.0fill % That's the \vfill I guess
...\glue(\parskip) 0.0 plus 1.0
...\glue(\parskip) 0.0
...\glue(\baselineskip) 5.74
...\hbox(6.15+0.11)x345.0, glue set 313.84fil, direction TLT
....\localpar
.....\localinterlinepenalty=0
.....\localbrokenpenalty=0
.....\localleftbox=null
.....\localrightbox=null
....\hbox(0.0+0.0)x15.0, direction TLT
....\TU/lmr/m/n/10 t
....\TU/lmr/m/n/10 e
....\TU/lmr/m/n/10 s
....\TU/lmr/m/n/10 t
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue 12.0 % That's the \vskip I guess (it disappears without the \vfill)
...\glue -0.11
...\glue 0.0 plus 1.0fil
...\glue 0.0
...\glue 0.0 plus 0.0001fil
```
By the way, the same happens for `\vspace` or `\addvspace` instead of `\vskip`.
|
https://tex.stackexchange.com/users/287561
|
Combining \vfill and \vskip at end of page results in blank line(s)
| false |
I believe you should define two related environments: `foo` for normal appearance in the text block and `foo*` to move it at the bottom of the page.
```
\documentclass{article}
\usepackage[a6paper,showframe]{geometry}
\usepackage{lipsum}
\newenvironment{foo}{%
\par\addvspace{\baselineskip}\startfoo
}{%
\par\addvspace{\baselineskip}%
}
\newenvironment{foo*}{%
\par\vfill\startfoo
}{%
\par
}
\newcommand{\startfoo}{\noindent\textbf{Foo.}\ \ignorespaces}
\begin{document}
\lipsum[1][1-5]
\begin{foo}
\lipsum[2][1-3]
\end{foo}
\lipsum[3][1-5]
\clearpage
\lipsum[1][1-5]
\begin{foo*}
\lipsum[2][1-3]
\end{foo*}
\end{document}
```
The packages I loaded in the preamble are just to produce a smaller picture showing the page margins. I provided a mock definition of the environment.
|
1
|
https://tex.stackexchange.com/users/4427
|
692596
| 321,292 |
https://tex.stackexchange.com/questions/692563
|
1
|
I would like to achieve a macro which makes a 2x2 table to show example inputs and outputs of a program (test cases). Something like this:
```
---------------------------
|input | example input |
|--------------------------
|output | example output|
---------------------------
```
"input" and "output" are always the same and just plain text, no problem with that. However, the example input and the example output may have multiple lines and spaces, and I would like to have the font \texttt gives. Naturally my mind went to verbatim environment, and I managed to make it work like this (inspired from other StackExchange posts):
```
\begin{tabular}{ |l|l| }
\hline
Input &
\begin{minipage}{3in}
\begin{verbatim}
5
1 2 3 4 5
3
\end{verbatim}
\end{minipage}
\\
\hline
Output &
\begin{minipage}{3in}
\begin{verbatim}
PRESENT
\end{verbatim}
\end{minipage}
\\
\hline
\end{tabular}
```
However, I am unable to put this into a \newcommand, to avoid code repetition. This code:
```
\newcommand\example[2]{
\begin{tabular}{ |l|l| }
\hline
sample &
\begin{minipage}{3in}
\begin{verbatim}
{#1}
\end{verbatim}
\end{minipage}
\\
\hline
sample &
\begin{minipage}{3in}
\begin{verbatim}
{#2}
\end{verbatim}
\end{minipage}
\\
\hline
\end{tabular}
}
```
with a call to the macro (`\example{1}{2}`) gives a bunch of errors (*Runaway argument?*, *Missing \endgroup inserted.*, *Missing } inserted.*, *Extra alignment tab has been changed to \cr.*).
Aside of the fact that it feels like a trivial thing to do and I cannot make it work, it also feels like too many workarounds are going on, and the result looks unappealing. I am open to completely different approaches as long as it uses a humble amount of libraries, since I would like to get used to the basic functionalities of laTeX before exploring exotic packages.
Thank you!
|
https://tex.stackexchange.com/users/301747
|
Verbatim inside tabular, inside a macro
| false |
As long as you don't try s.th. like
```
\Example{...\end{verbatim}...}{...}
```
or
```
\Example{...}{...\end{verbatim}...}
```
, nesting verbatim (+v-type)-arguments inside `\scantokens`, as done in the example below, might do the trick.
Another important restriction with the example below is that `\Example` cannot be used successfully when being delivered as replacement-text of other macros or when coming from the arguments of other macros.
A more general statement, also covering these two cases is:
`\Example` cannot be used successfully in situations where the tokens forming its arguments did not come into being due to reading/tokenizing .tex-input during carrying out `\Example` and hereby having temporary category-code-settings introduced by `\Example` in effect, but are passed on to `\Example` in the course of expansion of other things/macros.
E.g.,
```
\newcommand\macro[1]{#1}...\macro{...\Example{arg 1}{arg 2}...}
```
won't work out.
```
\newcommand\macro{...\Example{arg 1}{arg 2}...}...\macro
```
won't work out either.
Here is the code:
```
\documentclass{article}
\usepackage{etoolbox}
\begingroup
\NewDocumentCommand\Example{+v+v}{%
\endgroup
\NewDocumentCommand\Example{+v+v}{%
\begin{tabular}{|l|l|}%
\hline
Input&%
\begin{minipage}[t]{3in}%
\begingroup
\newlinechar=\endlinechar
\scantokens{#1##1#2}%
\vskip\dp\strutbox
\hrule height 0cm width 0cm %
\end{minipage}%
\\%
\hline
Output&%
\begin{minipage}[t]{3in}%
\begingroup
\newlinechar=\endlinechar
\scantokens{#1##2#2}%
\vskip\dp\strutbox
\hrule height 0cm width 0cm %
\end{minipage}%
\\%
\hline
\end{tabular}%
}%
}%
\newlinechar=\endlinechar
\Example{\endgroup
\expandafter\preto\expandafter{\csname @verbatim\endcsname}{\topsep=0pt \partopsep=0pt }%
\begin{verbatim}
}{
\end{verbatim}
%}%
% \expandafter\show\csname Example code\endcsname
\begin{document}
\noindent
\Example{5
1 2 3 4 5
3}{PRESENT}
\bigskip\noindent\hrule\bigskip
\noindent
\Example{e
a b c d e
c}{PRESENT, TOO}
\end{document}
```
If in the .tex-source-code/the .tex-input-file code denoting arguments of `\Example` is broken across lines, then indentation of these lines does matter.
Treatment of the horizontal-tab-character is as weird as usual with LaTeX's verbatim-mode.
|
0
|
https://tex.stackexchange.com/users/118714
|
692597
| 321,293 |
https://tex.stackexchange.com/questions/692598
|
2
|
I am writing a simple command to automatically find the average of a given list of values. I created `\findAverageFunction` to take care of all of the logic (copied from [here](https://tex.stackexchange.com/a/425066/167081)). The issue is that I am not able to get the result that is calculated to be stored in a variable using
`\fp_set:Nx \l_total_fp{\findAverageFunction:nn{#1}{#2}}`. I kindly ask what is the issue here and what is the possible fix for it. Thank you!!
```
\documentclass{article}
\ExplSyntaxOn
\cs_generate_variant:Nn \fp_set:Nn { Nx }
\cs_new:Nn \findAverageFunction:nn {% #1=rounding precision, #2=list of values
\clist_set:Nx \l_tmpa_clist {#2}
\fp_zero:N \l_tmpa_fp
\clist_map_inline:Nn \l_tmpa_clist {
\fp_add:Nn \l_tmpa_fp {##1}
}
\fp_eval:n {round(\l_tmpa_fp/\clist_count:N \l_tmpa_clist, #1)}
}
\fp_new:N \l_total_fp % Declare a new float-point variable
\NewExpandableDocumentCommand{\myData}{O{10}m}{
\findAverageFunction:nn{#1}{#2}
% NOT WORKING:
%\fp_set:Nx \l_total_fp{\findAverageFunction:nn{#1}{#2}}
}
\ExplSyntaxOff
\begin{document}
\myData{1,2,3,4,5,6, 99}
\end{document}
```
|
https://tex.stackexchange.com/users/167081
|
Retrieving the value of \cs_new:Nn
| true |
You can find your average by using expansion only and use a different command for storing the result in a variable.
With the \*-version you input a macro expanding to a list.
```
\documentclass{article}
\ExplSyntaxOn
\NewExpandableDocumentCommand{\findAverage}{sO{10}m}
{
\IfBooleanTF { #1 } { \jumaily_average:nV { #2 } #3 } { \jumaily_average:nn { #2 } { #3 } }
}
\cs_new:Nn \jumaily_average:nn
{
\fp_eval:n
{
round( ( \clist_use:nn { #2 } { + } ) / ( \clist_count:n { #2 } ), #1 )
}
}
\cs_generate_variant:Nn \jumaily_average:nn { nV }
\NewDocumentCommand{\definevar}{mm}
{
\fp_zero_new:c { l_jumaily_var_#1_fp }
\fp_set:cn { l_jumaily_var_#1_fp } { #2 }
}
\NewDocumentCommand{\usevar}{m}
{
\fp_use:c { l_jumaily_var_#1_fp }
}
\ExplSyntaxOff
\begin{document}
\newcommand{\myData}{1,2,3,4,5,6, 99}
\findAverage{1,1}
\findAverage{1,2,4}
\findAverage[3]{1,2,4}
\findAverage{1,2,3,4,5,6, 99}
\findAverage*{\myData}
\definevar{test1}{\findAverage{1,2,3,4,5,6, 99}}
\usevar{test1}
\definevar{test2}{\findAverage*{\myData}}
\usevar{test2}
\end{document}
```
Note that `\definevar` can be used with any fp-expression.
|
2
|
https://tex.stackexchange.com/users/4427
|
692603
| 321,296 |
https://tex.stackexchange.com/questions/47595
|
8
|
I'm trying to create a matrix using nested `\foreach` loops. I tried following the example I found in a [previous question](https://tex.stackexchange.com/a/22276/5109), but I keep getting errors.
Here is the code I tried to run:
```
\documentclass{article}
\usepackage{etoolbox}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\let\mymatrixcontent\empty
\newcommand{\row}[1]{
\foreach \i in {0,...,5} {
\xappto\mymatrixcontent{\expandonce{
\node {\i}; &
}}
}
\xappto\mymatrixcontent{\\}
}
\row{1}
\begin{tikzpicture}
\matrix[matrix of nodes]{
\mymatrixcontent
};
\end{tikzpicture}
\end{document}
```
I'm getting an error:
```
! Undefined control sequence.
\\ ->\let \reserved@e
\relax \let \reserved@f \relax \@ifstar {\let \reserv...
l.16 \row{1}
```
I noticed that this error occurs only after adding the new row after the `\foreach` loop. Is there a way to avoid it?
**EDIT**: I completed the example.
|
https://tex.stackexchange.com/users/5109
|
Nested foreach inside a TikZ matrix for both rows and columns
| false |
No expansion, no global assignments, no extra packages, no extra column, no ampersand shortcut, just two `\foreach` loops.
However, the `|…|` syntax of the `matrix` library can't be included anymore.
But when you generate the cells you can just use `\node[…]{…};` directly (or use the various `row …`/`column …`/`row … column …` styles to change the style of rows, columns or cells.
In your case, just use `create matrix={1}{1, ..., 5}` and `set matrix macro=#2`. Which will create `1` row with five columns `1`, `2`, …, `5` but just putting the column numbers in the nodes.
Code
----
```
\documentclass[tikz]{standalone}
\tikzset{
% \protected because \pgfmatrixnextcell and \pgfmatrixendrow expand
% → can't use |…| shortcut, though
matrix node/.style 2 args={
name=\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn,
alias={\tikzmatrixname'-#1-#2}},
set matrix macro/.code=
\protected\def\tikzmatrixcell##1##2{\node[matrix node={##1}{##2}]{#1};},
set matrix macro'/.code=\protected\def\tikzmatrixcell##1##2{#1},
set matrix macro=r#1\,c#2,
create matrix/.style 2 args={
/tikz/matrix/content/.initial=,
/tikz/matrix/create rows/.style={
/tikz/matrix/reset create cell,
/tikz/matrix/create columns/.style={
/tikz/matrix/create cell={##1}{####1}},
/tikz/matrix/create columns/.list={#2},
/tikz/matrix/content/.append=\pgfmatrixendrow},
/tikz/matrix/create rows/.list={#1},
/tikz/node contents=\pgfkeysvalueof{/tikz/matrix/content}},
matrix/reset create cell/.style={
/tikz/matrix/create cell/.style 2 args={
/tikz/matrix/content/.append=\tikzmatrixcell{##1}{##2},
/tikz/matrix/create cell/.style 2 args={
/tikz/matrix/content/.append=
\pgfmatrixnextcell\tikzmatrixcell{####1}{####2}}}}}
\begin{document}
\tikz
\matrix[
draw, column sep=2ex,
set matrix macro=#2, create matrix={1}{1, ..., 5}];
\tikz
\matrix (m) [
draw, column sep=2ex, row sep=1em,
row 1 column 1/.style={set matrix macro=},
column 1/.append style={set matrix macro=row ##1},
row 1/.append style={set matrix macro=column ##2},
set matrix macro=#2#1, % like a spreadsheet
create matrix={0, ..., 8}{0, A, B, ..., E}]
(m'-1-A) edge[out=0, in=180] (m'-4-B);
\end{document}
```
Output
------
|
1
|
https://tex.stackexchange.com/users/16595
|
692610
| 321,299 |
https://tex.stackexchange.com/questions/692609
|
3
|
This might just be me not knowing how to usepackage but `\usepackage[nomath]{stix2}` is (I think) not letting the package work, eg mathbb isn't defined, and `\usepackage[nomath=true]{stix2}` says undefined option. Am I misunderstanding the "Do not change the default math fonts" option? I just want the capital psi to look the same as in usual math mode, and not the stix version.
|
https://tex.stackexchange.com/users/301795
|
Why is nomath option not working with stix2?
| true |
`stix2` options do not take values `[nomath=true]` is incorrect.
`[nomath]` prevents the package loading math fonts, so you get the standard math fonts, so `\mathbb` is undefined unless you load some package such as `amsfonts` that defines it.
You can of course load the original cm font and access its Greek if you wish but I wouldn't advise it, stix and computer modern are not intended to be visually compatible.
```
\documentclass{article}
\usepackage{stix2}
\DeclareSymbolFont{cmoperators} {OT1}{cmr} {m}{n}
\DeclareMathSymbol{\cmGamma}{\mathalpha}{cmoperators}{"00}
\DeclareMathSymbol{\cmDelta}{\mathalpha}{cmoperators}{"01}
\DeclareMathSymbol{\cmTheta}{\mathalpha}{cmoperators}{"02}
\DeclareMathSymbol{\cmLambda}{\mathalpha}{cmoperators}{"03}
\DeclareMathSymbol{\cmXi}{\mathalpha}{cmoperators}{"04}
\DeclareMathSymbol{\cmPi}{\mathalpha}{cmoperators}{"05}
\DeclareMathSymbol{\cmSigma}{\mathalpha}{cmoperators}{"06}
\DeclareMathSymbol{\cmUpsilon}{\mathalpha}{cmoperators}{"07}
\DeclareMathSymbol{\cmPhi}{\mathalpha}{cmoperators}{"08}
\DeclareMathSymbol{\cmPsi}{\mathalpha}{cmoperators}{"09}
\DeclareMathSymbol{\cmOmega}{\mathalpha}{cmoperators}{"0A}
\begin{document}
$ \Phi + \cmPhi + \emptyset + \varnothing + \Psi + \cmPsi $
\end{document}
```
|
7
|
https://tex.stackexchange.com/users/1090
|
692615
| 321,303 |
https://tex.stackexchange.com/questions/692618
|
0
|
I'm trying to check if a parameter is declared/empty using `lua`. So far I wrote the following MWE:
```
\documentclass{standalone}
\def\var#1{\def\@var{#1}}
%\var{Hello world}
\begin{document}
\@var --
\directlua{if string.len("\@var") == 0 then tex.print("empty") else tex.print("not empty") end}
\end{document}
```
If `\var{Hello world}` is uncommented the code runs with no errors, but if it's commented then it always returns error.
Is there a way to make this checking on a parameter/variable with `LuaLaTeX`?
|
https://tex.stackexchange.com/users/48279
|
Check if parameter in command is declared/empty in LuaLaTeX
| false |
Your line
```
\@var --
```
prints var – because the macro `\@` sets the spacefactor and then there are letters `v` `a` `r` and then space and the double `--` which is converted to the ligature `–`.
Your `\directlua` line works like this:
```
\directlua{if string.len("\spacefactor \@m {}var") == 0 then tex.print("empty") else tex.print("not empty") end}
```
because the `\directlua` primitive fully expands its argument before the argument is used.
If you use your macro `\var` (which is unused in your example), then the macro `\@` is redefined as a macro with mandatory separator `var`.
There are three cases described above, I mean that none of these case were your intention.
I can only guess your intend. Maybe, you want to define `\@var` macro when the `\var` macro is used and you want to test if the `\@var` macro is defined. You can't do this test using `\directlua` because you cannot put an undefined macro to the `\directlua` parameter because `\directlua` expands its parameter. You can do:
```
\catcode`\@=11 % `@` is letter
\def\var#1{\def\@var{#1}}
%\var{Hello world} % this defines \@var as a macro with body Hello world.
\ifx\@var\undefined undefined var\else defined var \fi
```
|
4
|
https://tex.stackexchange.com/users/51799
|
692623
| 321,306 |
https://tex.stackexchange.com/questions/692598
|
2
|
I am writing a simple command to automatically find the average of a given list of values. I created `\findAverageFunction` to take care of all of the logic (copied from [here](https://tex.stackexchange.com/a/425066/167081)). The issue is that I am not able to get the result that is calculated to be stored in a variable using
`\fp_set:Nx \l_total_fp{\findAverageFunction:nn{#1}{#2}}`. I kindly ask what is the issue here and what is the possible fix for it. Thank you!!
```
\documentclass{article}
\ExplSyntaxOn
\cs_generate_variant:Nn \fp_set:Nn { Nx }
\cs_new:Nn \findAverageFunction:nn {% #1=rounding precision, #2=list of values
\clist_set:Nx \l_tmpa_clist {#2}
\fp_zero:N \l_tmpa_fp
\clist_map_inline:Nn \l_tmpa_clist {
\fp_add:Nn \l_tmpa_fp {##1}
}
\fp_eval:n {round(\l_tmpa_fp/\clist_count:N \l_tmpa_clist, #1)}
}
\fp_new:N \l_total_fp % Declare a new float-point variable
\NewExpandableDocumentCommand{\myData}{O{10}m}{
\findAverageFunction:nn{#1}{#2}
% NOT WORKING:
%\fp_set:Nx \l_total_fp{\findAverageFunction:nn{#1}{#2}}
}
\ExplSyntaxOff
\begin{document}
\myData{1,2,3,4,5,6, 99}
\end{document}
```
|
https://tex.stackexchange.com/users/167081
|
Retrieving the value of \cs_new:Nn
| false |
Just for comparison, what we can do with OpTeX:
```
\let\ima=\immediateassignment
\def\replcomma#1,{\ifx,#1,\else\ima\incr\tmpnum +#1\ea\replcomma\fi}
\def\findAverage#1{\ima\tmpnum=0 \expr{(0\ea\replcomma#1,,)/\the\tmpnum}}
\findAverage{1,2,4} % prints 2.333
\findAverage{1,2,3,4,5,6, 99} % prints 17.143
\def\mydata{1,2,3,4,5,6, 99}
\findAverage{\mydata} % prints 17.143
\edef\test{\findAverage{1,2,3,4,5,6, 99}}
\test % prints 17.143
\meaning\test % prints macro:->17.143
\bye
```
|
2
|
https://tex.stackexchange.com/users/51799
|
692625
| 321,307 |
https://tex.stackexchange.com/questions/692622
|
0
|
I have already tried `Mendeley` and it is difficult to add a .bib file for every research article and load it. It feels like separate research to me. Either how `Mendeley` works is clearly bad or I am doing something wrong. Is there a way to use the one master bib file from latex in `Mendeley`? It will be of massive help if I can do something similar.
I followed the instructions in the following thread
[LaTeX + Biblatex bibliography to other formats via Pandoc](https://tex.stackexchange.com/questions/174055/latex-biblatex-bibliography-to-other-formats-via-pandoc/692579#692579)
I did try the following commands
```
pandoc --bibliography=foo.bib -o foo.docx foo.tex --citeproc
```
and
```
pandoc --biblatex --bibliography=foo.bib foo.tex -o foo.docx
```
However, it only created a word document with very well crafted texts and headings. It helped me generate a list of headings. But the figures and tables were handled badly. Mainly the bibliography was empty. In fact, the references were left out even inline, meaning `\citep{authoryear}` was **not** recognized. Also, note that my articles contain lot of mathematical fonts and equations. Fewer figures and tables though, as of now. Unfortunately I could not comment on the above post because of low reputation. And also couldn't seek help.
I tried using `Python` for PDF to Word. Lots of issues there again. Is there an easy way to use the full .bib file of LaTeX for MS Word in a more elegant way? Or convert a .tex file to an equivalent Word document?
|
https://tex.stackexchange.com/users/260262
|
Easy way for a bibliography in Word?
| false |
If you want some document in two formats, the rule of thumb is always convert from the simpler to the complex (e.g., markdown to LaTeX), never in the opposite direction, and never ever from a complex format to another complex format. That trip always means pay a high toll.
But with respect to the references of a latex file using biblatex or bibtex this should not be a big problem. Demonstration:
1. Take the `References.bib` example of [this answer](https://tex.stackexchange.com/a/134182/11604) and name it `foo.bib`.
2. Take the last example document of [the same answer](https://tex.stackexchange.com/a/134182/11604) using biblatex and name it `foo.tex`.
3. Run pandoc:
---
```
pandoc -f latex --bibliography=foo.bib -t docx foo.tex -o foo.docx
```
---
Result of `foo.docx` in LibreOffice:
As you can see, the only lost in the docx, with respect the compiled latex version, is the automatic "References" title made with `\printbibliography,` but using:
```
\section*{References}
\printbibliography[heading=none]
```
The title will appear in both formats:
|
2
|
https://tex.stackexchange.com/users/11604
|
692626
| 321,308 |
https://tex.stackexchange.com/questions/692624
|
4
|
I have this `LaTeX` script:
```
\documentclass{revtex4-1}
\title{Title}
\begin{document}
\maketitle
\begin{table}
\caption{
Caption}
\begin{tabular}{cc}
Column 1 & Column 2 \\
\colrule
100\footnote{footnote 1} & 200\footnote{footnote 2} \\
& 300\footnote{footnote 3} \\
\end{tabular}
\end{table}
\end{document}
```
The footnotes are labeled as a, b and c. I would like to use for one of them something different, for example to have them as a, b and \*. How can I do this?
|
https://tex.stackexchange.com/users/142996
|
Change footnotes in a table
| false |
With `{NiceTabular}` of `nicematrix`.
```
\documentclass{revtex4-1}
\usepackage{nicematrix}
\usepackage{enumitem}
\title{Title}
\begin{document}
\maketitle
\begin{table}
\caption{Caption}
\begin{NiceTabular}{cc}
Column 1 & Column 2 \\
\colrule
100\tabularnote[a]{footnote 1} & 200\tabularnote[b]{footnote 2} \\
& 300\tabularnote[*]{footnote 3} \\
\end{NiceTabular}
\end{table}
\end{document}
```
|
3
|
https://tex.stackexchange.com/users/163000
|
692628
| 321,309 |
https://tex.stackexchange.com/questions/692627
|
0
|
I want to create a new environment that takes one of its inputs as a link which might contain a special character and I want it to be escaped without each person manually escaping each character. I couldn't use `verbatim` environment inside my parameters and neither google nor ChatGPT understood/helped with it.
Here is my environment in my cls:
```
\newenvironment{rProjects}[4]{ % 4 input arguments - project title, brief description, project link name, project link
{\bf #1} {#2} % Bold project name then description
\ifthenelse{\equal{#3}{}}{}{
\hfill \href{#3}{#4}
}\smallskip
}{}
```
and here is how I use it in my .tex
```
\begin{rProjects}{Project name}{description}{link with special characters}{link name}
\end{rProjects}
```
|
https://tex.stackexchange.com/users/296109
|
How to escape special characters passed as arguments to new environment?
| true |
you can try the v-type:
```
\documentclass[]{article}
\usepackage{hyperref,ifthen}
\NewDocumentEnvironment{rProjects}{mmvm}{%
\textbf{#1} {#2} % Bold project name then description
\ifthenelse{\equal{#3}{}}{}{
\hfill \href{#3}{#4}
}\smallskip
}{}
\begin{document}
\begin{rProjects}{Project name}{description}{https://abc.de&%blub xxx}{link name}
\end{rProjects}
\end{document}
```
But you should test the special chars you want to use. I'm not sure if all are passed correctly to hyperref.
|
2
|
https://tex.stackexchange.com/users/2388
|
692629
| 321,310 |
https://tex.stackexchange.com/questions/692618
|
0
|
I'm trying to check if a parameter is declared/empty using `lua`. So far I wrote the following MWE:
```
\documentclass{standalone}
\def\var#1{\def\@var{#1}}
%\var{Hello world}
\begin{document}
\@var --
\directlua{if string.len("\@var") == 0 then tex.print("empty") else tex.print("not empty") end}
\end{document}
```
If `\var{Hello world}` is uncommented the code runs with no errors, but if it's commented then it always returns error.
Is there a way to make this checking on a parameter/variable with `LuaLaTeX`?
|
https://tex.stackexchange.com/users/48279
|
Check if parameter in command is declared/empty in LuaLaTeX
| true |
As wipet wrote you are missing \makeatletter. Apart from this you can get the content of a macro in lua with `token.get_macro`. Side remark: do not use standalone for such small examples. That is a complicated class with various side-effects. article is normally much better.
```
\documentclass{article}
\makeatletter
\def\var#1{\def\@var{#1}}
\makeatother
\var{Hello world}
\begin{document}
\makeatletter
\@var --
\makeatother
\directlua{
a=token.get_macro("@var")
print("XXXXXXXXXX @var is: ",a) %for debugging on the terminal
if string.len(a) == 0 then
tex.print("empty")
else
tex.print("not empty " .. string.len(a))
end}
\var{}
\directlua{
a=token.get_macro("@var")
print("XXXXXXXXXX @var is: ",a)
if string.len(a) == 0 then
tex.print("empty")
else
tex.print("not empty " .. string.len(a))
end}
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/2388
|
692630
| 321,311 |
https://tex.stackexchange.com/questions/692581
|
4
|
Every computer program evaluating anything has to distinguish between variables and procedures. This is a typical example from SICP:
```
(define (eval exp env)
(cond ((self-evaluating? exp) exp)
((variable? exp) (lookup-variable-value exp env))
((quoted? exp) (text-of-quotation exp))
((assignment? exp) (eval-assignment exp env))
((definition? exp) (eval-definition exp env))
((if? exp) (eval-if exp env))
((lambda? exp) (make-procedure (lambda-parameters exp)
(lambda-body exp)
env))
((begin? exp)
(eval-sequence (begin-actions exp) env))
((cond? exp) (eval (cond->if exp) env))
((application? exp)
(apply (eval (operator exp) env)
(list-of-values (operands exp) env)))
(else
(error "Unknown expression type: EVAL" exp))))
```
If the expression is a variable it is looked up in the environment. And if the expression is an application it gets executed.
In TeX the following seems to assign a value to a variable:
```
\magnification=1200
```
But this is called a control sequence:
```
\input MS
```
It seems to me that a control sequence (an application) looks the same as a variable. How is it possible that the the evaluator in TeX can distinguish them? Is it because `\magnification` is not a variable but a accessor-function returning the value of the variable?
|
https://tex.stackexchange.com/users/175011
|
How does TeX distinguish between variables and procedures?
| false |
TeX is a filter: it transforms the input to the output. In normal (default) case, if the input includes `a` then the output includes `a`. But there is many exceptions. This is main difference from typical programming language by which we create a computer program for solving various tasks enabled by computer. These tasks are implemented typically as functions: elementary functions are based on system calls and other functions are already programed in libraries or by us. So, comparison between TeX and other programming languages isn't always possible.
The converting the input to the output by TeX is done at more levels: input processor (transforms input lines), token processor (generates tokens), expand processor (expands macros and expandable primitives), main processor (does assignments and typesetting). The heart is the main processor. It asks a single token from the expand processor and does something with the token in a loop. The loop body works in various contexts. In normal context, when main processor gets the token `a` then it prints the `a` (adds it to a build horizontal list of typesetting material, but this is not important now).
When the main processor in normal context gets a control sequence then it does something according to the actual meaning of the control sequence. If its meaning is a TeX primitive then a build-in procedure in TeX is run (you say "function" this case). For example, if its meaning is `\def`, then main processor goes to the "assigning macro" context. In this context, it switches off the expand processor and asks next tokens in given syntax
```
\def\sequence parameters{body}
```
If the last token of this syntax `}` is read then main processor assigns the meaning "macro" to the given control sequence, saves the parameters and body to the TeX memory and links the control sequence to this memory, switches on the expand processor and continues processing in the normal context.
If the meaning of already read token (in normal context) is a register, then main processor starts the context "assignment to the register" and asks the next tokens in this context until the value (with exactly given syntax `\register=value` or `\register value`) is fully scanned. Then the value is assigned and the context is return to normal.
Note that expanding macros and getting the value of registers (for printing, no for assigning) isn't business of main processor, the work is done by expand processor. The value of a register can be get using expandable primitive `\the`: expand processor gets a next token, it must have the meaning "register". Then the expand processor outputs the value of it (a sequence of tokens in given syntax).
Each defined control sequence have one of the following meanings: a register, a primitive command, a character constant, a font switcher, a macro. The expand processor and main processor behaves differently according to the actual meaning of the processed control sequence.
See also [TeX in a Nutshell](https://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf).
|
6
|
https://tex.stackexchange.com/users/51799
|
692635
| 321,313 |
https://tex.stackexchange.com/questions/692637
|
5
|
I am using latex to generate figures, here is a simple example.
```
\documentclass[
border={0mm 0mm 0mm 0mm}, % left bottom right top
]{standalone}
\usepackage{tikz,stackengine}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units}
\begin{document}
\pgfplotsset{width=5cm,height=5cm,grid style={dashed}}
\begin{filecontents}{curves.txt}
x y1 y2
1 1 2
2 4 5
3 2 3
4 6 7
5 5 6
6 6 7
7 9 5
8 5 8
\end{filecontents}
% command in the matlab
% [Time_Series_Plotted',p_total_from_TU(:,Time_Series_Plotted)',p_total_from_TU_CHP(:,Time_Series_Plotted)',p_total_from_TU_CHP_WF(:,Time_Series_Plotted)',p_total_of_loads(:,Time_Series_Plotted)',p_total_from_TU_CHP_WF_WCur(:,Time_Series_Plotted)']
\pgfplotstableread[skip first n=5,]{curves.txt}{\curves}% 2+4 for filecontents header
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, xlabel=x, ylabel=y,
legend style={draw=none,fill=none,legend image post style={scale=1}, font=\scriptsize}, legend cell align={left}, legend pos=north west,]
\addplot[dashed,draw=green, line width=1] table [x index=0,y index=1, ]{\curves};
\addplot[ draw=green, line width=1] table [x index=0,y index=2, ]{\curves};
\legend{curve1, curve2};
\end{axis}
\end{tikzpicture}
\end{document}
```
I use `\begin{filecontents}` and `\end{filecontents}` to create the .txt file to store the data for `tikzpicture`. Then, after compiling the latex code, I have a curves.txt file in the folder.
However, when adjust parameters of curves in the latex file. I should delete the curves.txt file firstly, and then compile the latex code. If not, the latex will still draw curves using old values of curves.txt.
Hence, are there some methods to delete the curves.txt file after generate the pdf file, or cover the old curves.txt file each time when complie the latex code, or just let `pgfplots` read data from the latex code without reading from files?
|
https://tex.stackexchange.com/users/297798
|
How to overwrite files generated by filecontents environment
| false |
You can use `\begin{filecontents*}[overwrite]{curves.txt}...\end{filecontents*}` to ensure that your `.txt` file is recreated:
```
\documentclass[
border={0mm 0mm 0mm 0mm}, % left bottom right top
]{standalone}
\usepackage{tikz,stackengine}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units}
\begin{document}
\pgfplotsset{width=5cm,height=5cm,grid style={dashed}}
\begin{filecontents*}[overwrite]{curves.txt}
x y1 y2
1 1 2
2 4 5
3 2 3
4 6 7
5 5 6
6 6 7
7 9 5
8 5 8
\end{filecontents*}
% command in the matlab
% [Time_Series_Plotted',p_total_from_TU(:,Time_Series_Plotted)',p_total_from_TU_CHP(:,Time_Series_Plotted)',p_total_from_TU_CHP_WF(:,Time_Series_Plotted)',p_total_of_loads(:,Time_Series_Plotted)',p_total_from_TU_CHP_WF_WCur(:,Time_Series_Plotted)']
\pgfplotstableread[skip first n=5,]{curves.txt}{\curves}% 2+4 for filecontents header
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, xlabel=x, ylabel=y,
legend style={draw=none,fill=none,legend image post style={scale=1}, font=\scriptsize}, legend cell align={left}, legend pos=north west,]
\addplot[dashed,draw=green, line width=1] table [x index=0,y index=1, ]{\curves};
\addplot[ draw=green, line width=1] table [x index=0,y index=2, ]{\curves};
\legend{curve1, curve2};
\end{axis}
\end{tikzpicture}
\end{document}
```
|
6
|
https://tex.stackexchange.com/users/36296
|
692638
| 321,315 |
https://tex.stackexchange.com/questions/692617
|
1
|
I know that 32 bit MikTex is discontinued but I have to install it on a PC which does not support the 64 bit architecture. Where can I find the last version of the 32 bit Windows binaries? In particular, I need the Net installer in order to get the complete MikTex, so I am assuming the file is `setup-5.1.exe`.
|
https://tex.stackexchange.com/users/94788
|
The last version of 32 bit MikTex
| false |
While this is not an answer to the original question, it does solve the problem.
1. Download some 32 bit installer, e.g., [here](https://store.horje.com/download/110953). In this case, it's the basic version.
2. If this version is not willing to update/download packages (my case), download all the packages using the most recent Net installer on a 64 bit machine.
3. Copy the folder with packages to the 32 bit machine, and use it as a repository to install all the packages or choose installing on the fly.
|
1
|
https://tex.stackexchange.com/users/94788
|
692639
| 321,316 |
https://tex.stackexchange.com/questions/692637
|
5
|
I am using latex to generate figures, here is a simple example.
```
\documentclass[
border={0mm 0mm 0mm 0mm}, % left bottom right top
]{standalone}
\usepackage{tikz,stackengine}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units}
\begin{document}
\pgfplotsset{width=5cm,height=5cm,grid style={dashed}}
\begin{filecontents}{curves.txt}
x y1 y2
1 1 2
2 4 5
3 2 3
4 6 7
5 5 6
6 6 7
7 9 5
8 5 8
\end{filecontents}
% command in the matlab
% [Time_Series_Plotted',p_total_from_TU(:,Time_Series_Plotted)',p_total_from_TU_CHP(:,Time_Series_Plotted)',p_total_from_TU_CHP_WF(:,Time_Series_Plotted)',p_total_of_loads(:,Time_Series_Plotted)',p_total_from_TU_CHP_WF_WCur(:,Time_Series_Plotted)']
\pgfplotstableread[skip first n=5,]{curves.txt}{\curves}% 2+4 for filecontents header
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, xlabel=x, ylabel=y,
legend style={draw=none,fill=none,legend image post style={scale=1}, font=\scriptsize}, legend cell align={left}, legend pos=north west,]
\addplot[dashed,draw=green, line width=1] table [x index=0,y index=1, ]{\curves};
\addplot[ draw=green, line width=1] table [x index=0,y index=2, ]{\curves};
\legend{curve1, curve2};
\end{axis}
\end{tikzpicture}
\end{document}
```
I use `\begin{filecontents}` and `\end{filecontents}` to create the .txt file to store the data for `tikzpicture`. Then, after compiling the latex code, I have a curves.txt file in the folder.
However, when adjust parameters of curves in the latex file. I should delete the curves.txt file firstly, and then compile the latex code. If not, the latex will still draw curves using old values of curves.txt.
Hence, are there some methods to delete the curves.txt file after generate the pdf file, or cover the old curves.txt file each time when complie the latex code, or just let `pgfplots` read data from the latex code without reading from files?
|
https://tex.stackexchange.com/users/297798
|
How to overwrite files generated by filecontents environment
| true |
You don't need an external file and adjusting the values in the code below is just as easy as with `filecontents`.
```
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{width=5cm,height=5cm,grid style={dashed}}
\pgfplotstableread{
x y1 y2
1 1 2
2 4 5
3 2 3
4 6 7
5 5 6
6 6 7
7 9 5
8 5 8
}{\curves}
\begin{axis}[
color=black,
grid=major,
use units,
xlabel=x,
ylabel=y,
legend style={
draw=none,
fill=none,
legend image post style={scale=1},
font=\scriptsize,
},
legend cell align=left,
legend pos=north west,
]
\addplot[dashed, draw=green, line width=1] table [x index=0,y index=1, ]{\curves};
\addplot[ draw=green, line width=1] table [x index=0,y index=2, ]{\curves};
\legend{curve1, curve2}
\end{axis}
\end{tikzpicture}
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/4427
|
692640
| 321,317 |
https://tex.stackexchange.com/questions/28010
|
31
|
I would like to update my bibtex file in a way that allows me to create multilingual bibliographies. Since I publish in English and Japanese, I will need this to work in a way that:
In an English paper,
* Japanese entries in the Bibliography will have the names of authors both in Kanji and in Romanization; titles will also have to be duplicated in this way, but in addition I sometimes also translate the title, so there might be three entries.
* English citations will appear as usual.
In a Japanese paper
* The Japanese entries will be just author, title etc in Kanji, without additions.
* The English entries might have a translation of the title and give the Author in Japanese Katakana spelling.
To enable this, I thought of extending the bibtex entries in the following way
```
@collection{yanagida_zengaku_sosho_1975,
Address = {京都},
Adress_Romaji = {Kyōto}
Editor = {柳田聖山},
Editor_Romaji = {Yanagida Seizan}
Publisher = {中文出版社},
Publisher_Romaji = {Chūbun shuppansha},
Title = {禪學叢書},
Title_Romaji = {Zengaku sôsho},
Title_en = {Collected Materials for the Study of Zen}
Volumes = {10},
Year = {1974-1977}}
```
I then hope that I will be able to pull the necessary pieces out of here and process them with biber and biblatex. How to go about that, I have no idea.
|
https://tex.stackexchange.com/users/7766
|
How to create multilingual (English, Japanese) bibliographies with biblatex, biber and polyglossia
| false |
I had trouble with japanese + english text as well. Using the `CJKutf8` package and inserting `\begin{CJK*}{UTF8}{MS Mincho}...\end{CJK*}` around japanese text - even in the bib file! - worked for me.
Example:
**document.tex**
```
\documentclass{article} % document style - adjust to your needs
\usepackage[square,numbers,sort&compress]{natbib} % citation style - adjust to your needs
\usepackage{CJKutf8} % this is the library needed to include chinese, japanese, korean and thai characters
\begin{document}
Hello World. Citation example\cite{mynaviEneplat2022}. Japanese font in text:
% in the 'MS Mincho' font - if you need other languages, you might need other fonts.
\begin{CJK*}{UTF8}{MS Mincho} % {goth} or {min} didn't work for me, I don't know why
こんにちは世界
\end{CJK*}
% japanese font in bibliography:
\bibliographystyle{unsrtnat}
\bibliography{literature}{}
\end{document}
```
**literature.bib**
```
@misc{mynaviEneplat2022,
title = {\begin{CJK*}{UTF8}{MS Mincho}自家発電・自家消費を促進するパナソニックの{V2H蓄電システム}「eneplat」\end{CJK*}},
howpublished = {\url{https://news.mynavi.jp/article/20221205-panasonic/}},
language = {ja},
urldate = {2023-08-02},
note = {Accessed: 2023-08-02},
journal = {\begin{CJK*}{UTF8}{MS Mincho}マイナビニュース\end{CJK*}},
author = {\begin{CJK*}{UTF8}{MS Mincho}{諸山泰三}\end{CJK*}},
month = dec,
year = {2022},
}
```
Delete your temporary .bbl and .aux files before you try this so that LaTeX / PDFLaTeX recreate them properly. Also make sure your .tex and .bib are in UTF-8 (e.g., check with Notepad++), but usually, this should already be the case.
**Result:**
|
0
|
https://tex.stackexchange.com/users/178758
|
692642
| 321,318 |
https://tex.stackexchange.com/questions/620603
|
2
|
I am preparing my first paper. The format required by the Journal is that reference citations in the text should be identified by numbers in square brackets and the reference list at the end of the document MUST be placed in alphabetical order.
But in the Springer Nature LaTeX template 2021, there is no bibstyle satisfy this. The 'sn-basic, sn-apa, sn-chicago, sn-standardnature' has 'alphabetical order' but the citation style of them are 'authoryear'. The 'sn-mathphys, sn-aps, sn-vancouver, sn-standardnature' has the style 'numbered' but is 'accuarance order'.
How to modify these templates to meet the requirements of journals? 'numbered' and 'alphabetical order'
|
https://tex.stackexchange.com/users/255626
|
Problem with Springer bibliography style (citation style: numbered, sort in alphabetical order)
| false |
I noticed that using `splncs03_unsrt.bst` ensured that references were cited in the order they appeared.
|
0
|
https://tex.stackexchange.com/users/162246
|
692650
| 321,320 |
https://tex.stackexchange.com/questions/692581
|
4
|
Every computer program evaluating anything has to distinguish between variables and procedures. This is a typical example from SICP:
```
(define (eval exp env)
(cond ((self-evaluating? exp) exp)
((variable? exp) (lookup-variable-value exp env))
((quoted? exp) (text-of-quotation exp))
((assignment? exp) (eval-assignment exp env))
((definition? exp) (eval-definition exp env))
((if? exp) (eval-if exp env))
((lambda? exp) (make-procedure (lambda-parameters exp)
(lambda-body exp)
env))
((begin? exp)
(eval-sequence (begin-actions exp) env))
((cond? exp) (eval (cond->if exp) env))
((application? exp)
(apply (eval (operator exp) env)
(list-of-values (operands exp) env)))
(else
(error "Unknown expression type: EVAL" exp))))
```
If the expression is a variable it is looked up in the environment. And if the expression is an application it gets executed.
In TeX the following seems to assign a value to a variable:
```
\magnification=1200
```
But this is called a control sequence:
```
\input MS
```
It seems to me that a control sequence (an application) looks the same as a variable. How is it possible that the the evaluator in TeX can distinguish them? Is it because `\magnification` is not a variable but a accessor-function returning the value of the variable?
|
https://tex.stackexchange.com/users/175011
|
How does TeX distinguish between variables and procedures?
| false |
From ["TeX in a Nutshell" by Petr Olšák](https://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf):
>
> There are four types of meanings of control sequences:
>
>
> * register (primitive or declared)
> * primitive command
> * character constant
> * macro
>
>
>
TeX's syntax does not reflect this differences. By looking at the document source it is not possible to distinguish them. The difference is stored internally, when the control sequence gets defined. The way a control sequence gets defined specifies its type. And the hidden type information is used during the evaluation.
|
3
|
https://tex.stackexchange.com/users/175011
|
692651
| 321,321 |
https://tex.stackexchange.com/questions/692644
|
3
|
This piece of code used to compile just fine with MiKTeX 2.9.6300:
```
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\input{forEachInput.tex}
{
test \fruit
}
\end{document}
```
The file forEachInput.tex contains just one line with
```
\foreach \fruit in {apple,cherry,banana}
```
with no space at the end.
Now if I try to compile the same file with MiKTeX 23.4, I get an error:
Paragraph ended before \pgffor@next was complete.
On the other hand, if I type directly the content of forEachInput.tex inside the main file (not using input anymore), both MiKTeX 2.9.6300 and MiKTeX 23.4 work perfectly.
It seems something changed its behavior between 2.9.6300 and 23.4? In such a case, I can't figure if it's the \input or the pgffor package, nor can I understand how to make my code work again...
|
https://tex.stackexchange.com/users/142619
|
pgffor with foreach inputted from another file does not work anymore with MiKTeX 23.4
| true |
This works only with (internal) low-level macro `\@input`:
```
\begin{filecontents*}{forEachInput.tex}
\foreach \fruit in {apple,cherry,banana}
\end{filecontents*}
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\csname @input\endcsname{forEachInput.tex}
{
test \fruit
}
\end{document}
```
With the user interface commands `\input`, `\InputIfFileExists` etc. there is code executed before and after reading a file. See `ltfilehook-doc.pdf` for information.
|
4
|
https://tex.stackexchange.com/users/277964
|
692654
| 321,323 |
https://tex.stackexchange.com/questions/643539
|
0
|
In the following revtex4, could we make the turnpage to also rotate the PDF page view by 90 degrees to the **horizontal** orientation (more than just rotating the content by 90 degrees but keeping the page the same **vertical** orientation)?
```
\documentclass[aps,pre,superscriptaddress]{revtex4-1}
\begin{turnpage}
\begin{figure} or
\begin{table}
[...]
\end{figure} or \end{table}
\end{turnpage}
```
Other similar functions are:
```
\usepackage{lscape}
\begin{landscape}
\end{landscape}
```
|
https://tex.stackexchange.com/users/41144
|
revtex and turnpage: also rotate the PDF page view by 90 degrees to the horizontal orientation
| false |
To restate the question as I understood it, since there seems to be some confusion in the comments: `revtex4` (`4-1` and `4-2`) provide the `turnpage` environment, which typesets the contents in landscape mode. However. the PDF still shows the landscape page in portrait orientation. You would like this page to not only be typeset in landscape mode, but also be shown in the same orientation.\*
I managed to achieve this by means of some "magic code" I got from here: [Publish Landscape-oriented Tables With emulateapj on ArXiv](https://tex.stackexchange.com/questions/643539/revtex-and-turnpage-also-rotate-the-pdf-page-view-by-90-degrees-to-the-horizont). In particular, the relevant lines of code are the following:
```
[...]
\clearpage
\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}
[...]
```
This code results in that the pages after these two lines are typeset in landscape mode, while keeping pages before these two lines in portrait mode.
I haven't looked into *why* this macro works exactly (and if I do I'll update this answer), but this seems like enough to achieve the goal stated in the question. In particular, note that the `\clearpage` isn't critical -- I expect `\pagebreak` works just as well -- the point being that we can set the rotation for the PDF page by re-setting the `\pdfpageattr` macro before the page is shipped out.
Now, I looked at the definition of the `turnpage` environment (`\ShowCommand{\turnpage}`; `\endturnpage` does nothing), and we have:
```
\turnpage =
\def \width@float {\textheight}
\def \widthd@float {\textheight}
\appdef \@endfloatbox
{
\@ifxundefined \@currbox
{\ltxgrid@warn {Cannot rotate! Not a float}}
{
\setbox \@currbox \vbox to\textwidth
{\vfil \unvbox \@currbox \vfil}
\global\setbox \@currbox \vbox
{ \rotatebox{90}{\box \@currbox} }
}
}
```
where whitespace is mine and for clarity. So, we have that the `sideways` environment is not doing anything too special, but rather setting a float the size of a page and adding some code to rotate the contents of the float. (Here, viz. `source2e` sec. P1.)
Assuming that this float will always get pushed to the next page (and I'm not completely sure how big of an assumption is this, but it's working for me in practice\*\*), we can therefore get this float to display in landscape if we set `\pdfpageattr` properly at the beginning of the next page, and then reset the PDF orientation at the start of the page following.
I achieved this by leveraging the shipout hooks (viz. `lthooks-doc` and `ltshipout-doc`):
```
\appdef \turnpage {%
% When we're declaring our turnpage float, instruct LaTeX to run
% the following code after the current page has been finalized.
\AddToHookNext{shipout/after}{%
% Set the following page to be rotated by 90 degrees.
\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}%
% Also, once this page is finalized (recalling that this is already
% being called for the float's page), set the PDF attributes such that
% the next pages are upright again.
\AddToHookNext{shipout/after}{%
\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 0}%
}%
}%
}
```
I'm surprised at how robust (in the casual sense, not the LaTeX sense) this seems to be; it really hasn't broken at all in my document. Importantly, I'm using it together with a `table*` -- the asterisk is fundamental. Otherwise, even with an unmodified `revtex4`, the float's positioning is completely broken.
The usual caveats: I'm by no means a LaTeX expert (I've never bothered to read the TeX book, if that's any indication), so a lot of this comes from trial and error. Hopefully someone with a deeper understanding of TeX can correct any mistakes in my reasoning.
\* Your question seems perfectly clear to me, to be honest. I'm unsure about the source of confusion.
\*\* The one edge-case I can think of is when the `sideways` float is perfectly placed such that a `\pagebreak` already occurred naturally before it, and so the page *after* the `sideways` is rotated instead. I'm not sure this can actually happen -- testing it out by inserting a `\pagebreak` just before the float still yields good results -- but it should be easy to modify the code I've provided to deal with that specific case, if it ever happens.
|
1
|
https://tex.stackexchange.com/users/301820
|
692655
| 321,324 |
https://tex.stackexchange.com/questions/321409
|
2
|
I want to label an `alignat*` environment and refer to it. It works with the `alignat` environment but not with `alignat*`.
Does anyone know what the problem is?
|
https://tex.stackexchange.com/users/nan
|
Label in align*-environment
| false |
Using a \tag works. If you don't want the tag to print in the equation-number position, use \tag\*{}. (this will also not increment the equation counter.) If you then place a label in that line called, e.g., \label{anytext}, you can refer to its line by \hyperref[anytext]{(a)}, which will print a reference to (a), or any other name you have assigned to that line, e.g., by inclusion of \text{(a)} at the start of it.
|
0
|
https://tex.stackexchange.com/users/300038
|
692658
| 321,327 |
https://tex.stackexchange.com/questions/692667
|
5
|
I am trying to put two "three part tables" side by side in a document using this TeX code:
```
\documentclass[10pt, a4paper]{article}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{threeparttable}
\begin{document}
\begin{table}[!htb]
\setlength\tabcolsep{3pt}
\footnotesize
\renewcommand{\arraystretch}{1.25}
\begin{threeparttable}
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{@{}
r S[table-format=-2.3] S[table-format=-2.3]
@{\hspace{12pt}} !{\vrule width 0.2pt} @{\hspace{12pt}}
r S[table-format=-2.3] S[table-format=-2.3]
@{}}
\toprule
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & \multicolumn{1}{c}{$\omega_{Im}$} &
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & $\omega_{Im}$ \\
\midrule[0.08cm]
\multicolumn{6}{c}{\textbf{\textbf{$a=0.01 $ }}}\\
~ 1 & 2.799 & -2.687 & 5 & 9.492 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.596 \\
50 & 92.516 &-133.201 & 100 & 184.982 &-266.401 \\
125 & 231.100 &-332.833 & 200 & 368.978&-531.432 \\
225 & 415.166 & -597.962 & 300 & 555.017 & -799.401 \\
\multicolumn{6}{c}{\textbf{$ a=0.1 $}} \\
~ 1 &2.936 &-2.745 & 5 & 9.689 &-13.398 \\
10 & 18.830 &-26.715 & 25 &46.505 &-66.671 \\
50 & 92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 &-333.055 & 200 & 370.115 &-532.844 \\
225 & 416.349 &-599.439 & 300 & 555.056 &-799.231 \\
\multicolumn{6}{c}{\textbf{\textbf{$a = 0.2$}}} \\
~ 1 &3.091 &-2.809 & 5 & 9.906 &-13.470 \\
10 & 19.052 &-26.788 & 25 & 46.729 &-66.744 \\
50 & 92.942 &-133.340 & 100 & 185.402 &-266.532 \\
125 &231.636 &-333.128 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 &555.280 &-799.303 \\
\bottomrule
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{@{}
r S[table-format=-2.3] S[table-format=-2.3]
@{\hspace{12pt}} !{\vrule width 0.2pt} @{\hspace{12pt}}
r S[table-format=-2.3] S[table-format=-2.3]
@{}}
\toprule
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & \multicolumn{1}{c}{$\omega_{Im}$} &
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & $\omega_{Im}$ \\
\midrule[0.08cm]
\multicolumn{6}{c}{\textbf{\textbf{$a=0.01 $ }}}\\
~ 1 &2.813 & -2.677 & 5 & 9.493 &-13.332 \\
10 &18.629 & -26.649 & 25 &46.303 &-66.605 \\
50 &92.516 &-133.201 & 100 & 184.982 & -266.401 \\
125 &231.100 &-332.833 & 200 & 368.978 &-531.432 \\
225 &415.166 &-597.962 & 300 & 555.017 &-799.303 \\
\multicolumn{6}{c}{\textbf{$ a=0.1 $}} \\
~ 1 &2.949 &-2.736 & 5 & 9.690 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671\\
50 &92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 & -333.055 & 200 & 370.115&-532.844 \\
225 & 416.349 & -599.439 & 300 &555.056 &-799.401\\
\multicolumn{6}{c}{\textbf{\textbf{$a = 0.2$}}} \\
~ 1 &3.102 & -2.801 & 5 & 9.907 &-13.471 \\
10 & 19.052 & -26.788 & 25 &46.729 &-66.744 \\
50 &92.943 & -133.339 & 100 & 185.403 & -266.532 \\
125 & 231.636 &-333.129 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 & 555.280 &-799.303 \\
\bottomrule
\end{tabular}
\end{minipage}
\end{threeparttable}
\end{table}
\end{document}
```
But I am not able to get the desired result. Any help in this regard would be truly beneficial!
|
https://tex.stackexchange.com/users/279922
|
Adjusting two "three part tables" side by side in a document
| false |
Empty lines are end of paragraphs. If you want the tables side by side, you should not end a paragraph and start a new one. Removing the empty lines:
```
\documentclass[10pt, a4paper]{article}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{threeparttable}
\begin{document}
\begin{table}[!htb]
\setlength\tabcolsep{3pt}
\footnotesize
\renewcommand{\arraystretch}{1.25}
\begin{threeparttable}
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{@{}
r S[table-format=-2.3] S[table-format=-2.3]
@{\hspace{12pt}} !{\vrule width 0.2pt} @{\hspace{12pt}}
r S[table-format=-2.3] S[table-format=-2.3]
@{}}
\toprule
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & \multicolumn{1}{c}{$\omega_{Im}$} &
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & $\omega_{Im}$ \\
\midrule[0.08cm]
\multicolumn{6}{c}{\textbf{\textbf{$a=0.01 $ }}}\\
~ 1 & 2.799 & -2.687 & 5 & 9.492 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.596 \\
50 & 92.516 &-133.201 & 100 & 184.982 &-266.401 \\
125 & 231.100 &-332.833 & 200 & 368.978&-531.432 \\
225 & 415.166 & -597.962 & 300 & 555.017 & -799.401 \\
\multicolumn{6}{c}{\textbf{$ a=0.1 $}} \\
~ 1 &2.936 &-2.745 & 5 & 9.689 &-13.398 \\
10 & 18.830 &-26.715 & 25 &46.505 &-66.671 \\
50 & 92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 &-333.055 & 200 & 370.115 &-532.844 \\
225 & 416.349 &-599.439 & 300 & 555.056 &-799.231 \\
\multicolumn{6}{c}{\textbf{\textbf{$a = 0.2$}}} \\
~ 1 &3.091 &-2.809 & 5 & 9.906 &-13.470 \\
10 & 19.052 &-26.788 & 25 & 46.729 &-66.744 \\
50 & 92.942 &-133.340 & 100 & 185.402 &-266.532 \\
125 &231.636 &-333.128 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 &555.280 &-799.303 \\
\bottomrule
\end{tabular}
\end{minipage}%
\hfill
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{@{}
r S[table-format=-2.3] S[table-format=-2.3]
@{\hspace{12pt}} !{\vrule width 0.2pt} @{\hspace{12pt}}
r S[table-format=-2.3] S[table-format=-2.3]
@{}}
\toprule
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & \multicolumn{1}{c}{$\omega_{Im}$} &
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & $\omega_{Im}$ \\
\midrule[0.08cm]
\multicolumn{6}{c}{\textbf{\textbf{$a=0.01 $ }}}\\
~ 1 &2.813 & -2.677 & 5 & 9.493 &-13.332 \\
10 &18.629 & -26.649 & 25 &46.303 &-66.605 \\
50 &92.516 &-133.201 & 100 & 184.982 & -266.401 \\
125 &231.100 &-332.833 & 200 & 368.978 &-531.432 \\
225 &415.166 &-597.962 & 300 & 555.017 &-799.303 \\
\multicolumn{6}{c}{\textbf{$ a=0.1 $}} \\
~ 1 &2.949 &-2.736 & 5 & 9.690 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671\\
50 &92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 & -333.055 & 200 & 370.115&-532.844 \\
225 & 416.349 & -599.439 & 300 &555.056 &-799.401\\
\multicolumn{6}{c}{\textbf{\textbf{$a = 0.2$}}} \\
~ 1 &3.102 & -2.801 & 5 & 9.907 &-13.471 \\
10 & 19.052 & -26.788 & 25 &46.729 &-66.744 \\
50 &92.943 & -133.339 & 100 & 185.403 & -266.532 \\
125 & 231.636 &-333.129 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 & 555.280 &-799.303 \\
\bottomrule
\end{tabular}
\end{minipage}
\end{threeparttable}
\end{table}
\end{document}
```
results in:
|
5
|
https://tex.stackexchange.com/users/277964
|
692668
| 321,332 |
https://tex.stackexchange.com/questions/692644
|
3
|
This piece of code used to compile just fine with MiKTeX 2.9.6300:
```
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\input{forEachInput.tex}
{
test \fruit
}
\end{document}
```
The file forEachInput.tex contains just one line with
```
\foreach \fruit in {apple,cherry,banana}
```
with no space at the end.
Now if I try to compile the same file with MiKTeX 23.4, I get an error:
Paragraph ended before \pgffor@next was complete.
On the other hand, if I type directly the content of forEachInput.tex inside the main file (not using input anymore), both MiKTeX 2.9.6300 and MiKTeX 23.4 work perfectly.
It seems something changed its behavior between 2.9.6300 and 23.4? In such a case, I can't figure if it's the \input or the pgffor package, nor can I understand how to make my code work again...
|
https://tex.stackexchange.com/users/142619
|
pgffor with foreach inputted from another file does not work anymore with MiKTeX 23.4
| false |
You can use the `catchfile` package to load the contents of the file in a macro and use that, repeatedly if needed.
Code
----
```
\begin{filecontents*}{\jobname-data.tex}
\foreach \fruit in {apple, cherry, banana}
\end{filecontents*}
\documentclass{article}
\usepackage{pgffor, catchfile}
\newcommand*\Input[2][\foreachFile]{\CatchFileDef{#1}{#2}{}#1}
\begin{document}
\Input{\jobname-data.tex}{test: \fruit \par}
\foreachFile{again: \fruit \par}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/16595
|
692671
| 321,334 |
https://tex.stackexchange.com/questions/692672
|
2
|
I was wondering if I can have a named theorem (without number) and still call it by the name is printing. The following is the code in the preamble so that I can give a name to the theorem. (I obtained this code from another post).
```
\theoremstyle{definition}
\newcommand{\thistheoremname}{}
\newtheorem{genericthm}[thm]{\thistheoremname}
\newenvironment{namedthm}[1]
{\renewcommand{\thistheoremname}{#1}%
\begin{genericthm}}
{\end{genericthm}}
\newtheorem*{genericthm*}{\thistheoremname}
\newenvironment{namedthm*}[1]
{\renewcommand{\thistheoremname}{#1}%
\begin{genericthm*}}
{\end{genericthm*}}
```
The following is the what I want the theorem to say. Note I use namedthm\* so that no number appears.
```
\begin{namedthm*}{Theorem A}\label{theoremA} Some text.
\end{namedthm*}
```
When I use Theorem \ref{theoremA}, it doesn't print Theorem A. Is there any way I can get that to print?
Thank you in advance.
|
https://tex.stackexchange.com/users/297854
|
Referencing a theorem by name only
| true |
Use a dummy counter and make its representation to be `\thistheoremname`.
```
\documentclass{article}
\usepackage{amsthm}
\usepackage{hyperref}
\newtheorem*{genericthm*}{\thistheoremname}
\newcommand{\thistheoremname}{???}% initialize
\newcounter{genericthm}
\renewcommand{\thegenericthm}{\thistheoremname}
\newenvironment{namedthm*}[1]
{\renewcommand{\thistheoremname}{#1}%
\refstepcounter{genericthm}%
\begin{genericthm*}}
{\end{genericthm*}}
\begin{document}
\begin{namedthm*}{Theorem A}\label{theoremA}
Some text.
\end{namedthm*}
\ref{theoremA}
\end{document}
```
Note that `hyperref` is not necessary; I load it in the example just to check compatibility.
Let's check that the link is indeed correct: the PDF viewer I use shows a reduced image of the text a link points to when hovering it.
|
3
|
https://tex.stackexchange.com/users/4427
|
692674
| 321,336 |
https://tex.stackexchange.com/questions/692667
|
5
|
I am trying to put two "three part tables" side by side in a document using this TeX code:
```
\documentclass[10pt, a4paper]{article}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{threeparttable}
\begin{document}
\begin{table}[!htb]
\setlength\tabcolsep{3pt}
\footnotesize
\renewcommand{\arraystretch}{1.25}
\begin{threeparttable}
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{@{}
r S[table-format=-2.3] S[table-format=-2.3]
@{\hspace{12pt}} !{\vrule width 0.2pt} @{\hspace{12pt}}
r S[table-format=-2.3] S[table-format=-2.3]
@{}}
\toprule
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & \multicolumn{1}{c}{$\omega_{Im}$} &
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & $\omega_{Im}$ \\
\midrule[0.08cm]
\multicolumn{6}{c}{\textbf{\textbf{$a=0.01 $ }}}\\
~ 1 & 2.799 & -2.687 & 5 & 9.492 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.596 \\
50 & 92.516 &-133.201 & 100 & 184.982 &-266.401 \\
125 & 231.100 &-332.833 & 200 & 368.978&-531.432 \\
225 & 415.166 & -597.962 & 300 & 555.017 & -799.401 \\
\multicolumn{6}{c}{\textbf{$ a=0.1 $}} \\
~ 1 &2.936 &-2.745 & 5 & 9.689 &-13.398 \\
10 & 18.830 &-26.715 & 25 &46.505 &-66.671 \\
50 & 92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 &-333.055 & 200 & 370.115 &-532.844 \\
225 & 416.349 &-599.439 & 300 & 555.056 &-799.231 \\
\multicolumn{6}{c}{\textbf{\textbf{$a = 0.2$}}} \\
~ 1 &3.091 &-2.809 & 5 & 9.906 &-13.470 \\
10 & 19.052 &-26.788 & 25 & 46.729 &-66.744 \\
50 & 92.942 &-133.340 & 100 & 185.402 &-266.532 \\
125 &231.636 &-333.128 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 &555.280 &-799.303 \\
\bottomrule
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{@{}
r S[table-format=-2.3] S[table-format=-2.3]
@{\hspace{12pt}} !{\vrule width 0.2pt} @{\hspace{12pt}}
r S[table-format=-2.3] S[table-format=-2.3]
@{}}
\toprule
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & \multicolumn{1}{c}{$\omega_{Im}$} &
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & $\omega_{Im}$ \\
\midrule[0.08cm]
\multicolumn{6}{c}{\textbf{\textbf{$a=0.01 $ }}}\\
~ 1 &2.813 & -2.677 & 5 & 9.493 &-13.332 \\
10 &18.629 & -26.649 & 25 &46.303 &-66.605 \\
50 &92.516 &-133.201 & 100 & 184.982 & -266.401 \\
125 &231.100 &-332.833 & 200 & 368.978 &-531.432 \\
225 &415.166 &-597.962 & 300 & 555.017 &-799.303 \\
\multicolumn{6}{c}{\textbf{$ a=0.1 $}} \\
~ 1 &2.949 &-2.736 & 5 & 9.690 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671\\
50 &92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 & -333.055 & 200 & 370.115&-532.844 \\
225 & 416.349 & -599.439 & 300 &555.056 &-799.401\\
\multicolumn{6}{c}{\textbf{\textbf{$a = 0.2$}}} \\
~ 1 &3.102 & -2.801 & 5 & 9.907 &-13.471 \\
10 & 19.052 & -26.788 & 25 &46.729 &-66.744 \\
50 &92.943 & -133.339 & 100 & 185.403 & -266.532 \\
125 & 231.636 &-333.129 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 & 555.280 &-799.303 \\
\bottomrule
\end{tabular}
\end{minipage}
\end{threeparttable}
\end{table}
\end{document}
```
But I am not able to get the desired result. Any help in this regard would be truly beneficial!
|
https://tex.stackexchange.com/users/279922
|
Adjusting two "three part tables" side by side in a document
| true |
There are several issues with your code. In no particular order:
* You don't appear to be using the machinery of the `threeparttable` package at all. The three formal parts of a `threeparttable` environment are (a) a `tabular`-like environment, (b) a `\caption` directive, and (c) a `tablenotes` environment. Since there are no `\caption` directives and no `tablenotes` environmens, and since the `tabular` environments are encased in `minipage` environments and thus are *invisible* to the single `threeparttable` environment, it's basically doing nothing at all. Just omit it.
* The `minipage` environments don't seem to be doing anything useful either. I'd omit them as well.
* Nested `\textbf` directives -- as in `\textbf{\textbf{...}}` -- are pointless.
* The argument of a `\textbf` diretive should be text-mode material. Therefore, `\textbf{$a=0.01$}` is guaranteed to do nothing useful. Did you maybe mean to write `$\mathbf{a=0.01}$`, etc?
* The `S[table-format=-2.3]` column format specifications would all appear to be wrong. Why not use either `S[table-format=3.3]` or `S[table-format=-3.3]`?
* I'd delete the vertical rules. They're not needed.
* The `\footnotesize` directive isn't needed either.
* Much of the material appears to require math mode. I suggest you use `array` instead of `tabular` environments and delete scores of `$` symbols, further reducing code clutter.
* Last but not least, don't leave blank lines between the two `tabular`/`array` environments.
```
\documentclass[10pt]{article}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage{booktabs}
\usepackage{siunitx} % for 'S' column type
% handy shortcut macros:
\newcommand\omegaRe{\omega_{\mkern1mu\mathrm{Re}}}
\newcommand\omegaIm{\omega_{\mkern1mu\mathrm{Im}}}
\begin{document}
\begin{table}[!htb]
\setlength\arraycolsep{4pt} % default: 5pt
\renewcommand{\arraystretch}{1.25}
$\begin{array}[t]{@{}
r S[table-format=3.3] S[table-format=-3.3]
@{\hspace{25pt}}
r S[table-format=3.3] S[table-format=-3.3]
@{}}
\toprule
r_h & {\omegaRe} & {\omegaIm} & r_h & {\omegaRe} & {\omegaIm} \\
\midrule
\multicolumn{6}{c}{\mathbf{a=0.01}}\\
1 & 2.799 & -2.687 & 5 & 9.492 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.596 \\
50 & 92.516 &-133.201 & 100 & 184.982 &-266.401 \\
125& 231.100 &-332.833 & 200 & 368.978 &-531.432 \\
225& 415.166 &-597.962 & 300 & 555.017 &-799.401 \\
\addlinespace
\multicolumn{6}{c}{\mathbf{a=0.1}} \\
1 & 2.936 & -2.745 & 5 & 9.689 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671 \\
50 & 92.718 &-133.266 & 100 & 185.178 &-266.459 \\
125 &231.411 &-333.055 & 200 & 370.115 &-532.844 \\
225 &416.349 &-599.439 & 300 & 555.056 &-799.231 \\
\addlinespace
\multicolumn{6}{c}{\mathbf{a=0.2}} \\
1 & 3.091 & -2.809 & 5 & 9.906 & -13.470 \\
10 & 19.052 & -26.788 & 25 & 46.729 & -66.744 \\
50 & 92.942 &-133.340 & 100 & 185.402 &-266.532 \\
125 &231.636 &-333.128 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 & 555.280 &-799.303 \\
\bottomrule
\end{array}$
% don't leave a blank line
\hfill
% don't leave a blank line
$\begin{array}[t]{@{}
r S[table-format=3.3] S[table-format=-3.3]
@{\hspace{25pt}}
r S[table-format=3.3] S[table-format=-3.3]
@{}}
\toprule
r_h & {\omegaRe} & {\omegaIm} & r_h & {\omegaRe} & {\omegaIm} \\
\midrule
\multicolumn{6}{c}{\mathbf{a=0.01}}\\
1 & 2.813 & -2.677 & 5 & 9.493 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.605 \\
50 & 92.516 &-133.201 & 100 & 184.982 &-266.401 \\
125 &231.100 &-332.833 & 200 & 368.978 &-531.432 \\
225 &415.166 &-597.962 & 300 & 555.017 &-799.303 \\
\addlinespace
\multicolumn{6}{c}{\mathbf{a=0.1}} \\
1 & 2.949 & -2.736 & 5 & 9.690 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671 \\
50 & 92.718 &-133.266 & 100 & 185.178 &-266.459 \\
125 &231.411 &-333.055 & 200 & 370.115 &-532.844 \\
225 &416.349 &-599.439 & 300 & 555.056 &-799.401 \\
\addlinespace
\multicolumn{6}{c}{\mathbf{a=0.2}} \\
1 & 3.102 & -2.801 & 5 & 9.907 & -13.471 \\
10 & 19.052 & -26.788 & 25 & 46.729 & -66.744 \\
50 & 92.943 &-133.339 & 100 & 185.403 &-266.532 \\
125 &231.636 &-333.129 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 & 555.280 &-799.303 \\
\bottomrule
\end{array}$
\end{table}
\end{document}
```
|
5
|
https://tex.stackexchange.com/users/5001
|
692675
| 321,337 |
https://tex.stackexchange.com/questions/692667
|
5
|
I am trying to put two "three part tables" side by side in a document using this TeX code:
```
\documentclass[10pt, a4paper]{article}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{threeparttable}
\begin{document}
\begin{table}[!htb]
\setlength\tabcolsep{3pt}
\footnotesize
\renewcommand{\arraystretch}{1.25}
\begin{threeparttable}
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{@{}
r S[table-format=-2.3] S[table-format=-2.3]
@{\hspace{12pt}} !{\vrule width 0.2pt} @{\hspace{12pt}}
r S[table-format=-2.3] S[table-format=-2.3]
@{}}
\toprule
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & \multicolumn{1}{c}{$\omega_{Im}$} &
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & $\omega_{Im}$ \\
\midrule[0.08cm]
\multicolumn{6}{c}{\textbf{\textbf{$a=0.01 $ }}}\\
~ 1 & 2.799 & -2.687 & 5 & 9.492 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.596 \\
50 & 92.516 &-133.201 & 100 & 184.982 &-266.401 \\
125 & 231.100 &-332.833 & 200 & 368.978&-531.432 \\
225 & 415.166 & -597.962 & 300 & 555.017 & -799.401 \\
\multicolumn{6}{c}{\textbf{$ a=0.1 $}} \\
~ 1 &2.936 &-2.745 & 5 & 9.689 &-13.398 \\
10 & 18.830 &-26.715 & 25 &46.505 &-66.671 \\
50 & 92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 &-333.055 & 200 & 370.115 &-532.844 \\
225 & 416.349 &-599.439 & 300 & 555.056 &-799.231 \\
\multicolumn{6}{c}{\textbf{\textbf{$a = 0.2$}}} \\
~ 1 &3.091 &-2.809 & 5 & 9.906 &-13.470 \\
10 & 19.052 &-26.788 & 25 & 46.729 &-66.744 \\
50 & 92.942 &-133.340 & 100 & 185.402 &-266.532 \\
125 &231.636 &-333.128 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 &555.280 &-799.303 \\
\bottomrule
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{@{}
r S[table-format=-2.3] S[table-format=-2.3]
@{\hspace{12pt}} !{\vrule width 0.2pt} @{\hspace{12pt}}
r S[table-format=-2.3] S[table-format=-2.3]
@{}}
\toprule
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & \multicolumn{1}{c}{$\omega_{Im}$} &
\multicolumn{1}{c}{$r_h$} & $\omega_{Re}$ & $\omega_{Im}$ \\
\midrule[0.08cm]
\multicolumn{6}{c}{\textbf{\textbf{$a=0.01 $ }}}\\
~ 1 &2.813 & -2.677 & 5 & 9.493 &-13.332 \\
10 &18.629 & -26.649 & 25 &46.303 &-66.605 \\
50 &92.516 &-133.201 & 100 & 184.982 & -266.401 \\
125 &231.100 &-332.833 & 200 & 368.978 &-531.432 \\
225 &415.166 &-597.962 & 300 & 555.017 &-799.303 \\
\multicolumn{6}{c}{\textbf{$ a=0.1 $}} \\
~ 1 &2.949 &-2.736 & 5 & 9.690 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671\\
50 &92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 & -333.055 & 200 & 370.115&-532.844 \\
225 & 416.349 & -599.439 & 300 &555.056 &-799.401\\
\multicolumn{6}{c}{\textbf{\textbf{$a = 0.2$}}} \\
~ 1 &3.102 & -2.801 & 5 & 9.907 &-13.471 \\
10 & 19.052 & -26.788 & 25 &46.729 &-66.744 \\
50 &92.943 & -133.339 & 100 & 185.403 & -266.532 \\
125 & 231.636 &-333.129 & 200 & 370.339 &-532.917 \\
225 &416.574 &-599.513 & 300 & 555.280 &-799.303 \\
\bottomrule
\end{tabular}
\end{minipage}
\end{threeparttable}
\end{table}
\end{document}
```
But I am not able to get the desired result. Any help in this regard would be truly beneficial!
|
https://tex.stackexchange.com/users/279922
|
Adjusting two "three part tables" side by side in a document
| false |
I can't see how `threeparttable` would help for this job.
I'd simply use `tabular*` with appropriate dimensions as to leave a bit of horizontal space between the two tables; setting `\tabcolsep` to zero makes TeX do the job of computing the spaces.
I also fixed the column specification to comply with the actual data. If you want the cases to be printed in boldface, use `\boldmath`, rather than `\textbf` that does nothing to math.
```
\documentclass[10pt, a4paper]{article}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}[!htb]
%\footnotesize
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{0.48\textwidth}{
@{\extracolsep{\fill}}
S[table-format=3.0]
S[table-format=3.3]
S[table-format=-3.3]
@{\qquad}
S[table-format=3.0]
S[table-format=-3.3]
S[table-format=-3.3]
}
\toprule
{$r_h$} & {$\omega_{\mathrm{Re}}$} & {$\omega_{\mathrm{Im}}$} &
{$r_h$} & {$\omega_{\mathrm{Re}}$} & {$\omega_{\mathrm{Im}}$} \\
\midrule
\multicolumn{6}{c}{\boldmath$a=0.01$}\\
1 & 2.799 & -2.687 & 5 & 9.492 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.596 \\
50 & 92.516 & -133.201 & 100 & 184.982 & -266.401 \\
125 & 231.100 & -332.833 & 200 & 368.978 & -531.432 \\
225 & 415.166 & -597.962 & 300 & 555.017 & -799.401 \\
\addlinespace
\multicolumn{6}{c}{\boldmath$a=0.1$} \\
1 & 2.936 & -2.745 & 5 & 9.689 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671 \\
50 & 92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 & -333.055 & 200 & 370.115 & -532.844 \\
225 & 416.349 & -599.439 & 300 & 555.056 & -799.231 \\
\addlinespace
\multicolumn{6}{c}{\boldmath$a = 0.2$} \\
1 & 3.091 & -2.809 & 5 & 9.906 & -13.470 \\
10 & 19.052 & -26.788 & 25 & 46.729 & -66.744 \\
50 & 92.942 & -133.340 & 100 & 185.402 & -266.532 \\
125 & 231.636 & -333.128 & 200 & 370.339 & -532.917 \\
225 & 416.574 & -599.513 & 300 & 555.280 & -799.303 \\
\bottomrule
\end{tabular*}\hfill
\begin{tabular*}{0.48\textwidth}{
@{\extracolsep{\fill}}
S[table-format=3.0]
S[table-format=3.3]
S[table-format=-3.3]
@{\qquad}
S[table-format=3.0]
S[table-format=-3.3]
S[table-format=-3.3]
}
\toprule
{$r_h$} & {$\omega_{\mathrm{Re}}$} & {$\omega_{\mathrm{Im}}$} &
{$r_h$} & {$\omega_{\mathrm{Re}}$} & {$\omega_{\mathrm{Im}}$} \\
\midrule
\multicolumn{6}{c}{\boldmath$a=0.01$} \\
1 & 2.813 & -2.677 & 5 & 9.493 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.605 \\
50 & 92.516 & -133.201 & 100 & 184.982 & -266.401 \\
125 & 231.100 & -332.833 & 200 & 368.978 & -531.432 \\
225 & 415.166 & -597.962 & 300 & 555.017 & -799.303 \\
\addlinespace
\multicolumn{6}{c}{\boldmath$a=0.1$} \\
1 & 2.949 & -2.736 & 5 & 9.690 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671 \\
50 & 92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 & -333.055 & 200 & 370.115 & -532.844 \\
225 & 416.349 & -599.439 & 300 & 555.056 & -799.401 \\
\addlinespace
\multicolumn{6}{c}{\boldmath$a = 0.2$} \\
1 & 3.102 & -2.801 & 5 & 9.907 & -13.471 \\
10 & 19.052 & -26.788 & 25 & 46.729 & -66.744 \\
50 & 92.943 & -133.339 & 100 & 185.403 & -266.532 \\
125 & 231.636 & -333.129 & 200 & 370.339 & -532.917 \\
225 & 416.574 & -599.513 & 300 & 555.280 & -799.303 \\
\bottomrule
\end{tabular*}
\caption{Here is a caption for the side-by-side tables}
\end{table}
\end{document}
```
If you want to add subcaptions:
```
\documentclass[10pt, a4paper]{article}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{subcaption}
\begin{document}
\begin{table}[!htb]
\setlength{\tabcolsep}{0pt}
\begin{subtable}{0.48\textwidth}
\begin{tabular*}{\textwidth}{
@{\extracolsep{\fill}}
S[table-format=3.0]
S[table-format=3.3]
S[table-format=-3.3]
@{\qquad}
S[table-format=3.0]
S[table-format=-3.3]
S[table-format=-3.3]
}
\toprule
{$r_h$} & {$\omega_{\mathrm{Re}}$} & {$\omega_{\mathrm{Im}}$} &
{$r_h$} & {$\omega_{\mathrm{Re}}$} & {$\omega_{\mathrm{Im}}$} \\
\midrule
\multicolumn{6}{c}{\boldmath$a=0.01$}\\
1 & 2.799 & -2.687 & 5 & 9.492 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.596 \\
50 & 92.516 & -133.201 & 100 & 184.982 & -266.401 \\
125 & 231.100 & -332.833 & 200 & 368.978 & -531.432 \\
225 & 415.166 & -597.962 & 300 & 555.017 & -799.401 \\
\addlinespace
\multicolumn{6}{c}{\boldmath$a=0.1$} \\
1 & 2.936 & -2.745 & 5 & 9.689 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671 \\
50 & 92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 & -333.055 & 200 & 370.115 & -532.844 \\
225 & 416.349 & -599.439 & 300 & 555.056 & -799.231 \\
\addlinespace
\multicolumn{6}{c}{\boldmath$a = 0.2$} \\
1 & 3.091 & -2.809 & 5 & 9.906 & -13.470 \\
10 & 19.052 & -26.788 & 25 & 46.729 & -66.744 \\
50 & 92.942 & -133.340 & 100 & 185.402 & -266.532 \\
125 & 231.636 & -333.128 & 200 & 370.339 & -532.917 \\
225 & 416.574 & -599.513 & 300 & 555.280 & -799.303 \\
\bottomrule
\end{tabular*}
\caption{Subcaption}
\end{subtable}\hfill
\begin{subtable}{0.48\textwidth}
\begin{tabular*}{\textwidth}
@{\extracolsep{\fill}}
S[table-format=3.0]
S[table-format=3.3]
S[table-format=-3.3]
@{\qquad}
S[table-format=3.0]
S[table-format=-3.3]
S[table-format=-3.3]
}
\toprule
{$r_h$} & {$\omega_{\mathrm{Re}}$} & {$\omega_{\mathrm{Im}}$} &
{$r_h$} & {$\omega_{\mathrm{Re}}$} & {$\omega_{\mathrm{Im}}$} \\
\midrule
\multicolumn{6}{c}{\boldmath$a=0.01$} \\
1 & 2.813 & -2.677 & 5 & 9.493 & -13.332 \\
10 & 18.629 & -26.649 & 25 & 46.303 & -66.605 \\
50 & 92.516 & -133.201 & 100 & 184.982 & -266.401 \\
125 & 231.100 & -332.833 & 200 & 368.978 & -531.432 \\
225 & 415.166 & -597.962 & 300 & 555.017 & -799.303 \\
\addlinespace
\multicolumn{6}{c}{\boldmath$a=0.1$} \\
1 & 2.949 & -2.736 & 5 & 9.690 & -13.398 \\
10 & 18.830 & -26.715 & 25 & 46.505 & -66.671 \\
50 & 92.718 & -133.266 & 100 & 185.178 & -266.459 \\
125 & 231.411 & -333.055 & 200 & 370.115 & -532.844 \\
225 & 416.349 & -599.439 & 300 & 555.056 & -799.401 \\
\addlinespace
\multicolumn{6}{c}{\boldmath$a = 0.2$} \\
1 & 3.102 & -2.801 & 5 & 9.907 & -13.471 \\
10 & 19.052 & -26.788 & 25 & 46.729 & -66.744 \\
50 & 92.943 & -133.339 & 100 & 185.403 & -266.532 \\
125 & 231.636 & -333.129 & 200 & 370.339 & -532.917 \\
225 & 416.574 & -599.513 & 300 & 555.280 & -799.303 \\
\bottomrule
\end{tabular*}
\caption{Subcaption}
\end{subtable}
\caption{Here is a caption for the side-by-side tables}
\end{table}
\end{document}
```
|
5
|
https://tex.stackexchange.com/users/4427
|
692683
| 321,342 |
https://tex.stackexchange.com/questions/678789
|
0
|
I'm learning the flowfram package and I intend a simple use of setting some frames on the page and have the text flowing through. My frames have different widths and I read from the flowfram manual that:
«The command \framebreak is provided for situations where a paragraph spans two flow frames of different widths, as TEX’s output routine does not adjust to the new value of \hsize until the last paragraph of the previous frame has ended.»
Is there a workaround to adding manual breaks?
There is also another issue: an unexpected gap between frames.
Please see my MWE and tell me if I do something wrong. Thanks.
(PS: Sorry but I needed to use real text to show the \framebreak use so I just used this very interesting publicly available article that I was reading: <https://k-larevue.com/permis-de-vivre-sur-adolfo-kaminsky/>)
```
\documentclass[a5paper]{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{flowfram}
\newflowframe*
{0.3\textwidth}% width
{0.3\textheight}% height
{0\textwidth}% x position
{0.7\textheight}% y position
\newflowframe*
{0.7\textwidth}
{0.7\textheight}
{0\textwidth}
{0\textheight}
%\newflowframe*{\textwidth}{0.4\textheight}{0pt}{0pt}
%\newstaticframe*{2in}{2in}{0pt}{0pt}
%\setstaticcontents*{1}{\includegraphics[height=2in]{chicken}}
\begin{document}
\sloppy
%\lipsum{1}
Adolfo Kaminsky, né en 1925 en Argentine, est devenu une légende : le résistant faussaire connu pour s’être spécialisé dans la fabrication \framebreak de faux papiers au cours de la Seconde Guerre mondiale. Il voulut être peintre, il est devenu un photographe discret, hésitant à montrer son travail – avant que le Musée d’art et d’histoire du Judaïsme (mahJ) à Paris ne mette la lumière sur des dizaines de clichés pris pendant des décennies. Une vie clandestine, dans son œuvre comme dans ses engagements : après la guerre, il fabrique des faux papiers pour la Haganah, il est le faussaire des réseaux de soutien aux indépendantistes algériens dans les années 1950 et 1960, celui des révolutionnaires d’Amérique du Sud comme des opposants aux dictatures de l’Espagne, du Portugal et de Grèce… La philosophe Elisabeth de Fontenay témoigne de son admiration.

Adolfo posant avec ses Rolleiflex, Paris, 1997, photo prise par sa femme Leïla
L’artisanat des faux papiers, \framebreak comme la prise de vue photographique, incite à s’interroger sur ce qu’est l’authenticité, l’ici et le maintenant de l’original, cette \framebreak autorité de la chose même qui, échappant à la reproduction, ne saurait, à plus forte raison, subir de contrefaçon. Et pourtant, quelle vie véritable, véridique et vraie que celle d’Adolfo Kaminsky, ce faussaire, artisan de génie au service de la survie et de la liberté, cet artiste photographe qui tentera, quand il aura la liberté d’exister, de traduire par fragments la beauté du monde ! Un homme, fidèle à lui-même, qui a travaillé dans l’ombre de laboratoires clandestins et dans la lumière captée par le Rolleiflex.
Instantané
« Tu photographies n’importe quoi » lui dit un jour son frère. À une autre époque que ce temps de détresse, Adolfo Kaminsky aurait pu faire une carrière scientifique, mais il avait toujours voulu être peintre. Les photographes qui observent puis « prennent » une photo ont quelque chose du flâneur dont le coup d’œil et la saisie, dénués de voyeurisme, gardent leurs distances. Est-ce là capture, vol d’une image, d’un instant ? Non, chez lui, l’objectif est un oiseau qui se pose. Paris, l’eau, la nuit, les enfants, les marchés aux puces, les petits métiers, tels sont les sujets qu’il photographie.
Le fabricant de faux papiers, quand la Libération le rendit à lui-même et aux siens, donna au droit de vivre un tout autre sens : le droit de persévérer dans son être propre, d’exister selon son gré, voire selon sa fantaisie. C’est la liberté que Kaminsky s’accorda en partie quand il se mit à vivre, à flâner et à photographier au grand jour tout en poursuivant son activité de clandestin au service de la France, puis des apatrides qui voulaient fonder un État juif et y vivre, puis aider les luttes de libération, de décolonisation et se battre contre les dictatures.
Aussi est-ce un seul et même homme qu’’il faut célébrer, le regardant à la fois dans l’obscurité de la fabrique clandestine et dans la lumière d’un travail d’artiste. Il y avait un temps pour dire non aux nazis et à leurs acolytes, non encore aux tortures coloniales, et un autre pour dire oui à la beauté et à l’énigme du monde. Les deux temps pouvaient coexister.
\end{document}
```
|
https://tex.stackexchange.com/users/254618
|
Flowfram - Text width issue
| false |
I've decided to post an answer to this question because even the accepted answer is not what requested, i.e., an **automatic solution**. First, I will point out that this is a *known problem of the package* that comes from a core limitation of TeX\*. In addition to that I want you to know that I'm no TeX expert and that this is **not a perfect solution**. Maybe someone more skilled than me will be able to expand this concept to a fully working solution, although I doubt this system has much more potential.
*Figure: Example of how the system works and fails*
First, a bit of context. Here I define the page layout.
```
\documentclass{article}
\usepackage{lipsum}
\usepackage[pages=absolute]{flowfram}
\showframebboxtrue
% \newflowframe[<pages>]{<width>}{<height>}{<x>}{<y>}[<label>]
\newflowframe[>0]{0.6\textwidth}{\textheight}{-0.1\textwidth}{0.1\textheight}[thick]
\newflowframe[>0]{0.4\textwidth}{0.5\textheight}{0.6\textwidth}{0.6\textheight}[thin]
\newstaticframe[>0]{0.7\textwidth}{0.45\textheight}{0.6\textwidth}{0.1\textheight}[image]
\begin{staticcontents*}{image}
\hrule width\textwidth height0.45\textheight
\end{staticcontents*}
\global\newcount\numberofframes\numberofframes=2\relax
```
I've also stored the number of frames for later use. Here I define a `\modulo` macro for calculating `#1 mod #2` and putting the result inside of `\modulores`.
```
\global\newcount\modulores
\def\modulo#1#2{
\newcount\countA
\newcount\countB
\newcount\result
\countA=#1\relax
\countB=#2\relax
\result=\countA
\divide\result by \countB
\multiply\result by \countB
\advance\countA by -\result
\global\modulores=\countA\relax
}
```
Below is the core of the system that solves the issue. The `\mypar` macro eats the following paragraph and does three things:
* first it calculates the available space in the frame;
* then it guesses the number of lines that will fit inside the remaining space;
* finally it uses `\hangafter` and `\hangindent` to adjust for the difference in width.
The fact that TeX decides how many lines to put in this frame and how many lines to put in the next frame using a rather complex algorithms prevents this simple system from determining the correct number of lines that fit in the page every time. As you can see in the second page of this example, the system is infact fallible.
```
\def\mypar#1\par{
% here we can get the content of the paragraph and the position on the page before outputting the paragraph
\newdimen\parheight\parheight=\dimexpr\pagegoal-\pagetotal-\pagedepth\relax
% how many lines fit into the page
\newcount\fittinglines\fittinglines=\numexpr\parheight/\baselineskip\relax
% width of the current frame
\getflowbounds\thethisframe\relax
\newdimen\currentwidth\currentwidth=\ffareawidth\relax
% width of the next frame thenextframe = (thethisframe + 1) mod numberofframes
\newcount\nextframe
\modulo{\numexpr\thethisframe}{\the\numberofframes}\relax
\nextframe=\numexpr\the\modulores+1\relax
\getflowbounds{\the\nextframe}\relax
\newdimen\nextwidth\nextwidth=\ffareawidth\relax
% indentation logic
\ifnum\nextwidth=\currentwidth\relax
#1\endgraf
\else
\ifnum\nextwidth<\currentwidth\relax
% the next is thinner
\hsize=\the\currentwidth\relax
\hangafter=\fittinglines\relax
\hangindent=\dimexpr\nextwidth-\currentwidth\relax
% info: [\thethisframe,\the\currentwidth,\the\nextwidth,thinner]
#1\endgraf
\else
% the next is wider
\hsize=\the\nextwidth\relax
\hangafter=-\fittinglines\relax
\hangindent=\dimexpr\currentwidth-\nextwidth\relax
% info: [\thethisframe,\the\currentwidth,\the\nextwidth,wider]
#1\endgraf
\fi
\fi
\vbox to\parskip{}
}
\begin{document}
\emergencystretch 2em % avoid text overflow
\section{Lorem}
\mypar\lipsum*[1]
$$
\int_\Sigma \vec\nabla\times\vec F \hat n\textrm{d}\Sigma = \oint_\gamma \vec F \cdot \textrm{d}\vec s
$$
\subsection{Ipsum}
\lipsum*[2]
\mypar\lipsum*[3]
\mypar\lipsum*[4]
\section{Dolor}
\mypar\lipsum*[5]
\mypar\lipsum*[6]
\subsection{Sit amet}
\mypar\lipsum*[7]
\end{document}
```
The sum of all the above code snippets is a working example.
\*This limitation is what prevented my first attempt from working; you can find my first try below
```
% this is the content of the current paragraph
\setbox100=\vbox{#1}\relax
% this is the part of paragraph that fits into the page
\setbox101=\vsplit100to\parheight\relax
% the non-fitting section of the paragraph is now inside box100
\ifvoid100#1\par\else\unvbox101\framebreak$[\the\hsize]$\unvbox100\fi
```
These were my attempts to solving the problem. I hope someone will benefit from them.
|
0
|
https://tex.stackexchange.com/users/246101
|
692687
| 321,344 |
https://tex.stackexchange.com/questions/692678
|
1
|
I am using the exam class for my work, and I have found that structuring the space where students fill in their answers can significantly speed up the grading process. To achieve this, I created a new command called `\answerbox`, which generates designated spaces for student responses. Here is the code I implemented for this purpose:
```
\documentclass[answers]{exam}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{amsmath}
% Command for small answer Box
% \answerbox{length}{height}{solution}
% solution is only printed if answers is a class option
% solution argument must not be an environment
% tikz can still be added with \tikz{...}
\newcommand{\answerbox}[3]{%
\pgfmathsetlengthmacro{\halfheight}{0.5*#2cm}
\pgfmathsetlengthmacro{\halfwidth}{0.5*#1cm}
\pgfmathsetlengthmacro{\adjustheight}{-0.45*#2cm}
\ifprintanswers
\raisebox{\adjustheight}{%
\begin{tikzpicture}
\draw (0, 0) rectangle (#1cm, #2cm);
\node at (\halfwidth, \halfheight) {\color{red!75!black}\large\textbf{#3}};
\end{tikzpicture}%
}%
\else
\raisebox{\adjustheight}{%
\begin{tikzpicture}
\draw (0, 0) rectangle (#1cm, #2cm);
\end{tikzpicture}%
}%
\fi
}
\begin{document}
\begin{questions}
\question
\answerbox{3.25}{4}{$\begin{bmatrix}
0.25\\0.25\\0.25\\0.25
\end{bmatrix}$}
\answerbox{4}{2}{Richard Feynman}
\end{questions}
\end{document}
```
I want to expand upon this code snippet and make it more robust. I've done some initial assessment, but I want to be thorough to avoid any future problems, that may cause a lot of work for me/others. I was hoping you could assist me in enhancing it further. If you spot any potential issues or have any insightful suggestions, I'd be extremely grateful.
|
https://tex.stackexchange.com/users/209246
|
Improving my answerbox code for the exam class
| false |
This shows a `\framebox` solution. The default alignment is the baseline of the contents. `\raisebox` aligns the top.
```
\documentclass[answers]{exam}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{amsmath}
% Command for small answer Box
% \answerbox{length}{height}{solution}
% solution is only printed if answers is a class option
% solution argument must not be an environment
% tikz can still be added with \tikz{...}
\newcommand{\answerbox}[3]{% #1 = width, #2 = height, #3 = contents
\bgroup% make changes local
\ifprintanswers
\sbox0{\color{red!75!black}\large\textbf{#3}}% measure contents
\setlength{\fboxsep}{\dimexpr #2cm /2 - 0.5\ht0 - 0.5\dp0}%
\raisebox{\dimexpr \ht\strutbox-\height}{\framebox[#1cm]{\usebox0}}%
\else
\setlength{\fboxsep}{\dimexpr #2cm /2 - 0.5\baselineskip}%
\raisebox{\dimexpr \ht\strutbox-\height}{\framebox[#1cm]{\strut}}%
\fi
\egroup}
\begin{document}
\begin{questions}
\question
\answerbox{3.25}{4}{$\begin{bmatrix}
0.25\\0.25\\0.25\\0.25
\end{bmatrix}$}
\answerbox{4}{2}{Richard Feynman}
\end{questions}
\end{document}
```
---
This centers an answer in a solutionbox.
```
\documentclass[answers]{exam}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{amsmath}
\newcommand{\answerbox}[2]{% #1 = height, #2 = contents
\begin{solutionbox}{#1cm}
\sbox0{\color{red!75!black}\large\textbf{#2}}% measure contents
\strut\par\vskip-\parskip\vskip-\baselineskip\centering
\raisebox{\dimexpr 0.5\dp0-0.5\ht0}[\dimexpr #1cm /2 - 3\fboxsep]%
[\dimexpr #1cm /2 - 3\fboxsep]{\usebox0}
\end{solutionbox}}
\begin{document}
\begin{questions}
\question show a column vector.
\answerbox{4}{$\begin{bmatrix}
0.25\\0.25\\0.25\\0.25
\end{bmatrix}$}
\question Who is buried in Richard Feynman's tomb?
\answerbox{2}{Richard Feynman}
\end{questions}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/34505
|
692688
| 321,345 |
https://tex.stackexchange.com/questions/692672
|
2
|
I was wondering if I can have a named theorem (without number) and still call it by the name is printing. The following is the code in the preamble so that I can give a name to the theorem. (I obtained this code from another post).
```
\theoremstyle{definition}
\newcommand{\thistheoremname}{}
\newtheorem{genericthm}[thm]{\thistheoremname}
\newenvironment{namedthm}[1]
{\renewcommand{\thistheoremname}{#1}%
\begin{genericthm}}
{\end{genericthm}}
\newtheorem*{genericthm*}{\thistheoremname}
\newenvironment{namedthm*}[1]
{\renewcommand{\thistheoremname}{#1}%
\begin{genericthm*}}
{\end{genericthm*}}
```
The following is the what I want the theorem to say. Note I use namedthm\* so that no number appears.
```
\begin{namedthm*}{Theorem A}\label{theoremA} Some text.
\end{namedthm*}
```
When I use Theorem \ref{theoremA}, it doesn't print Theorem A. Is there any way I can get that to print?
Thank you in advance.
|
https://tex.stackexchange.com/users/297854
|
Referencing a theorem by name only
| false |
If you are willing to use the methods of `thmtools` for creating theorem-like environments, then also incorporating `cleveref` and `crossreftools` allows what seems to be an equivalent result.
```
\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\makeatletter
\declaretheoremstyle[
headfont=\sffamily\bfseries,
postheadspace=0.5em,
bodyfont=\slshape,
]{thmstyle}
\declaretheoremstyle[
headfont=\sffamily\bfseries,
postheadspace=0.5em,
notefont=\sffamily\bfseries,
notebraces={}{},
headformat=\let\thmt@space\@empty\NOTE,
bodyfont=\slshape,
]{namedthmstyle}
\makeatother
\declaretheorem[name=Theorem, style=thmstyle]{theorem}
\declaretheorem[
style=namedthmstyle,
name=Theorem,
title = {},
numberlike=theorem,
]{namedtheorem}
\usepackage{hyperref}
\usepackage{cleveref}
\Crefname{theorem}{Theorem}{Theorems}
\usepackage{crossreftools}
\newcommand{\crefthm}[1]{\hyperlink{\crtrefanchor{#1}}{\crtrefname{#1}}}
\begin{document}
\begin{theorem}\label{thm:one}
$1+1 = 2$.
\end{theorem}
\begin{namedtheorem}[Pythagorean theorem]\label{thm:pythagoras}
The square on the hypotenuse of a right triangle equals the sum of the squares on th eother two sides.
\end{namedtheorem}
\begin{theorem}\label{thm:two}
$0 < 1$.
\end{theorem}
Consult \cref{thm:one}, \crefthm{thm:pythagoras}, and \cref{thm:two}.
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/13492
|
692689
| 321,346 |
https://tex.stackexchange.com/questions/75022
|
35
|
There are (some very nice) text fonts which do not have math support. Though there are ways to 'remedy' this, such as the *mathastext* package and some others, these are hardly satisfactory. All accents need to be manually adjusted every time they are used, spacing is a nightmare, and overall the document in general does not look professional. Leading to my
**Question.** How would one, given a text font, design a math package utilizing this font?
In particular, I am not interested (at the moment) in artistic font design issues like shape and slope of letters and such things. Some of the precise issues that I would like to solve are:
* Positions for decorations like bars, tildes, etc.
* Subscript / superscript size and positioning.
* 'Box' sizes and position (I believe this is correct terminology), for instance how much space around an italicized $f$ so that the tail does not overlap the previous letter (an issue that occurs frequently with the remedies mentioned above).
And of course, there is the issue of the math symbols (including arrows, binary operators, greek letters, script alphabets, etc.). Obviously it would be nice to create from scratch my own set of such symbols, but that is far in the future and not an issue for now. Right now, I have symbols I like from a variety of places and packages.
**Example.** The package *fouriernc* is new century schoolbook with fourier math. This is similar to what I want. To design a math font package that is equipped with math symbols from another. (Indeed, fourier is a math set I am considering.)
So, now that the proposal is (relatively, I hope) clear, we return to the question. I don't have experience programming in TeX (though I know C and python quite well) beyond the basics. In particular, I have never done anything beyond what is in document. Thus I haven't a clue on how to begin with this project. Any help would be greatly appreciated.
|
https://tex.stackexchange.com/users/18456
|
How would one design a math font?
| false |
First off, I should warn you that I haven't tried creating anything nearly as difficult as a math font myself.
But with that caveat, the best way would be to create an OpenType font using the [Unicode codepoints for mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode), which you can use with XeLaTeX and the [unicode-math](https://ctan.org/pkg/unicode-math) package. The package includes several fonts you can use as templates whose glyphs you can replace with your own.
See [this](https://tex.stackexchange.com/a/30066/170418) answer for a fairly detailed demonstration of how you would use the `unicode-math` package, and for a look at many of the available fonts.
|
1
|
https://tex.stackexchange.com/users/170418
|
692693
| 321,347 |
https://tex.stackexchange.com/questions/692691
|
1
|
I would like a Beamer slide to consist of a list of questions and answers, but I do not want to expose them all at once. I would like the first exposure to display the first question. The second exposure displays the first question and the first answer. The third exposure shows the first question, first answer, second question, and so on. Easy enough.
It would be nice if this list always started at the same vertical location, so that visually the earlier Qs and As remain fixed as the list grows, but I cannot find a way to force this.
ADDITION This was my first effort
```
\documentclass{beamer}
\begin{document}
{\LARGE
\begin{frame}{\huge List of Questions}
\vspace*{-1in}
\begin{itemize}
\item This is the first question.
\end{itemize}
\end{frame}
\begin{frame}{\huge List of Questions}
\vspace*{-1in}
\begin{itemize}
\item This is the first question.
\item This is the first answer.
\end{itemize}
\end{frame}
\begin{frame}{\huge List of Questions}
\vspace*{-1in}
\begin{itemize}
\item This is the first question.
\item This is the first answer.
\item This is the second question
\end{itemize}
\end{frame}
\begin{frame}{\huge List of Questions}\vspace*{-1in}
\begin{itemize}
\item This is the first question.
\item This is the first answer.
\item This is the second question.
\item This is the second answer.
\end{itemize}
\end{frame}
}
\end{document}
```
|
https://tex.stackexchange.com/users/301275
|
Forcing the location of a list
| false |
Beamer items are overlay aware (see section "3.10 Using Overlay Specifications" in the beamer user guide). This means that you can use e.g. `\item<3-> second question` to specify on which overlay within the frame the item should be revealed.
If you are revealing the items one by one, beamer can even do this automatically for you:
```
\documentclass{beamer}
\setbeamerfont{frametitle}{size=\huge}
\begin{document}
\begin{frame}
\frametitle{List of Questions}
\begin{itemize}[<+->]
\item This is the first question.
\item This is the first answer.
\item This is the second question.
\item This is the second answer.
\end{itemize}
\end{frame}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/36296
|
692695
| 321,348 |
https://tex.stackexchange.com/questions/692690
|
-1
|
I want only article titles in a foreign language to be italicized. Is it possible to impose such a condition with `BibLaTeX`?
|
https://tex.stackexchange.com/users/217339
|
Is it possible to change text formatting in BibLaTeX conditionally?
| true |
You will need to indicate somehow that the article is in a different language from the main document.
I think I'd do this by adding a `langid` field to the bib entry and testing for this in the `title` format.
### Notes
* I've used `babel` with default language `american` and secondary language `ngerman`.
* I've used the `biblatex` option `autolang=hyphen` so that hyphenation for references in German is correct, but language of references remains in English.
* I've added `langid={ngerman}` to the German reference.
* My example is for a `book` entry type (I happened to have some useful bib entries lying around). But the principles are the same for `article` entry types.
```
\documentclass{article}
\begin{filecontents}[overwrite]{\jobname.bib}
@book{wellhausen:1883,
author = {Wellhausen, Julius},
title = {Prolegomena zur Geschichte Israels},
edition = {2},
location = {Berlin},
publisher = {Reimer},
date = {1883},
langid = {ngerman}
}
@book{wellhausen:1885,
author = {Wellhausen, Julius},
title = {Prolegomena to the History of Israel},
translator = {Black, J. Sutherland and Enzies, A.},
preface = {Smith, W. Robertson},
location = {Edinburgh},
publisher = {Black},
related = {wellhausen:1883},
relatedtype = {translationof},
date = {1885}
}
\end{filecontents}
\usepackage[ngerman,american]{babel}
\usepackage{csquotes}
\usepackage[autolang=hyphen]{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat[book]{title}{%
\iffieldundef{langid}
{#1}
{\mkbibemph{#1}}%
}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
```
More sophisticated tests could be used if sometimes you had `langid = {american}` in your bib entry.
|
4
|
https://tex.stackexchange.com/users/87678
|
692700
| 321,351 |
https://tex.stackexchange.com/questions/692698
|
0
|
```
\documentclass{article}
%\documentclass[16pt]{report}
\usepackage[a4paper,text={16.5cm,25.2cm},centering]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage{mdframed}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{nccmath}
\usepackage{dsfont}
\usepackage{cancel}
\usepackage{mathtools}
\usepackage{setspace}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\onehalfspacing
%\doublespacing
\newcommand{\RN}[1]{%
\textup{\uppercase\expandafter{\romannumeral#1}}%
}
\newmdtheoremenv{theo}{Theorem}
%\newenvironment{claim}[1]{\par\noindent\underline{Claim:}\space#1}{}
%\newenvironment{claimproof}[1]{\par\noindent\underline{Proof:}\space#1}{\hfill $\blacksquare$}
\newtheorem*{remark}{Remark}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{claim}{Claim}
\newtheorem{corollary}{Corollary}
\usepackage{graphicx}
\newcommand\smallO{
\mathchoice
{{\scriptstyle\mathcal{O}}}% \displaystyle
{{\scriptstyle\mathcal{O}}}% \textstyle
{{\scriptscriptstyle\mathcal{O}}}% \scriptstyle
{\scalebox{.7}{$\scriptscriptstyle\mathcal{O}$}}%\scriptscriptstyle
}
\title{}
\author{}
\date{}
\begin{document}
\maketitle
\large
\begin{theo}
1+1=2
\end{theo}
\begin{theorem}
\label{generalversion}
1+1=2
\end{theorem}
\end{document}
```
Here is the code of my file. If you compile you'll see that both Theorems have the same numeration. Is it possible to change it?
|
https://tex.stackexchange.com/users/269963
|
Different numeration for Theorems
| true |
1. Don't do `\large` at the beginning of the document
2. Don't use preambles handed out by somebody
3. Don't pile up preambles
Why 1? Because it's wrong. Use the `12pt` option instead.
Why 2? Because most of the times, those preambles suffer from point 3.
Why 3? Because you're likely to get duplications and wrong order of package loading.
Now let's get to the problem. With your code, you're reserving different and independent counters for
```
theo theorem lemma claim corollary
```
Some (bad) styles choose this, with the consequence that readers won't know whether corollary 6 comes earlier or later than theorem 3 or lemma 2.
For a short paper this might be a small problem; in a longer paper or a memoir it would.
How do you reserve just one counter for all theorem-like environments? By defining a main one and by linking all the others to this counter.
```
\documentclass[12pt]{article}
\usepackage[a4paper,text={16.5cm,25.2cm},centering]{geometry}
%\usepackage[utf8]{inputenc} % no longer needed
%\usepackage[english]{babel} % not actually needed
%\usepackage{amsmath}
\usepackage{mathtools}% also loads amsmath
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{dsfont}
\usepackage{nccmath}
\usepackage{cancel}
\usepackage{mdframed}
\usepackage{graphicx}
\usepackage{setspace}
% for mock text, not needed in a real document
\usepackage{lipsum}
% must be last almost all the times
\usepackage{hyperref}
\onehalfspacing
%\doublespacing
\newcommand{\RN}[1]{%
\textup{\uppercase\expandafter{\romannumeral#1}}%
}
\newtheorem{theorem}{Theorem}
\newmdtheoremenv{theo}[theorem]{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem*{remark}{Remark}
\newcommand\smallO{%
\mathchoice
{{\scriptstyle\mathcal{O}}}% \displaystyle
{{\scriptstyle\mathcal{O}}}% \textstyle
{{\scriptscriptstyle\mathcal{O}}}% \scriptstyle
{\scalebox{.7}{$\scriptscriptstyle\mathcal{O}$}}%\scriptscriptstyle
}
\title{}
\author{}
\date{}
\begin{document}
\maketitle
\begin{theo}
1+1=2
\end{theo}
\begin{theorem}
\label{generalversion}
1+1=2
\end{theorem}
\end{document}
```
You probably want to fix the parameters for the framed theorems.
|
3
|
https://tex.stackexchange.com/users/4427
|
692712
| 321,355 |
https://tex.stackexchange.com/questions/122174
|
22
|
How can I make cleveref output `(1)` instead of `eq. (1)` when referencing equations only?
|
https://tex.stackexchange.com/users/4415
|
How to strip "eq." from cleveref?
| false |
In case one wants to do this only locally, and not for the whole document, use `\labelcref{…}` instead of `\cref{…}`.
(This is the same as using `\ref{…}`, except it can also benefit from cleveref's multi-reference functionality).
|
1
|
https://tex.stackexchange.com/users/153868
|
692715
| 321,356 |
https://tex.stackexchange.com/questions/692718
|
0
|
This is my MWE:
```
% !TeX program = xelatex
\documentclass[12pt, parskip]{scrreport}
\usepackage[symbols]{kpfonts-otf}
\setmainfont{KpRoman}
\begin{document}
Hello!
\end{document}
```
When I compile it using `XeLaTeX` I get the following error message:
```
Incomplete \iffalse; all text was ignored after line 206.
```
However, if I switch
```
\usepackage[symbols]{kpfonts-otf}
\setmainfont{KpRoman}
```
to
```
\usepackage{kpfonts-otf}
```
then everything is fine.
But I really want to use the former one since I want to use some options with `\setmathfont` (which is not included in my MWE).
How can I fix this?
|
https://tex.stackexchange.com/users/301048
|
Error: Incomplete \iffalse; all text was ignored after line 206. when using Kpfonts-otf
| true |
This should be reported to the author of the package, it's missing `\fi` on line 270
```
\fi
\fi
\fi%<<<<<<<<<<<<<<<<<<<<<<<missing
\ifkp@symbols
```
|
2
|
https://tex.stackexchange.com/users/1090
|
692720
| 321,358 |
https://tex.stackexchange.com/questions/78226
|
16
|
I'd like to typeset two chunks of text (a problem statement and solution) next to each other, but I don't want the problem to be the last thing on a page and the solution to be the first thing on the next page. Is there a way to get LaTeX to try to keep them together if they occur at a page boundary — for example, by pushing a few lines of the problem onto the solution page, or vice versa? (Each paragraph/section can be broken individually, but I would like the boundary to be on one page.)
|
https://tex.stackexchange.com/users/7412
|
How can I tie two pieces of text together so LaTeX tries not to break exactly between them?
| false |
My solution was to keep both pieces of text in a minipage environment.
I first had:
```
They were the first Hamkens on the Hamkenshof. In the distance we see more
upright sandstones, to the right and left of the door to a mausoleum. Here
lie the Gonnens, including the parents of Mrs. Ponke. North of the church we
find the gravestone of
\bigskip
\centerline{Councilor \personname{Peter Hamkens} (B 16)}
```
I wanted to keep the text explanation on the same page as the inscription "Councilor Peter Hamkens" on the gravestone, but these were often separated.
Neither `\nopagebreak` nor the `samepage` environment worked for me.
I simply put both the text and the inscription in a minipage, which is treated as a single line by LaTeX:
```
\noindent
\begin{minipage}{1\textwidth}
They were the first Hamkens on the Hamkenshof. In the distance we see more
upright sandstones, to the right and left of the door to a mausoleum. Here
lie the Gonnens, including the parents of Mrs. Ponke. North of the church we
find the gravestone of
\bigskip
\centerline{Councilor \personname{Peter Hamkens} (B 16)}
\end{minipage}
```
It worked great and didn't require using any new packages.
|
1
|
https://tex.stackexchange.com/users/301114
|
692734
| 321,364 |
https://tex.stackexchange.com/questions/692735
|
1
|
I am creating fill-in the blank notes for my class using the Censor package, a solution I found on this forum [here](https://tex.stackexchange.com/questions/220723/enhanced-fill-in-the-blank-document).
What I can't figure out is how to make the blanks for my students to fill in longer -- ie, I don't want **text** to be **\_\_\_\_** but more like **\_\_\_\_\_\_\_\_\_\_\_\_** since most people don't have tiny, perfect handwriting. Is there a way to add a multiplier to the length of the blank or replace a character with, say, two or three underscores instead of one so that normal people can fit their handwriting in one of the blanks?
If someone has a different, cleaner solution that would be great too; the post explains the gist of what I need to do.
|
https://tex.stackexchange.com/users/301900
|
Fill in the Blank Notes Using Censor
| false |
Taking the code at the referenced question, I have modified `\censor@box` to print a double-wide box and `\@cenword` to print a double-wide underline.
```
\documentclass{article}
\usepackage{censor,xcolor}
\censorruledepth=-.2ex
\censorruleheight=.1ex
\makeatletter
\renewcommand\StopCensoring{%
\def\censor##1{\textcolor{blue}{##1}}%
\def\censorbox##1{\bgroup\color{blue}\un@censorbox{##1}\egroup}%
\let\xblackout\blackout%
}
\renewcommand\censor@box[2][]{\fboxsep=0pt\fbox{\color{white}%
#1\setbox0\hbox{#2#2}% <---DOUBLE-WIDE BOX
\rule[-\the\dp0]{\the\wd0}{\the\ht0+\the\dp0}}}
\renewcommand\@cenword[1]{\censorrule{\widthofpbox{#1#1}}}% <--- DOUBLE WIDE UNDERLINE
\makeatother
\begin{document}
And the answer is \censor{forty two}.
\StopCensoring
And the answer is \censor{forty two}.
\RestartCensoring
The beginning six words of the Gettysburg Address are \blackout{Four score and seven years ago}.
\StopCensoring
The beginning six words of the Gettysburg Address are \blackout{Four score and seven years ago}.
\RestartCensoring
The tabular answer is
\censorbox{\begin{tabular}{|c|c|}\hline a & b\\ \hline\end{tabular}}
\StopCensoring
The tabular answer is
\censorbox{\begin{tabular}{|c|c|}\hline a & b\\ \hline\end{tabular}}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/25858
|
692736
| 321,365 |
https://tex.stackexchange.com/questions/692737
|
-1
|
This is the section and the citation that doesn't work is EDEL.
```
\chapter{Literature Review}
\section{Humpback Whale Biomimicry}
... \cite{Edel1978} ... \cite{Li2020} ...
```
This is how the entry is defined in the bibliography file:
```
@article{Edel1978,
author = {R. K. Edel and H. E. Winn},
doi = {10.1007/BF00397155},
issn = {0025-3162},
issue = {3},
journal = {Marine Biology},
pages = {279-287},
title = {Observations on underwater locomotion and flipper
movement of the humpback whale Megaptera novaeangliae},
volume = {48},
year = {1978},
}
```
|
https://tex.stackexchange.com/users/301901
|
I am sure my reference is correct but I am getting error package natbib warning citation undefined
| false |
There is no error in the code shown, I show the terminal output at each stage (after making a usable example from your code fragment)
---
dd978.tex
```
\documentclass{book}
\usepackage{natbib}
\begin{document}
\chapter{Literature Review}
\section{Humpback Whale Biomimicry}
... \cite{Edel1978} ...
\bibliographystyle{plainnat}
\bibliography{xbib}
\end{document}
```
---
xbib.bib
```
@article{Edel1978,
author = {R. K. Edel and H. E. Winn},
doi = {10.1007/BF00397155},
issn = {0025-3162},
issue = {3},
journal = {Marine Biology},
pages = {279-287},
title = {Observations on underwater locomotion and flipper
movement of the humpback whale Megaptera novaeangliae},
volume = {48},
year = {1978},
}
```
---
pdflatex dd978
```
Package natbib Warning: Citation `Edel1978' on page 1 undefined on input line 9
.
No file dd978.bbl.
Package natbib Warning: There were undefined citations.
```
bibtex dd978
```
This is BibTeX, Version 0.99d (TeX Live 2023)
The top-level auxiliary file: dd978.aux
The style file: plainnat.bst
Database file #1: xbib.bib
```
pdflatex dd978
```
Package natbib Warning: Citation `Edel1978' on page 1 undefined on input line 9
.
(./dd978.bbl [1{/usr/local/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdfte
x.map}] [2])
Package natbib Warning: There were undefined citations.
[3] (./dd978.aux
Package natbib Warning: Citation(s) may have changed.
(natbib) Rerun to get citations correct.
```
pdflatex dd978
```
Output written on dd978.pdf (3 pages, 57128 bytes).
Transcript written on dd978.log.
```
|
2
|
https://tex.stackexchange.com/users/1090
|
692739
| 321,366 |
https://tex.stackexchange.com/questions/692737
|
-1
|
This is the section and the citation that doesn't work is EDEL.
```
\chapter{Literature Review}
\section{Humpback Whale Biomimicry}
... \cite{Edel1978} ... \cite{Li2020} ...
```
This is how the entry is defined in the bibliography file:
```
@article{Edel1978,
author = {R. K. Edel and H. E. Winn},
doi = {10.1007/BF00397155},
issn = {0025-3162},
issue = {3},
journal = {Marine Biology},
pages = {279-287},
title = {Observations on underwater locomotion and flipper
movement of the humpback whale Megaptera novaeangliae},
volume = {48},
year = {1978},
}
```
|
https://tex.stackexchange.com/users/301901
|
I am sure my reference is correct but I am getting error package natbib warning citation undefined
| false |
You say that you want to format the bibliographic entries according to APA6 or APA7 guidelines. I would therefore like to suggest that you **not** use the `natbib` citation management package.
To get formatting according to APA6 guidelines, do use the `apacite` citation management package (with option `natbibapa` if you wish to use `\citet` and `\citep`) and the `apacite` bibliography style. (To get formatting according to APA7 guidelines, you'll need to switch to biblatex/biber.)
And, be sure to run LaTeX, BibTeX, and LaTeX twice more in order to fully propagate any changes.
```
\documentclass{article} % or {book}
\begin{filecontents}[overwrite]{xbib.bib}
@article{Edel1978,
author = {R. K. Edel and H. E. Winn},
doi = {10.1007/BF00397155},
issn = {0025-3162},
issue = {3},
journal = {Marine Biology},
pages = {279--287},
title = {Observations on underwater locomotion and flipper
movement of the humpback whale {Megaptera} novaeangliae},
volume = {48},
year = {1978},
}
\end{filecontents}
\usepackage[natbibapa]{apacite}
\bibliographystyle{apacite}
\usepackage{xurl}
\usepackage[colorlinks,allcolors=blue]{hyperref} % optional
\hyphenation{novae-angliae mega-ptera}
\begin{document}
\section{Humpback whale biomimicry}
\dots\ \citet{Edel1978} \dots
\bibliography{xbib}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/5001
|
692740
| 321,367 |
https://tex.stackexchange.com/questions/692634
|
2
|
How to make the below `\NewDocumentEnvironment` 3rd argument optional verbatim (optional that escapes special LaTeX characters)?
Below is the 3 ways for how to the custom style: (Keep in mind that the below code is for `[mmoo]` not for `[mmvo]` and you need to escape each character to render successfully)
```
\documentclass[11pt,letterpaper]{article} % Use the custom resume.cls style
\usepackage[left=0.4 in,top=0.4in,right=0.4 in,bottom=0.4in]{geometry} % Document margins
\usepackage[parfill]{parskip} % Remove paragraph indentation
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
\usepackage{ifthen} % Required for ifthenelse statements
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=blue,
}
\usepackage{xparse} % For Projects Formatting
\pagestyle{empty} % Suppress page numbers
%----------------------------------------------------------------------------------------
% SECTION FORMATTING
%----------------------------------------------------------------------------------------
% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
\sectionskip
\MakeUppercase{
%\small %I personally wrote it for testing purposes
{\bf #1}} % Section title
\sectionlineskip
\hrule % Horizontal line
\begin{list}{}{ % List for each individual item in the section
\setlength{\leftmargin}{0em} % Margin within the section
%\small %I personally wrote it for testing purposes
}
\item[]
}{
\end{list}
}
%----------------------------------------------------------------------------------------
% Projects FORMATTING
%----------------------------------------------------------------------------------------
\NewDocumentEnvironment{rProjects}{mmoo}{ % 2 mandatory arguments and 2 optional argument, project name, project description, project link, link name
\textbf{#1}. {#2} % Bold project name then description
\IfValueT{#3}{
\ifthenelse{\equal{#4}{}} % Project Link & Name
{\hfill \href{#3}{GitHub Link}}
{\hfill \href{#3}{#4}}
}\smallskip
}{}
%----------------------------------------------------------------------------------------
% Itemize FORMATTING
%----------------------------------------------------------------------------------------
\newenvironment{rItemize}{\begin{itemize}
\raggedright
\itemsep 0pt {}
%\small
%\parskip 0pt {}
}
{\end{itemize}}
%----------------------------------------------------------------------------------------
% The below commands define the whitespace after certain things in the document - they can be \smallskip, \medskip or \bigskip
\def\sectionlineskip{\medskip} % The space above the horizontal line for each section
\def\sectionskip{\medskip} % The space after the heading section
\begin{document}
\begin{rSection}{PROJECTS}
\begin{rProjects}{Project name}{description}
\begin{rItemize}
\item Achieved X\% growth for XYZ using A, B, and C skills.
\item Led XYZ which led to X\% of improvement in ABC.
\item Developed XYZ that did A, B, and C using X, Y, and Z.
\end{rItemize}
\end{rProjects}
\begin{rProjects}{Project name}{description.}[https://github.com/OmarShawky1/CS-Roadmap\#projects][]
\begin{rItemize}
\item Achieved X\% growth for XYZ using A, B, and C skills.
\item Led XYZ which led to X\% of improvement in ABC.
\item Developed XYZ that did A, B, and C using X, Y, and Z.
\end{rItemize}
\end{rProjects}
\begin{rProjects}{Project name}{description}[https://github.com/OmarShawky1/CS-Roadmap\#projects][Project Link]
\begin{rItemize}
\item Achieved X\% growth for XYZ using A, B, and C skills.
\item Led XYZ which led to X\% of improvement in ABC.
\item Developed XYZ that did A, B, and C using X, Y, and Z.
\end{rItemize}
\end{rProjects}
\end{rSection}
\end{document}
```
This is a follow up question from [this question](https://tex.stackexchange.com/questions/692627/how-to-escape-special-characters-passed-as-arguments-to-new-environment).
|
https://tex.stackexchange.com/users/296109
|
How to make verbatim option optional in my \NewDocumentEnvironment?
| true |
Here, I use the `tokcycle` package to massage argument `#3` into a more usable form. As it stands, it can handle `#`, `\`, and `$` characters. Changes may be needed to the `\Characterdirective` to handle other special characters. (if you tell me what is needed, I can add/test for them).
```
\documentclass[11pt,letterpaper]{article} % Use the custom resume.cls style
\usepackage[T1]{fontenc}
\usepackage[left=0.4 in,top=0.4in,right=0.4 in,bottom=0.4in]{geometry} % Document margins
\usepackage[parfill]{parskip} % Remove paragraph indentation
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
\usepackage{ifthen} % Required for ifthenelse statements
\usepackage{tokcycle}
%\Characterdirective{...}% may be needed for other special characters
\Macrodirective{\addcytoks[1]{\string#1}}% needed for backslash
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=blue,
}
\usepackage{xparse} % For Projects Formatting
\pagestyle{empty} % Suppress page numbers
%----------------------------------------------------------------------------------------
% SECTION FORMATTING
%----------------------------------------------------------------------------------------
% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
\sectionskip
\MakeUppercase{
%\small %I personally wrote it for testing purposes
{\bf #1}} % Section title
\sectionlineskip
\hrule % Horizontal line
\begin{list}{}{ % List for each individual item in the section
\setlength{\leftmargin}{0em} % Margin within the section
%\small %I personally wrote it for testing purposes
}
\item[]
}{
\end{list}
}
%----------------------------------------------------------------------------------------
% Projects FORMATTING
%----------------------------------------------------------------------------------------
\NewDocumentEnvironment{rProjects}{mmoo}{ % 2 mandatory arguments and 2 optional argument,
%project name, project description, project link, link name
\textbf{#1}. {#2} % Bold project name then description
\IfValueT{#3}{%
\tokcyclexpress{#3}%
\ifthenelse{\equal{#4}{}} % Project Link & Name
{\hfill \expandafter\href\expandafter{\the\cytoks}{GitHub Link}}
{\hfill \expandafter\href\expandafter{\the\cytoks}{#4}}
}\smallskip
}{}
%----------------------------------------------------------------------------------------
% Itemize FORMATTING
%----------------------------------------------------------------------------------------
\newenvironment{rItemize}{\begin{itemize}
\raggedright
\itemsep 0pt {}
%\small
%\parskip 0pt {}
}
{\end{itemize}}
%----------------------------------------------------------------------------------------
% The below commands define the whitespace after certain things in the document - they can
% be \smallskip, \medskip or \bigskip
\def\sectionlineskip{\medskip} % The space above the horizontal line for each section
\def\sectionskip{\medskip} % The space after the heading section
\begin{document}
\begin{rSection}{PROJECTS}
\begin{rProjects}{Project name}{description}
\begin{rItemize}
\item Achieved X\% growth for XYZ using A, B, and C skills.
\item Led XYZ which led to X\% of improvement in ABC.
\item Developed XYZ that did A, B, and C using X, Y, and Z.
\end{rItemize}
\end{rProjects}
\begin{rProjects}{Project name}{description.}
[https://github.com/OmarShawky1/CS-Roadmap#projects\subname$][]
\begin{rItemize}
\item Achieved X\% growth for XYZ using A, B, and C skills.
\item Led XYZ which led to X\% of improvement in ABC.
\item Developed XYZ that did A, B, and C using X, Y, and Z.
\end{rItemize}
\end{rProjects}
\begin{rProjects}{Project name}{description}
[https://github.com/OmarShawky1/CS-Roadmap#projects][Project Link]
\begin{rItemize}
\item Achieved X\% growth for XYZ using A, B, and C skills.
\item Led XYZ which led to X\% of improvement in ABC.
\item Developed XYZ that did A, B, and C using X, Y, and Z.
\end{rItemize}
\end{rProjects}
\end{rSection}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/25858
|
692748
| 321,371 |
https://tex.stackexchange.com/questions/692731
|
0
|
is there a way to make the first row in a tabbing environment bold?
```
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{libertinus}
\usepackage[utf8]{inputenc}
\usepackage[greek,ngerman]{babel}
\begin{document}
\begin{tabbing}
τερπικέραυνος:~~ \= (1) Ende, Ziel, Grenze, Limit, (2) Kulmination, höchster Punkt, Ziel, Preis, (3) höchste Macht, Suprema\kill
τεράτευμα: \> Jongliertrick\\
τερατογόνος: \> die Geburt eines Ungeheuers/eine Missgeburt begünstigen\\
τερέω: \> durchbohren, stechen\\
\end{tabbing}
\end{document}
```
In this case I want all the greek words bold, but I don't want to use \bfseries again and again.
Is there a way to automat this?
~
|
https://tex.stackexchange.com/users/9666
|
Autoformat in tabbing environment
| true |
You could try `tabularry`:
```
\documentclass[12pt]{article}
\usepackage{libertinus}
\usepackage[greek,ngerman]{babel}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{column{1}={font=\bfseries,l}, column{2}={l}}
τερπικέραυνος:~~ & {(1) Ende, Ziel, Grenze, Limit, \\
(2) Kulmination, höchster Punkt, Ziel, Preis, \\
(3) höchste Macht, Suprema} \\
τεράτευμα: & Jongliertrick \\
τερατογόνος: & die Geburt eines Ungeheuers/eine Missgeburt begünstigen \\
τερέω: & durchbohren, stechen \\
\end{tblr}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/29873
|
692751
| 321,374 |
https://tex.stackexchange.com/questions/692752
|
2
|
I am using the `xr` and `cleveref` packages to reference figures in another document, using the same figure and table numbers as the other document, as shown [here](https://tex.stackexchange.com/a/294097/56465). However, for non-floating figures and tables, I can't use the `\@captype` used in `\extref`. Therefore, I'd like to get the `cleveref` **type** of a given reference. However, I have been unable to find a technique for this.
Here's a MWE without `xr` and the external document (because I don't think those complications are important for this question, unless there's no way to extract the `cleveref` type).
Updated MWE (showing more precisely the problem):
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{cleveref}
\usepackage{caption}
\makeatletter
\newcommand{\extref}[1]{%
\@namedef{the\@captype}{\ref{#1}}%
}
\makeatother
\begin{document}
\begin{center}
\includegraphics{example-image-a.jpg}
\captionof{figure}{caption\label{fig:example}}
\end{center}
\begin{center}
\includegraphics{example-image-a.jpg}
\extref{fig:example}
\captionof{figure}{repeated}
\end{center}
Here is a reference: \cref{fig:example}.
\end{document}
```
|
https://tex.stackexchange.com/users/56465
|
Get cleveref type, only
| true |
That's what `\namecref` is for:
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{cleveref}
\begin{document}
\begin{figure}
\includegraphics{example-image-a.jpg}
\caption{caption\label{fig:example}}
\end{figure}
Here is a reference: \cref{fig:example}.
Now I want to know the label type: \namecref{fig:example}
\end{document}
```
**Edit**: Getting the type proper, instead of the type name, as requested in the comments:
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{cleveref}
\makeatletter
\newcommand{\mycreftype}[1]{%
\cref@gettype{#1}{\@mytempvar}%
\@mytempvar}
\makeatother
\begin{document}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a.jpg}
\caption{caption\label{fig:example}}
\end{figure}
Here is a reference: \cref{fig:example}.
Now I want to know the label type: \mycreftype{fig:example}
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/105447
|
692754
| 321,375 |
https://tex.stackexchange.com/questions/692568
|
2
|
I am using TeX Live 2023, TeX 3.141592653, LuaHBTeX 1.16.0, Latexmk 4.79 on Windows 10.
**Short description:**
I have a MWE that compiles without problems by doing `lualatex -> biber -> lualatex -> lualatex`. When using `latexmk -lualatex` the last run of lualatex does not happen. If calling `lualatex` afterwards again, everything works out.
MWE Code:
```
\documentclass{scrartcl}
\usepackage{biblatex}
\addbibresource{../Literatur/literatur_test.bib}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{Introduction}
Citation 1 \cite{Aas2021} and a label \label{test_label}
\section{Another Section}
Citation 2 \cite{Lundberg2017} and a reference \ref{test_label}
\printbibliography
\end{document}
```
Relevant part of the `.bib` file:
```
@Article{Aas2021,
author = {Kjersti Aas and Martin Jullum and Anders L{\o}land},
date = {2021},
journaltitle = {Artificial Intelligence},
title = {Explaining individual predictions when features are dependent: More accurate approximations to Shapley values},
doi = {10.1016/j.artint.2021.103502},
pages = {103502},
volume = {298},
abstract = {Explaining complex or seemingly simple machine learning models is an important practical problem. We want to explain individual predictions from such models by learning simple, interpretable explanations. Shapley value is a game theoretic concept that can be used for this purpose. The Shapley value framework has a series of desirable theoretical properties, and can in principle handle any predictive model. Kernel SHAP is a computationally efficient approximation to Shapley values in higher dimensions. Like several other existing methods, this approach assumes that the features are independent. Since Shapley values currently suffer from inclusion of unrealistic data instances when features are correlated, the explanations may be very misleading. This is the case even if a simple linear model is used for predictions. In this paper, we extend the Kernel SHAP method to handle dependent features. We provide several examples of linear and non-linear models with various degrees of feature dependence, where our method gives more accurate approximations to the true Shapley values.},
day = {31},
keywords = {Feature attribution, Shapley values, Kernel SHAP, Dependence},
publisher = {Elsevier {BV}},
year = {2021},
}
@InProceedings{Lundberg2017,
author = {Lundberg, Scott and Lee, Su-In},
booktitle = {Advances in Neural Information Processing Systems},
date = {2017},
title = {A unified approach to interpreting model predictions},
pages = {4765--4774},
}
```
**Manual attempt**: I cleaned up everything, there is only the `.tex` file in the directory. Calling `lualatex` on that gives (excerpt):
```
[...]
No file Main.toc.
LaTeX Warning: Citation 'Aas2021' on page 1 undefined on input line 11.
LaTeX Warning: Citation 'Lundberg2017' on page 1 undefined on input line 14.
LaTeX Warning: Reference `test_label' on page 1 undefined on input line 14.
LaTeX Warning: Empty bibliography on input line 16.
[1{c:/MeineProgramme/TeXLive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map}
] (./Main.aux)
LaTeX Warning: There were undefined references.
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
Package rerunfilecheck Warning: File `Main.out' has changed.
(rerunfilecheck) Rerun to get outlines right
(rerunfilecheck) or use package `bookmark'.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) Main
(biblatex) and rerun LaTeX afterwards.
[...]
```
Running `biber` gives only a warning about `8 characters of junk seen at toplevel`.
Running `lualatex` again gives (excerpt):
```
[...]
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please rerun LaTeX.
[...]
```
Running `lualatex` for the third time in total produces no warning and leads to the expected result in a PDF file.
**`latexmk` attempt**: I cleaned up everything, there is only the `.tex` file in the directory. When running `latexmk -lualatex` the expected behavior is, that it runs `lualatex` and `biber` as often as needed. Produced output (full):
```
L:[...]\Dokument>latexmk --lualatex
Initial Win CP for (console input, console output, system): (CP437, CP437, CP1252)
I changed them all to CP1252
Rc files read:
NONE
Latexmk: This is Latexmk, John Collins, 7 Jan. 2023. Version 4.79.
No existing .aux file, so I'll make a simple one, and require run of *latex.
Latexmk: applying rule 'lualatex'...
Rule 'lualatex': Reasons for rerun
Category 'other':
Rerun of 'lualatex' forced or previously required
------------
Run number 1 of rule 'lualatex'
------------
------------
Running 'lualatex -recorder "Main.tex"'
------------
This is LuaHBTeX, Version 1.16.0 (TeX Live 2023)
restricted system commands enabled.
(./Main.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22>
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrartcl.cls
Document Class: scrartcl 2022/10/12 v3.38 KOMA-Script document class (article)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrkbase.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrbase.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrlfile.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrlfile-hook.
sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrlogo.sty)))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/graphics/keyval.sty)))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/tocbasic.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrsize11pt.cl
o)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/typearea.sty))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/biblatex.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.st
y
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/iftex/iftex.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/logreq/logreq.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/logreq/logreq.def))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/base/ifthen.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/url/url.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/blx-dm.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/blx-unicode.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/blx-compat.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/biblatex.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/bbx/standard.bbx)
) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/cbx/numeric.cbx
) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/biblatex.cfg)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/l3backend/l3backend-luatex
.def))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/blx-case-expl3.st
y
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/l3packages/xparse/xparse.s
ty)))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/hyperref.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/kvdefinekeys/kvdefinekey
s.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/pdfescape/pdfescape.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hycolor/hycolor.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/letltxmacro/letltxmacro.st
y) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/auxhook/auxhook.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/nameref.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/refcount/refcount.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/gettitlestring/gettitles
tring.sty))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/pd1enc.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/intcalc/intcalc.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/puenc.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/bitset/bitset.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/bigintcalc/bigintcalc.st
y)) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/base/atbegshi-ltx.sty)
) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/hluatex.def
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/stringenc/stringenc.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/base/atveryend-ltx.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/rerunfilecheck/rerunfilech
eck.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/uniquecounter/uniquecoun
ter.sty))) (./Main.aux)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/base/ts1cmr.fd)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/lbx/english.lbx)
No file Main.bbl.
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/bookmark/bookmark.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/bookmark/bkm-pdftex.def))
No file Main.toc.
LaTeX Warning: Citation 'Aas2021' on page 1 undefined on input line 11.
LaTeX Warning: Citation 'Lundberg2017' on page 1 undefined on input line 14.
LaTeX Warning: Reference `test_label' on page 1 undefined on input line 14.
LaTeX Warning: Empty bibliography on input line 16.
[1{c:/MeineProgramme/TeXLive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map}
] (./Main.aux)
LaTeX Warning: There were undefined references.
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
Package rerunfilecheck Warning: File `Main.out' has changed.
(rerunfilecheck) Rerun to get outlines right
(rerunfilecheck) or use package `bookmark'.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) Main
(biblatex) and rerun LaTeX afterwards.
)
491 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 65 glue_spec
, 4 attribute_list, 1 write nodes
avail lists: 1:2,2:135,3:75,4:4,5:42,6:15,7:562,9:99,10:1,11:42
<c:/MeineProgramme/TeXLive/2023/texmf-dist/fonts/opentype/public/lm/lmroman10-b
old.otf><c:/MeineProgramme/TeXLive/2023/texmf-dist/fonts/opentype/public/lm/lmr
oman10-regular.otf><c:/MeineProgramme/TeXLive/2023/texmf-dist/fonts/opentype/pu
blic/lm/lmsans10-bold.otf>
Output written on Main.pdf (1 page, 10772 bytes).
Transcript written on Main.log.
Latexmk: fls file doesn't appear to have been made.
Latexmk: Getting log file 'Main.log'
Latexmk: Examining 'Main.log'
Latexmk: Missing bbl file 'Main.bbl' in following:
No file Main.bbl.
Latexmk: Missing input file 'Main.toc' (or dependence on it) from following:
No file Main.toc.
Latexmk: References changed.
Latexmk: References changed.
Latexmk: Log file says output to 'Main.pdf'
Latexmk: Bibliography file(s) form .bcf file:
../Literatur/literatur_test.bib
Latexmk: applying rule 'biber Main'...
Rule 'biber Main': Reasons for rerun
Category 'other':
Rerun of 'biber Main' forced or previously required
------------
Run number 1 of rule 'biber Main'
------------
------------
Running 'biber "Main.bcf"'
------------
INFO - This is Biber 2.19
INFO - Logfile is 'Main.blg'
INFO - Reading 'Main.bcf'
INFO - Found 2 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex file '../Literatur/literatur_test.bib' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source '../Literatur/literatur_test.bib'
INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable'
INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized'
INFO - Sorting list 'nty/global//global/global' of type 'entry' with template 'nty' and locale 'en-US'
INFO - No sort tailoring available for locale 'en-US'
INFO - Writing 'Main.bbl' with encoding 'UTF-8'
INFO - Output to Main.bbl
Latexmk: Found biber source file(s) [../Literatur/literatur_test.bib Main.bcf]
Latexmk: applying rule 'lualatex'...
Rule 'lualatex': Reasons for rerun
Changed files or newly in use/created:
Main.aux
Main.bbl
Main.toc
------------
Run number 2 of rule 'lualatex'
------------
------------
Running 'lualatex -recorder "Main.tex"'
------------
This is LuaHBTeX, Version 1.16.0 (TeX Live 2023)
restricted system commands enabled.
(./Main.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22>
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrartcl.cls
Document Class: scrartcl 2022/10/12 v3.38 KOMA-Script document class (article)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrkbase.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrbase.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrlfile.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrlfile-hook.
sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrlogo.sty)))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/graphics/keyval.sty)))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/tocbasic.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/scrsize11pt.cl
o)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/koma-script/typearea.sty))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/biblatex.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.st
y
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/iftex/iftex.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/logreq/logreq.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/logreq/logreq.def))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/base/ifthen.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/url/url.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/blx-dm.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/blx-unicode.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/blx-compat.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/biblatex.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/bbx/standard.bbx)
) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/cbx/numeric.cbx
) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/biblatex.cfg)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/l3backend/l3backend-luatex
.def))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/blx-case-expl3.st
y
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/l3packages/xparse/xparse.s
ty)))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/hyperref.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/kvdefinekeys/kvdefinekey
s.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/pdfescape/pdfescape.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hycolor/hycolor.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/letltxmacro/letltxmacro.st
y) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/auxhook/auxhook.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/nameref.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/refcount/refcount.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/gettitlestring/gettitles
tring.sty))
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/pd1enc.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/intcalc/intcalc.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/puenc.def)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/bitset/bitset.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/bigintcalc/bigintcalc.st
y)) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/base/atbegshi-ltx.sty)
) (c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/hyperref/hluatex.def
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/stringenc/stringenc.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/base/atveryend-ltx.sty)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/rerunfilecheck/rerunfilech
eck.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/generic/uniquecounter/uniquecoun
ter.sty))) (./Main.aux)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/base/ts1cmr.fd)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/biblatex/lbx/english.lbx)
(./Main.bbl) (./Main.out) (./Main.out)
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/bookmark/bookmark.sty
(c:/MeineProgramme/TeXLive/2023/texmf-dist/tex/latex/bookmark/bkm-pdftex.def))
(./Main.toc) [1{c:/MeineProgramme/TeXLive/2023/texmf-var/fonts/map/pdftex/updma
p/pdftex.map}] (./Main.aux)
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please rerun LaTeX.
)
506 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 68 glue_spec
, 4 attribute_list, 1 write nodes
avail lists: 1:2,2:333,3:229,4:4,5:111,6:36,7:2309,8:28,9:195,10:2,11:198
<c:/MeineProgramme/TeXLive/2023/texmf-dist/fonts/opentype/public/lm/lmmono10-re
gular.otf><c:/MeineProgramme/TeXLive/2023/texmf-dist/fonts/opentype/public/lm/l
mromancaps10-regular.otf><c:/MeineProgramme/TeXLive/2023/texmf-dist/fonts/opent
ype/public/lm/lmroman10-italic.otf><c:/MeineProgramme/TeXLive/2023/texmf-dist/f
onts/opentype/public/lm/lmroman10-regular.otf><c:/MeineProgramme/TeXLive/2023/t
exmf-dist/fonts/opentype/public/lm/lmsans10-bold.otf>
Output written on Main.pdf (1 page, 21098 bytes).
Transcript written on Main.log.
Latexmk: fls file doesn't appear to have been made.
Latexmk: Getting log file 'Main.log'
Latexmk: Examining 'Main.log'
Latexmk: Found input bbl file 'Main.bbl'
Latexmk: Log file says output to 'Main.pdf'
Latexmk: Bibliography file(s) form .bcf file:
../Literatur/literatur_test.bib
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
lualatex: gave an error
----------------------
This message may duplicate earlier message.
Latexmk: Failure in processing file 'Main.tex':
*LaTeX didn't generate the expected log file 'Main.log'
----------------------
Latexmk: If appropriate, the -f option can be used to get latexmk
to try to force complete processing.
Reverting Windows console CPs to (in,out) = (437,437)
C:\MeineProgramme\texlive\2023\bin\windows\runscript.tlu:921: command failed with exit code 12:
perl.exe c:\MeineProgramme\TeXLive\2023\texmf-dist\scripts\latexmk\latexmk.pl --lualatex
```
The output shows errors, but the produced PDF seems to be fine. When running `lualatex` again now, it runs without problems or errors.
Is it a problem of `lualatex` to request a third run at the end or is it correct to run three times and `latexmk` falsely does not fulfill this request of `lualatex`?
**Edit after update of latexmk:**
After updating to latexmk 4.80 everything worked without errors. There is only the warning
```
Latexmk: I am working around an offset relative to my system time by
-38 secs for file times in directory ''.
This **probably** indicates that
(a) I (latexmk) am running on one computer, while the filesystem is
hosted on a different computer/
(b) There is a substantial time offset between system times on the two
computers.
(c) Therefore at least one of the computers has a misconfigured operating
system such that its system time is not correctly synchronized with a
time server.
These issues are likely to cause problems with other software, and any
such operating-system misconfigurations should be corrected. By default
current operating systems are configured to correctly synchronize system
time when they are connected to the Internet
```
This is probably the case because I am working with an file server that seems to have the time set differently.
|
https://tex.stackexchange.com/users/301746
|
latexmk seems to miss the last, required rerun of *latex
| true |
**Puzzles in output:**
Near the end of the output listing, latexmk says that it didn't complete processing because there were errors. That's enough to explain why too few runs of lualatex were made.
However, the reported error was that the expected log file wasn't made. That seems contradictory, since two runs of lualatex were successful, and necessarily generated a log file. There's also a warning the the fls file was not made, even though a successful run of lualatex with the -recorder option would have generated the file. Moreover the OP had no problem running lualatex and biber separately.
So the error report from latexmk implies that there is some anomaly, but it must be of a strange kind. (And the error message could be more helpful.)
**Resolution:**
It turns out that this problem had already been reported, and latexmk updated to v. 4.80. Simply updating TeXLive was enough to get latexmk to compile the document correctly. It also provided a message, quoted at the end of the edited question, about a mismatch of the system clocks on the computer running latexmk and the computer hosting the source files of the document. As explained in the message, that mismatch should be corrected.
That leaves the oddity of why that problem with the system clocks should have caused trouble with the previous version of latexmk.
**What went wrong:**
After a run of \*latex, latexmk gets dependency information from the .fls and .log files. Under certain misconfigurations or under certain error conditions, the files may fail to be generated, or generated in the wrong directory, or with the wrong name. In that case files with the expected names may exist but be relics from a previous run. Latexmk has to detect this situation, otherwise it gets out-of-date dependency information, which messes up its functioning.
Now the modification time of an relic file will be earlier than that of the new run of \*latex. So latexmk asks whether or not the modification times were earlier than the run time, and if they are earlier it concludes that the files are relics of an earlier run and weren't generated on the latest run. Hence the error message. (The logic of how latexmk deals with this wasn't fully correct, so latexmk ran lualatex twice instead of stopping after the first run.)
With a mismatch of system clocks, the generated files can look as if they were generated before the run of lualatex started. The current version of latexmk does a measurement of the mismatch when needed, so it can work correctly.
|
3
|
https://tex.stackexchange.com/users/8495
|
692757
| 321,378 |
https://tex.stackexchange.com/questions/50988
|
12
|
I am using the `\ContinuedFloat` command of the `subfig` package to print a series of figures in more than one page. I would like to have one caption in the List of Figures and "compress" the pages so that only the first and the last are shown.
EDIT: Since I am using also the `cleveref` package, I would like to have a link for both the pages. So it should be 2 --> links to page 2, 3 --> links to page 3, and the hyphen that is a "neutral" symbol.
For example, what I get now is:
**List of Figures**
1. A result that requires two pages. (cont.) 2
2. A result that requires two pages 3
while I would like to have:
**List of Figures**
1. A result that requires two pages 2-3
Here is the MWE:
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\listoffigures
\clearpage
\begin{figure}
\centering
\subfloat[][]{\includegraphics[scale=.9]{fig1}}
\\
\subfloat[][]{\includegraphics[scale=.9]{fig2}}
\caption{A result that requires two pages. \emph{(cont.)}}
\end{figure}
\begin{figure}
\ContinuedFloat
\centering
\subfloat[][]{\includegraphics[scale=.9]{fig3}}
\\
\subfloat[][]{\includegraphics[scale=.9]{fig4}}
\caption{A result that requires two pages.}
\end{figure}
\end{document}
```
|
https://tex.stackexchange.com/users/13231
|
One caption in listoffigures for a ContinuedFloat
| false |
If you don't need the range of pages and just want to avoid the multiple entries, just add
```
\captionsetup[ContinuedFloat]{list=false}
```
to the preamble.
Of course this doesn't answer the actual question, but that specific line is what I was trying to google and what brought me to this question. It took me a while to figure out the solution since the other answers are quite convoluted, so I thought I'll leave this here to save fellow googlers a few seconds of their lives.
|
1
|
https://tex.stackexchange.com/users/45734
|
692760
| 321,379 |
https://tex.stackexchange.com/questions/605078
|
1
|
I have a standalone setup with the following file structure
```
A
├── A.tex
└── sections
├── B
│ ├── Bimages
│ │ └── cat.png
│ └── B.tex
└── C
├── Cimages
└── C.tex
```
I have a main tex file called A and two subfiles B and C, such that the content of A is a title page then B and C concatenated. B has its own images directory, which is referenced in B.tex using `\graphicspath{ {./Bimages/} }` and C similarly has ./Cimages/. B and C compile separately perfectly well, however, when I compile A, I get `LaTeX Warning: File Bimages/cat.png not found on input line 89.`
Is this expected behaviour with standalone? Will it not account for relative file paths in subdirectories? If so, is there a way to work around this such that I can organise my images into separate folders(preferably without having to do `\graphicspath{ {./sections/B/Bimages} {./sections/C/Cimages} }` in A.tex, as I may have many more similar directories in the future.
|
https://tex.stackexchange.com/users/245424
|
Graphicspath and standalone
| false |
Because your problem is interesting and somebody may have a similar problem when using OpTeX, I give OpTeX solution here. Note, that OpTeX isn't LaTeX and if you are using LaTeX then my answer isn't for you.
OpTeX declares for including graphics the token register `\picdir` and, of course, there is an equivalent control sequence `\_picdir` which is the same token register. Suppose, that you have `\picdir{Bimages/}` in the `B.tex` file and `\picdir{Cimages/}` in the `C.tex` file. Then you can run OpTeX on `B.tex` or `C.tex` standalone.
In the main file `A.tex`, you can deactivate the `\picdir` and use only `\_picdir`. A part of `A.tex` can look like this:
```
\let\picdir=\ignoreit
\_picdir{B/Bimages/}
\input B/B.tex
\_picdir{C/Cimages/}
\input C/C.tex
\bye
```
|
1
|
https://tex.stackexchange.com/users/51799
|
692762
| 321,380 |
https://tex.stackexchange.com/questions/149235
|
20
|
How do I display truly diagonal matrices? I want to have a diagonal bloc matrix. The solution below has several problems : the diagonal terms aren't really aligned in the first half, and the diagonal dots `\ddots` aren't steep enough between the zeros in the second half.
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\mathrm{Mat}(u;\mathcal{B})=
\begin{pmatrix}
I_{n_+}\\&-I_{n_-}\\
&&R_{\theta_1}\\
&&&R_{\theta_2}\\
&&&&\ddots\\
&&&&&R_{\theta_r}\\
&&&&&&0\\
&&&&&&&0\\
&&&&&&&&\ddots\\
&&&&&&&&&0\\
\end{pmatrix}
\]
\end{document}
```
|
https://tex.stackexchange.com/users/15489
|
How to create diagonal matrix with an aligned diagonal?
| false |
With `{pNiceMatrix}` of `nicematrix`. The key `columns-width=auto` assures that all the columns will have the same width and then that the centers of cells on the diagonal are aligned (since you know that all the rows have the same height and depth). Then, I use the built-in command `\line` (available in the so-called `\CodeAfter`) which draws that dotted lines with Tikz (in fact, the sublayer of Tikz).
```
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\[
\mathrm{Mat}(u;\mathcal{B})=
\begin{pNiceMatrix}[columns-width=auto,xdots/shorten = 2mm]
I_{n_+}\\
&-I_{n_-}\\
&&R_{\theta_1}\\
&&&R_{\theta_2}\\
&&&&\\
&&&&&R_{\theta_r}\\
&&&&&&0\\
&&&&&&&0\\
&&&&&&&&\\
&&&&&&&&&0\\
\CodeAfter \line{4-4}{6-6} \line{8-8}{10-10}
\end{pNiceMatrix}
\]
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/163000
|
692773
| 321,387 |
https://tex.stackexchange.com/questions/692782
|
0
|
The table is long and not centred and the footnote isn't placec at the end of the table.
```
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx} % Required for inserting images
\usepackage{setspace}% for\doublespacing
\usepackage{indentfirst}% for indent the first line
\usepackage{longtable}
\usepackage{textalpha}
\usepackage{ragged2e}
\usepackage[T1]{fontenc} % <-- new
\usepackage{xltabular}
\usepackage{amsmath}
\usepackage{caption}
\DeclareUnicodeCharacter{2212}{-}%new
\begin{document}
\section{Baseline behavioral measurements}
\begin{table}[ht]
\centering
\caption{Baseline behavioral measurements}
\begin{tabular}[t]{llllllll}
\hline
& & & & Baseline Locomotion (cm) & & &\\
ST & df & F - value & pη2 &P - value& & M \textpm StD& N\\
\hline
SD & 1 & 0.027 &0.000 & 0.870& control & 1100 ± 237 &24 \\
& & & & & SD & 1108 ± 193 & 54 \\
PhA & 1& 8.291**& 0.101& 0.005& PhA- & 1163 ± 188 &39\\
& & & & & PhA+ & 1047 ± 209& 39\\
SD \texttimes PhA& 1& 1.713& 0.023& 0.195 & & & \\
Error & 74& & & & & & \\
\hline
LT & df & F - value & pη2 &P - value& & M \textpm StD & N\\
\hline
SD & 1& 1.109& 0.015& 0.296& Control &1405 ± 225& 23\\
& & & & & SD & 1461 ± 223& 54\\
PhA & 1& 25.147**& 0.256& 0.000& PhA- & 1564 ± 189 & 38\\
& & & & &PhA+ & 1327 ± 194 & 39\\
SD \texttimes PhA & 1& 0.071& 0.001& 0.790 & & &\\
Error& 73 & & & & & & \\
\hline
& & & & Baseline SIR & & & \\
ST & df & F - value & pη2 &P - value& & M \textpm StD& N\\
\hline
SD & 1& 0.194 &0.003& 0.661 &Control & 117.16 ± 38.1 & 24\\
& & & & & SD & 122.07 ± 58.5& 51\\
PhA & 1& 2.280& 0.031& 0.136& PhA- & 131.74 ± 52.99& 36\\
& & & & & PhA+ & 110.12 ± 50.07& 39\\
SD\texttimes PhA& 1& 669.481& 0.003& 0.621 & & & \\
Error & 71& & & & & & \\
\hline
LT& df & F - value & pη2 &p - value & & M ± StD & N\\
\hline
SD& 1& 0.301& 0.005& 0.585& Control& 136.81 ± 41.13& 23\\
& & & & & SD & 131.59 ± 40.44& 45\\
PhA & 1& 1.896& 0.029& 0.173& PhA- & 140.12 ± 45.8 & 34\\
& & & & & PhA+& 126.58 ± 33.6& 34\\
SD\texttimes PhA & 1& 0.038& 0.001& 0.846 & & & \\
Error& 64 & & & & & & \\
\hline
& & & & Baseline Sociability score & & & \\
ST & df & F - value & pη2 &P - value& & M \textpm StD& N\\
\hline
SD & 1& 0.643 &0.009& 0.425& Control &0.36 ± 0.09 & 24\\
& & & & & SD & 0.38 ± 0.08 & 54\\
PhA & 1& 0.981& 0.013 &0.325& PhA- & 0.38 ± 0.07 & 39\\
& & & & &PhA+ & 0.36 ± 0.09 & 39\\
SD\texttimes PhA & 1& 0 &0 &0.882 & & & \\
Error& 74& & & & & & \\
\hline
LT& df & F - value & pη2 &p - value & & M ± StD & N\\
\hline
SD & 1& 0 &0& 0.984& Control & 0.35 ± 0.07 & 23\\
& & & & & SD & 0.35 ± 0.06 & 53\\
PhA & 1& 7.119**& 0.09& 0.009& PhA- & 0.34 ± 0.06 & 37\\
& & & & & PhA+& 0.37 ± 0.06 & 39\\
SD\texttimes PhA & 1& 1.682& 0.023 &0.199 & & & \\
Error& 72& & & & & & \\
\hline
LT& df & F - value & pη2 &p - value & & M ± StD & N\\
\hline
\label{table:7}
\end{tabular}
\end{table}%
% This is footnote
\begin{minipage}{10cm}
\small Note:
\textit{p} < .05 = *, \textit{p} < .01 = **
\end{minipage}
\end{document}
```
|
https://tex.stackexchange.com/users/301169
|
Table is not centred, footnote not placed at the end of the table
| true |
For long tables you should use `longtable`, to allow them to break across pages.
To avoid, that the “Baseline …” headings increase the column width, you can use, e.g., `\multicolumn`, to place them centered across all columns.
I would also recommend to use `booktabs` for more space above/below the rules.
```
\documentclass{report}
\usepackage[utf8]{inputenc}% should not be needed
\usepackage{graphicx} % Not used in the example!
\usepackage{setspace}% Not used in the example!
\usepackage{indentfirst}% for indent the first line
\usepackage{longtable}
\usepackage{textalpha}
\usepackage{ragged2e}% Not used in the example!
\usepackage[T1]{fontenc} % <-- new
\usepackage{xltabular}% Not used in the example!
\usepackage{amsmath}
\usepackage{caption}
\DeclareUnicodeCharacter{2212}{-}%new
\usepackage{booktabs}
\begin{document}
\section{Baseline behavioral measurements}
\begin{longtable}{llllllll}
\caption{Baseline behavioral measurements}\label{table:7}\\
\endfirsthead
\caption[]{Baseline behavioral measurements \emph{(continued)}}\\
\endhead
\toprule
\multicolumn{8}{c}{Baseline Locomotion (cm)}\\
ST & df & F - value & pη2 &P - value& & M \textpm StD& N\\
\midrule
SD & 1 & 0.027 &0.000 & 0.870& control & 1100 ± 237 &24 \\
& & & & & SD & 1108 ± 193 & 54 \\
PhA & 1& 8.291**& 0.101& 0.005& PhA- & 1163 ± 188 &39\\
& & & & & PhA+ & 1047 ± 209& 39\\
SD \texttimes PhA& 1& 1.713& 0.023& 0.195 & & & \\*
Error & 74& & & & & & \\
\midrule
LT & df & F - value & pη2 &P - value& & M \textpm StD & N\\
\midrule
SD & 1& 1.109& 0.015& 0.296& Control &1405 ± 225& 23\\
& & & & & SD & 1461 ± 223& 54\\
PhA & 1& 25.147**& 0.256& 0.000& PhA- & 1564 ± 189 & 38\\
& & & & &PhA+ & 1327 ± 194 & 39\\
SD \texttimes PhA & 1& 0.071& 0.001& 0.790 & & &\\*
Error& 73 & & & & & & \\
\midrule
\multicolumn{8}{c}{Baseline SIR}\\*
ST & df & F - value & pη2 &P - value& & M \textpm StD& N\\*
\midrule
SD & 1& 0.194 &0.003& 0.661 &Control & 117.16 ± 38.1 & 24\\
& & & & & SD & 122.07 ± 58.5& 51\\
PhA & 1& 2.280& 0.031& 0.136& PhA- & 131.74 ± 52.99& 36\\
& & & & & PhA+ & 110.12 ± 50.07& 39\\
SD\texttimes PhA& 1& 669.481& 0.003& 0.621 & & & \\*
Error & 71& & & & & & \\
\midrule
LT& df & F - value & pη2 &p - value & & M ± StD & N\\
\midrule
SD& 1& 0.301& 0.005& 0.585& Control& 136.81 ± 41.13& 23\\
& & & & & SD & 131.59 ± 40.44& 45\\
PhA & 1& 1.896& 0.029& 0.173& PhA- & 140.12 ± 45.8 & 34\\
& & & & & PhA+& 126.58 ± 33.6& 34\\
SD\texttimes PhA & 1& 0.038& 0.001& 0.846 & & & \\
Error& 64 & & & & & & \\
\midrule
\multicolumn{8}{c}{Baseline Sociability score}\\*
ST & df & F - value & pη2 &P - value& & M \textpm StD& N\\*
\midrule
SD & 1& 0.643 &0.009& 0.425& Control &0.36 ± 0.09 & 24\\
& & & & & SD & 0.38 ± 0.08 & 54\\
PhA & 1& 0.981& 0.013 &0.325& PhA- & 0.38 ± 0.07 & 39\\
& & & & &PhA+ & 0.36 ± 0.09 & 39\\
SD\texttimes PhA & 1& 0 &0 &0.882 & & & \\*
Error& 74& & & & & & \\
\midrule
LT& df & F - value & pη2 &p - value & & M ± StD & N\\
\midrule
SD & 1& 0 &0& 0.984& Control & 0.35 ± 0.07 & 23\\
& & & & & SD & 0.35 ± 0.06 & 53\\
PhA & 1& 7.119**& 0.09& 0.009& PhA- & 0.34 ± 0.06 & 37\\
& & & & & PhA+& 0.37 ± 0.06 & 39\\
SD\texttimes PhA & 1& 1.682& 0.023 &0.199 & & & \\*
Error& 72& & & & & & \\
\midrule
LT& df & F - value & pη2 &p - value & & M ± StD & N\\
\bottomrule
\end{longtable}
% This is footnote
\begin{minipage}{10cm}
\small Note:
\textit{p} < .05 = *, \textit{p} < .01 = **
\end{minipage}
\end{document}
```
Other changes like using `siunitx` could also make sense. But I've tried to reduce the changes to a minimum. However, I would also recommend to think about splitting the long table into several smaller (sub-)tables. Maybe even using package `subcaption` would make sense. But I cannot decide this.
|
0
|
https://tex.stackexchange.com/users/277964
|
692784
| 321,392 |
https://tex.stackexchange.com/questions/692785
|
9
|
This does not compile, which is what I'd expect:
```
\documentclass{amsart}
\newcommand{\G2}{G_2}
%\DeclareMathOperator{\G2}{G_2}
\begin{document}
\(\G2\)
\end{document}
```
produces
```
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.2 \newcommand{\G2}{G_2}
?
```
This does compile, which is not what I'd expect:
```
\documentclass{amsart}
%\newcommand{\G2}{G_2}
\DeclareMathOperator{\G2}{G_2}
\begin{document}
\(\G2\)
\end{document}
```
Why does it compile?
|
https://tex.stackexchange.com/users/1169
|
Why can the name of a `MathOperator` have a number?
| true |
In `amsopn.sty` we see
```
\newcommand{\DeclareMathOperator}{%
\@ifstar{\@declmathop m}{\@declmathop o}}
```
Note that in this context, `@` is a letter. In your case there is no `*` following, so TeX will transform
```
\DeclareMathOperator{\G2}{G_2}
```
into
```
\@declmathop o{\G2}{G_2}
```
Now we look for the definition of `\@declmathop`:
```
\long\def\@declmathop#1#2#3{%
\@ifdefinable{#2}{%
\DeclareRobustCommand{#2}{\qopname\newmcodes@#1{#3}}}}
```
so we obtain
```
\@ifdefinable{\G2}{\DeclareRobustCommand{\G2}{\qopname\newmcodes@o{G_2}}}
```
Well, it seems that one of the culprits is `\@ifdefinable`. Indeed
```
% latex.ltx, line 1287:
\long\def\@ifdefinable #1#2{%
\edef\reserved@a{\expandafter\@gobble\string #1}%
\@ifundefined\reserved@a
{\edef\reserved@b{\expandafter\@carcube \reserved@a xxx\@nil}%
\ifx \reserved@b\@qend \@notdefinable\else
\ifx \reserved@a\@qrelax \@notdefinable\else
#2%
\fi
\fi}%
\@notdefinable}
```
In your case we have `\G2` as `#1` and the other braced group is `#2`:
```
\edef\reserved@a{\expandafter\@gobble\string\G2}
```
which defines `\reserved@a` to expand to `G2`, which likely makes `\@ifundefined\reserved@a` to return true. Thus we get
```
\edef\reserved@b{\expandafter\@carcube \reserved@a xxx\@nil}
\ifx \reserved@b\@qend
\@notdefinable
\else
\ifx \reserved@a\@qrelax
\@notdefinable
\else
\DeclareRobustCommand{\G2}{\qopname\newmcodes@o{G_2}}
\fi
\fi
```
(reformatted, but there is actually no endline in the token list). Now the first test returns false as well as the second test, so you get
```
\DeclareRobustCommand{\G2}{\qopname\newmcodes@o{G_2}}
```
Second culprit here, because we see that
```
% latex.ltx, line 1376:
\def\DeclareRobustCommand{\@star@or@long\declare@robustcommand}
% latex.ltx, line 1226:
\def\@star@or@long#1{%
\@ifstar
{\let\l@ngrel@x\relax#1}%
{\let\l@ngrel@x\long#1}}
% latex.ltx, line 1377:
\def\declare@robustcommand#1{%
\ifx#1\@undefined\else\ifx#1\relax\else
\@latex@info{Redefining \string#1}%
\fi\fi
\edef\reserved@a{\string#1}%
\def\reserved@b{#1}%
\edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}%
\edef#1{%
\ifx\reserved@a\reserved@b
\noexpand\x@protect
\noexpand#1%
\fi
\noexpand\protect
\expandafter\noexpand\csname
\expandafter\@gobble\string#1 \endcsname
}%
\let\@ifdefinable\@rc@ifdefinable
\expandafter\new@command\csname
\expandafter\@gobble\string#1 \endcsname
}
```
The `\@star@or@long` part is irrelevant here and we get
```
\declare@robustcommand{\G2}{\qopname\newmcodes@o{G_2}}
```
and this is transformed into
```
\ifx\G2\@undefined
\else
\ifx\G2\relax
\else
\@latex@info{Redefining \string\G2}%
\fi
\fi
```
(and more tokens to follow). The first conditional compares `\G` with `2` and they differ, so `\@undefined` is skipped and we get nothing from this part. Next we have the actual definition and, basically, LaTeX eventually does
```
\edef\G2{\noexpand\protect\expandafter\noexpand\csname G2 \endcsname}
\expandafter\def\csname G2 \endcsname{\qopname\newmcodes@o{G_2}}
```
As you see, the first `\edef` is legal, as far as TeX is concerned. Indeed, if you do `\show\G` in your file, you get
```
> \G=macro:
2->\protect \G2 .
```
which means that `\G` ***must*** be followed by an explicit token `2` and the combination is transformed into `\protect\G2•` (the bullet denotes a space in the command name).
You'd get no error also if you further do
```
\DeclareMathOperator{\G3}{G_3}
```
but an error will be raised if you try to call `\G2`, because `\G` has been redefined to want `3` after it.
Possibly `\@ifdefinable` should check that its argument consists of a single token. But it doesn't.
Anyway, a *main* rule of TeX is that macro names consist of letters only or a single nonletter.
|
13
|
https://tex.stackexchange.com/users/4427
|
692787
| 321,393 |
https://tex.stackexchange.com/questions/692790
|
1
|
When I'm not writing a math paper, I write way faster by typing directly into a word processor. I form and revise sentences faster on the screen then I can on paper.
But typesetting math is slower than handwriting, and I think better with a pen. I already know it's best to handwrite symbol-heavy text before typing, but what about text that's symbol-light, like an abstract or introduction?
Should I write almost the entire paper by hand, or only the math dense portions?
|
https://tex.stackexchange.com/users/301934
|
Should math papers be hand written before using LaTeX?
| false |
I think you ask for at least one effective workflow, which suits your needs. As I read it, you already described a mixed approach, accounting for the circumstances and conditions.
I suggest to:
* come up with a set of requirements, which can be evaluated or measured (small and complete, bijective enough so to say)
* develop a few more concepts (e.g. see some of the comments)
* try and evaluate them against said requirements with mathematical test texts
* learn from those trials and come up with a final approach
* keep the overall process in mind
Measurements might include:
* time needed (should be small)
* number of errors introduced (should be minimal)
* if in doubt favor good indication over exact measurement
**Example**
I like to get a taste of my final document quickly, which includes an effort estimation. For a small book project I needed many simple drawings. So I sketched them quickly on paper, scanned and included them in my Latex document.
That was fast, and the images roles and information were easy to literally see in the first draft.
Turning them into graphics via Tikz was feasible enough, at a later time, when my mind was free to do such routine tasks.
However, removing and harmonizing the last visual bumps and disharmonies were more time consuming than I expected.
Would I do it again this way? Yes, and I‘d have a checklist prepared meanwhile to:
* avoid known traps
* reuse insights and ways to do it
* speed things up,
which also makes it quite easy to account and adjust for new situations.
**Latex related …**
… is certainly the question, how to do such a checklist with Latex, which you can reuse and adjust quickly.
My favorite solution became using `hyperref`, which allows me to use checkboxes and text fields in a .pdf . See here on stackexchange for a [code example](https://tex.stackexchange.com/a/655011/245790).
|
1
|
https://tex.stackexchange.com/users/245790
|
692795
| 321,395 |
https://tex.stackexchange.com/questions/692802
|
2
|
I would like to know if there is any way to prevent Overleaf from ignoring the errors that do appear when compiling on the desktop.
For example, the following template code runs perfectly on Overleaf, but in TeXMaker (I'm using MikTeX), there are errors related to the `declaretheorem` code lines.
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
% Useful packages
\usepackage{amsmath,amsthm,mathtools}
\usepackage{thmtools}
%Entornos matemáticos en español
\declaretheoremstyle[
spaceabove=0pt, spacebelow=0pt,
headfont=\normalfont\bfseries,
notefont=\bfseries, notebraces={(}{)},
bodyfont=\normalfont\itshape,
postheadspace=1em,
qed={},
numberwithin=section,
]{Theorem}
\declaretheorem[style=Theorem, name=Theorem]{theorem}
\declaretheorem[style=Theorem, name=Lemma, numberlike=theorem]{lemma}
\declaretheorem[style=Theorem, name=Corollary, numberlike=theorem]{corollary}
\declaretheorem[style=Theorem, name=Proposition, numberlike=theorem]{proposition}
\usepackage{graphicx}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\title{Your Paper}
\author{You}
\begin{document}
\maketitle
\begin{abstract}
Your abstract.
\end{abstract}
\section{Introduction}
Your introduction goes here! Simply start writing your document and use the Recompile button to view the updated PDF preview. Examples of commonly used commands and features are listed below, to help you get started.
Once you're familiar with the editor, you can find various project settings in the Overleaf menu, accessed via the button in the very top left of the editor. To view tutorials, user guides, and further documentation, please visit our \href{https://www.overleaf.com/learn}{help library}, or head to our plans page to \href{https://www.overleaf.com/user/subscription/plans}{choose your plan}.
\section{Some examples to get started}
\begin{theorem}\label{th:example}
No three positive integers $a, b$, and c satisfy the equation $a^n + b^n = c^n$ for any integer value of $n$ greater than 2.
\end{theorem}
\begin{proposition}
Hi! I'm a proposition.
\end{proposition}
As explained in theorem \ref{th:example}...
\end{document}
```
I would like Overleaf to also display these errors correctly and not force the compilation because
1. sometimes I need to compile a document online and then on the desktop when I don't have internet,
2. when submitting the article to a journal, the code must run well on the desktop.
I appreciate any ideas you may have.
|
https://tex.stackexchange.com/users/220172
|
Overleaf ignores errors, how to avoid it?
| false |
Are you looking for this option?
But, at first glance, your code has no error, so probably you have a *local* broken installation... Or something you're not showing here. Please, add the error you have in your local run.
|
4
|
https://tex.stackexchange.com/users/38080
|
692803
| 321,401 |
https://tex.stackexchange.com/questions/681141
|
3
|
I'd like to print out two minus signs just after each other, like this -- (as in the C operator to subtract one). Doing `--` gives one longer - sign. I've tried `\char"2D\char"2D` but that also just gives one longer - sign. How can this be done?
|
https://tex.stackexchange.com/users/157339
|
How to do a -- sign in latex?
| false |
So I agree with the [@Clara's answer](https://tex.stackexchange.com/a/681161) but I want to explain the reasons or the workings a bit.
As you already may have noticed, `-` produces a single minus. This is the same minus which would be used in hyphenations.
Adding a second minus `--` is the latex shortcut for an en-dash and `---` produces an em-dash. Both of these are used to typeset interjected sentences -- like this one -- or abrupt stops.
In order to generate two separate minuses
-- as in the above answer -- the command `-{}-` should be used. Here an empty scope is opened in between the two minuses. This stops LaTeX from joining them into an en-dash. The scope evaluates to nothing so there is no actual space added in between the minuses. The result is just two hyphenation-style minuses.
|
1
|
https://tex.stackexchange.com/users/257371
|
692805
| 321,403 |
https://tex.stackexchange.com/questions/692800
|
-1
|
I read in OpenAI's [GPT-4 Technical Report](https://arxiv.org/pdf/2303.08774.pdf):
>
> GPT-4 was used in the following ways: to help us iterate on LaTeX formatting [...]
>
>
>
How can one use GPT-4 to help authors iterate on LaTeX formatting?
---
Note that the training data of GPT 3.5 or 4 definitely included source code texts. [Example](https://chat.openai.com/share/d6c3208f-234a-4811-9cc5-eaf6367b3c1a) ([mirror](https://i.stack.imgur.com/DRAam.png)) --> <https://i.stack.imgur.com/JBigy.png>
|
https://tex.stackexchange.com/users/11400
|
How can one use GPT-4 to help authors iterate on LaTeX formatting?
| true |
>
> How can one use GPT-4 to help authors iterate on LaTeX formatting?
>
>
>
It can‘t in my view.
Though it‘s a language model, which may or may not have included source code texts, it has no knowledge, no sense of something being useful or useless, about beauty or ugliness etc. (and GPT had a time window, after which it had no data).
You can see this in the many examples mentioned in said report: results often remains on a toddlers level. And if you try generated code, it often doesn’t even compile, though the code looks tempting or interesting … sometimes. As one book author put it, „GPT has a tendency to hallucinate“. I.e. it fills something in many times. A layman may be impressed, while the expert can‘t stop raising his or her hair.
At the moment, and may be even for the next 70 years or so of hyping Artificial Incompetence, I‘d rather keep training my brain, on Latex, than trying to make a machine mimicking humans.
>
> How can one use GPT-4 to help authors iterate on LaTeX formatting?
>
>
>
At best as a programmer you can debug GPT-generated code, or use it a source of inspiration. But stay alert: the 4 quadrants still hold and are almost never evaluated in AI applications:
1. it appears to be right, and it‘s right
2. it appears to be right, but is wrong
3. it appears being wrong, but is right
4. it appears being wrong, and it‘s wrong
By no means can one know the average percentages for all 4 … and the two unwanted quadrants almost never come close enough to 0 %. See the examples in said report, e.g. about some simple math, see the face recognition errors (even 1 ppm error of being „detected“ as a terrorist while you aren‘t, isn‘t fun in cities with a couple of Millions inhabitants; BTW assuming 1 ppm is quite overoptimistic …), and so on.
|
1
|
https://tex.stackexchange.com/users/245790
|
692809
| 321,405 |
https://tex.stackexchange.com/questions/692811
|
0
|
I am trying to write symbols in Calligra font inside the math mode. Turn out it is not working. The code is given below.
```
\documentclass{article} \usepackage{calligra} \usepackage[T1]{fontenc}
\usepackage{amsmath}
\title{Calligra} \author{} \date{\today}
\begin{document}
\maketitle
\calligra{Calligra font is not supported in the math mode}
\begin{equation}
1 \leq \calligra{M}, \calligra{N} \geq 2 \end{equation}
\end{document}
```
Can any please why it is not working? Thanks!
|
https://tex.stackexchange.com/users/263527
|
Calligra font inside the math mode
| true |
`\calligra` is like `\ttfamily` and does not take an argument, the syntax in text is
```
{\calligra Calligra font is not supported in the math mode}
```
not
```
\calligra{Calligra font is not supported in the math mode}
```
The package does not declare math fonts, but you could use
```
\text{\calligra M}
```
in math
|
1
|
https://tex.stackexchange.com/users/1090
|
692815
| 321,407 |
https://tex.stackexchange.com/questions/121841
|
68
|
When I stumbled upon `tabu` some time ago it looked quite interesting on a first glance and I intended to learn more about it when I have the time.
But, in the comments section of [this question](http://texwelt.de/wissen/fragen/446/wie-bekomme-ich-eine-tabelle-in-textbreite) posted on the new german question and answer site `texwelt.de` Herbert Voß wrote that the `tabu` package is obsolete in its current version (thereby citing the package author) and is not actively maintained anymore.
What are the implications for the usability of the package?
Should I refrain from investing time to learn `tabu` and consider some other packages for the creation of tables instead?
|
https://tex.stackexchange.com/users/6870
|
Is the tabu package obsolete?
| false |
If somebody still stumbles upon this question: I used in autumn 2021 `longtabu`, which is a part of the package `tabu`, for a long table in a project, and when somebody who wanted to learn LaTeX asked me the next year for the sourcecode, I discovered that my sourcecode was broken due to `longtabu`, which didn't work anymore. I had to fix it by replacing the table with `longtblr` from `tabulararray`...
Yes, of course it was already known in 2021 that the package was abandoned, and it was a beginner's mistake. Don't make my mistake, don't use abandoned packages if there are alternatives!
|
2
|
https://tex.stackexchange.com/users/301946
|
692817
| 321,408 |
https://tex.stackexchange.com/questions/692812
|
0
|
A double-struck character set that I like is available in `txmiaX` font which comes with `newtx` package. I have been trying to move most of my math fonts to OTF versions and the closest I have found to this one is in `Asana-Math.otf`. Subtly, though, I like the `newtx` double-struck characters better. I have two questions, actually, and I'll slide the first on in because the second one is the what I would really like an answer for. First, is there an .otf version of `newtx` math fonts that I am somehow missing? I have found the `TexGyreTermesX` and `ntxsups` series, but they are missing most of the math characters from the Type 1 fonts.
Second, as it appears that I will need to keep some Type 1 fonts in addition to `mtpro2`, is it possible to rescale them so that, at the very least, all the capitals are the same height? Explicitly, is it possible to rescale a specific conventional TeX style Type 1 font? I am using XeTeX to compile with OTF text fonts, `fontspec` with `no-math` option, *no* `unicode-math` loaded, and `mtpro2` for math.
Addendum: I don't think I was clear enough, and I apologize. When using an OpenType font, two lines are required. For instance:
```
\newfontfamily\stixlower{STIXTwoMath-Regular.otf}[NFSSFamily=stixlower,Script=Math,Scale=MatchLowercase]
\DeclareSymbolFont{sxlw}{TU}{stixlower}{m}{n}
```
The equivalent that I am using for loading the font which provides the second set of characters in David Carlisle's answer below is
```
\DeclareFontFamily{U}{txmath}{\skewchar \font =127}
\DeclareFontShape{U}{txmath}{m}{n}{<->txmiaX}{}
\DeclareSymbolFont{ds}{U}{txmath}{m}{n}
```
After this, the usage is the same. Is there a "Scale" mechanism in the latter nomenclature or a way to modify the former to deal with Type 1 fonts? I'd like to make these characters available at the correct size from the onset.
|
https://tex.stackexchange.com/users/224317
|
Rescaling Type 1 fonts in entire document, text and math modes
| true |
newtx provides three styles of blackboard bold, two of which are derived from Opentype fonts, it isn't clear which you want.
XeTeX can of course use opentype directly or type1 via classic TeX tfm metrics, both are scalable formats that can be used at any size.
The double struck in `ntxsym` is very similar to that in `Tex Gyre Termes Math` apart from tighter default sidebearings and thinner horizontal strokes:
The second form comes from the tx fonts and isn't readily available as OpenType as far as I know.
The third form is from stix (stix1, although I compare with stix2 opentype here)
```
\documentclass{article}
\begin{document}
{\font\xb=ntxsym \xb ABCDEFGHIJKLMNOPQRSTUVWXYZ}
{\font\xb=ntxsym at 11pt \xb A\/B\/C\/D\/E\/F\/G\/H\/I\/J\/K\/L\/M\/N\/O\/P\/Q\/R\/S\/T\/U\/V\/W\/X\/Y\/Z}
{\font\xb=ntxsym \xb\spaceskip=1.8pt A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
{\font\xc="[texgyretermes-math.otf]" \xc ℂℍℕℙℚℝℤ}
\bigskip
{\font\xd=nxlmia \xd ^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d}
\bigskip
{\font\xd=nxlmia \xd ^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da}
{\font\xc="[STIXTwoMath-Regular.otf]" \xc ℂℍℕℙℚℝℤ}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/1090
|
692822
| 321,412 |
https://tex.stackexchange.com/questions/692825
|
1
|
I have a feeling the answer is obvious, but I've had no success in finding an answer.
I have a parametric curve, and I would like to indicate an integral from *x*=1 to *x*=2. Here goes my MWE:
```
\documentclass [border = 5mm] {standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis} [
axis lines = middle,
xlabel = {$x$},
ylabel = {$y$},
xmin = -1, xmax = 3,
ymin = -1, ymax = 1,
grid = both,
]
\addplot [domain = 0:1.2, samples = 50] ({3 * \x * \x - \x}, {sin (\x / pi * 180});
\clip plot [domain = 0:1.2, samples = 50] ({3 * \x * \x - \x}, {sin (\x / pi * 180});
\draw [fill = blue!20] (axis cs:1, 0) rectangle (axis cs:2, 1);
\end{axis}
\end{tikzpicture}
\end{document}
```
As you can see, I had the simplistic idea of clipping to the curve, then drawing a rectangle, but this does not work (and I think demonstrates I have a lot more work to do in improving my understanding of PGFPlots!)
Any help on getting the required area filled in would be greatly appreciated.
|
https://tex.stackexchange.com/users/301470
|
Fill area between parametric curve and x-axis
| true |
Welcome to TeX StackExchange!
Your idea was close! Instead of using `\clip plot`, PGFPlots has a library called `fill between` which is your friend in this situation. You can use it to fill a color between any two plots, and it has its own clipping option, `soft clip`, which lets you restrict the domain of the filling.
```
\documentclass [border = 5mm] {standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{tikzpicture}
\begin{axis} [
axis lines = middle,
xlabel = {$x$},
ylabel = {$y$},
xmin = -1, xmax = 3,
ymin = -1, ymax = 1,
grid = both,
]
\addplot[name path = curve,domain = 0:1.2, samples = 50] ({3 * \x^2 - \x}, {sin (\x / pi * 180});
\path[name path = horizontalAxis] (axis cs: 3,0) -- (axis cs:-1,0);
\addplot[fill = blue!20] fill between [of=horizontalAxis and curve,soft clip = {domain=1:2}];
\end{axis}
\end{tikzpicture}
\end{document}
```
For your own future reference, it's worth noting that I tailored the code below to fit your specific parametric equation. The `fill between` library attempts to connect the first and last points of each of the named paths, but this means that the horizontal axis path needs to be oriented from high to low (3 to −1) in order to work. Furthermore, with the way your curve is parameterized, this code only works for a strictly positive domain. (If you're curious, try out what happens when you set lower bound of the `soft clip` domain to zero versus anything *slightly* above zero.) As a result, if you're planning on making other plots by reusing this same code, you may encounter strange behavior.
|
1
|
https://tex.stackexchange.com/users/91603
|
692828
| 321,415 |
https://tex.stackexchange.com/questions/692710
|
0
|
I am currently facing an issue with the placement of hyperlinks in a PDF document that I am typesetting using `LaTeX` and the `hyperref` package. I have tried various approaches, but I haven't been able to achieve the desired result.
My document is structured into parts and chapters, with appendices and an analytical index. The problem I am encountering is related to the arrangement of hyperlinks in the generated PDF.
The structure I am aiming for is as follows:
Book:
* Part 1
+ Chapter 1 of Part 1
+ Chapter 2 of Part 1
+ Chapter 3 of Part 1
* Part 2
+ Chapter 1 of Part 2
+ Chapter 2 of Part 2
+ Chapter 3 of Part 2
* Appendix 1
* Appendix 2
* Analytical Index
However, the hyperlinks in the PDF are being grouped incorrectly, and the arrangement appears as follows:
Book:
* Part 1
+ Chapter 1 of Part 1
+ Chapter 2 of Part 1
+ Chapter 3 of Part 1
* Part 2
+ Chapter 1 of Part 2
+ Chapter 2 of Part 2
+ Chapter 3 of Part 2
+ Appendix 1
+ Appendix 2
+ Analytical Index
I have tried using `\phantomsection` before `\addcontentsline` for both the appendices and the analytical index, but the issue persists.
My `hyperref` setup is as follows:
```
\usepackage{hyperref}
\hypersetup{bookmarksnumbered}
\hypersetup{hidelinks}
\hypersetup{pdfauthor={My Name}, pdftitle={My Title}}
```
If you need more information about my `LaTeX` code or setup, please let me know.
EDIT: following my example as suggested (I'm sorry if I reply only now, I was in holiday for a while)
```
\documentclass[a4paper,twoside,12pt,italian,notitlepage]{book}
\usepackage[UTF8]{inputenc}
\usepackage[italian]{babel}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\usepackage{txfonts}
\usepackage{booktabs}
\renewcommand{\thesection}{\thechapter.1.}
\usepackage{tabularx}
\usepackage{subfig}
\usepackage{appendix}
\usepackage{graphicx}
\graphicspath{{./files/}}
\usepackage{emptypage}
\usepackage{booktabs}
\usepackage{marvosym}
\usepackage{textcomp}
\usepackage{verbatim}
\usepackage{imakeidx} %indice analitico
\makeindex
\usepackage{enumitem}
\usepackage{colortbl}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{caption}
\usepackage[maxdepth=6]{gitinfo2}
\captionsetup{tableposition=top,figureposition=bottom,font=small}
\captionsetup{format=hang,labelfont={bf}}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
%============= LISTINGS ======================
\usepackage{listings}
\definecolor{mGreen}{rgb}{0,0.6,0}
\definecolor{mGray}{rgb}{0.5,0.5,0.5}
\definecolor{mPurple}{rgb}{0.58,0,0.82}
\definecolor{backgroundColour}{rgb}{0.95,0.95,0.92}
\definecolor{backgroundColourC++}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{C}{
backgroundcolor=\color{backgroundColour},
commentstyle=\color{mGreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{mGray},
stringstyle=\color{mPurple},
basicstyle=\footnotesize\ttfamily,
% breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
% numbers=left,
% numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
breakatwhitespace=true,
language=C
}
\lstdefinestyle{C++}{
language=C++,
backgroundcolor=\color{backgroundColourC++},
basicstyle=\footnotesize\ttfamily,
keywordstyle=\color{blue}\ttfamily,
stringstyle=\color{red}\ttfamily,
commentstyle=\color{green}\ttfamily,
morecomment=[l][\color{magenta}]{\#},
captionpos=b,
showspaces=false,
keepspaces=true,
breakatwhitespace=true,
breaklines=true
}
\lstset{basicstyle=\small\ttfamily,columns=fullflexible}
\addto\captionsitalian{\renewcommand{\lstlistingname}{Codice}}
\addto\captionsitalian{\renewcommand{\lstlistlistingname}{Elenco dei listati}}
%==============FANCY==============
\usepackage{fancyhdr}
\pagestyle{fancy}
%\fancyhead{}
\fancyfoot{}
\fancyhead[RO,LE]{\fontsize{10}{12} C e C++}
\fancyhead[LO,RE]{}
\cfoot{}
\fancyfoot[LE,RO]{\fontsize{10}{12} \thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
%=================================
\usepackage{hyperref}
\hypersetup{
bookmarksnumbered,
bookmarksopen=false,
hidelinks,
hypertexnames=false,
pdfauthor={Micky Mouse},
pdftitle={My title}
}
\usepackage{imakeidx}
\makeindex
\makeindex[columns=2, title=Indice analitico]
\usepackage{bookmark}
\setcounter{secnumdepth}{4}
\renewcommand{\thesection}{\arabic{section}}
\author{Micky Mouse}
\title{My Title }
\date{MyDate}
\begin{document}
\pagestyle{empty}
\maketitle
\begin{center}
Rev.~\gitCommitterIsoDate\\
Hash:~\gitHash\\
\end{center}
\pagestyle{empty}
\tableofcontents
\listoffigures
\listoftables
\lstlistoflistings
\newpage
\section*{Premessa}
Some text as introduction of the book
\pagestyle{fancy}
\part{First part}
\include{A}
\include{B}
\part{Second part}
\include{C}
\include{D}
\appendix
\cleardoublepage
\phantomsection
\include{Apendix 1}
\phantomsection
\addcontentsline{toc}{part}{\indexname}
\printindex
\cleardoublepage
\end{document}
```
|
https://tex.stackexchange.com/users/301879
|
Issue with Hyperlinks in PDF using Hyperref Package
| false |
Add `\bookmarksetup{startatroot}` (from the `bookmark` package) to end a part before a new chapter (or appendix).
|
0
|
https://tex.stackexchange.com/users/14500
|
692831
| 321,416 |
https://tex.stackexchange.com/questions/692814
|
-1
|
```
\begin{figure}[ht]
\begin{tikzpicture}[node distance=1cm, text width=4.5 cm, rounded corners]
% nodes
% \node (A) [draw, align = center, font = \small] at (0, 12) {\textbf{Potential Viral Load Explainers}};
\node(B)[draw, align = center, font = \small] at (0,10){\underline{\textbf{\emph{Socio-demographic: (SDF)}}} \\ Gender, Socio support, Age (age category), and Marital status };
\coordinate (point0) at (-2,8.7);
% \node(emp1)[draw, align = center, right = of B, style = invis] at (12,10){\phantom{empty};
%\node (q_5) [right=of q_4] {\phantom{$\cdots$}};
% \coordinate (point0) at (-2,8.7);
% \coordinate (point1) at (2.4,10);
% \coordinate (point3) at (12,10);
\node(C)[draw, align = center, font = \small] at (1.2, 5.5){\underline{\textbf{Intermediate Variables:}} \\\textbf{ \emph{ART Factors}}\\ Duration on ART, Suppression history, Changing ART, adherence to ART\\ \textbf{\emph{Clinical Factors}} \\ BMI, WHO clinical stages};
\coordinate (point3) at (1,3.05);
\coordinate (point4) at (8,2);
\node (I) [draw, align = center, right=of C, font = \small] at (3, 1) {\underline{\textbf{Dependent Variable}} \\ \emph{Viral Load Measurements} };
\coordinate (point4) at (12.2,-1.7);
\node (G)[draw, align = center, right=of I, font = \small] {\textbf{Multiple \\Imputation}};
\node (F)[draw, align = center, below=of G, font = \small] {\textbf{SMF}};
\coordinate (point2) at (12.2,-1.7);
\node (H)[draw, align = center, below=of F, font = \small] {\textbf{RMF}};
% Arrows
\draw[-] (F) -- coordinate (midDT) (H);
\draw[->] (G) -- +(3,0) |- (midDT);
\draw[->] (I) |- (point2);
\draw[->] (point0) |- (I);
\draw[->] (point3) |- (I);
\draw[-] (F) edge (H);
\draw[->] (I) edge (G);
\draw[->] (B) |- (G);
\draw[->] (C) |- (point4);
\end{tikzpicture}
\caption{Conceptual Framework}
\end{figure}
```
|
https://tex.stackexchange.com/users/301951
|
Some help on connecting nodes. I want arrows moving from nodes B and C straight to node G, but I get something different, below is the code
| false |
* Sorry, but frankly said, your code fragment is a big mess ...
* Below, based on pure guessing, is an attempt to clean-up your code fragment that would become more clear, concise or at least make it free from clutter, but in this probably I miss placement of your nodes.
* At least it can serve for starting point at your editing of question (for more we need a sketch, what you after, so far question is unclear).
* In my MWE (Minimal Working Example) are removed almost all coordinates definitions (I estimated, that they are superfluous).
* Nodes are positioned relative to each other (using `positioning` library.
* It is unclear, how nodes are connected.
* I would not underline bold faced text.
* To nodes text I add nodes names (as I figured out that should be).
MWE:
```
\documentclass{article}
\usepackage{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
ext.paths.ortho, % defined in the tikz-ext package
positioning}
\begin{document}
\begin{figure}[ht]
\begin{tikzpicture}[
> = Straight Barb,
node distance = 6mm and 4mm,
N/.style = {draw, rounded corners, semithick, font=\small,
text width=44mm, align=center}, % common style for all nodes
]
% nodes
\node (A) [N] {"A",
\textbf{Potential Viral Load Explainers}};
\node (B) [N, below=of A]
{"B",
\textbf{\emph{Socio-demographic: (SDF)}} \\ Gender, Socio support, Age (age category), and Marital status};
\node (C) [N, below=of B]
{"C",
\textbf{Intermediate Variables:} \\
\textbf{\emph{ART Factors}}\\
Duration on ART, Suppression history, Changing ART, adherence to ART\\ \textbf{\emph{Clinical Factors}} \\
BMI, WHO clinical stages};
\node (I) [N, below right=of C]
{"I",
\textbf{Dependent Variable}
\emph{Viral Load Measurements} };
\node (G) [N, right=of I] {"G",
\textbf{Multiple Imputation}};
\node (F) [N, below=of G] {"F",
\textbf{SMF}};
\node (H) [N, below=of F] {"H",
\textbf{RMF}};
% Arrows
\draw[->] (B) -| ([xshift=+2mm] G.north);
\draw[->] (C) -| ([xshift=-2mm] G.north);
\draw (F) -- coordinate (midDT) (H);
\draw[->] (G.east) r-rl (midDT); % as defined in the ext.paths.ortho library
\end{tikzpicture}
\caption{Conceptual Framework}
\end{figure}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/18189
|
692835
| 321,418 |
https://tex.stackexchange.com/questions/692775
|
1
|
I have the following MWE for producing the plot. It can be observed for the plot "path2" that the ball color remains blue (has to be red), even though mark color "red" was assigned.
So, i need to change ball color for ''path2" plotted in red line.
```
\documentclass[varwidth=true]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel=Distance from center, ylabel=Appointment,xlabel={Follow-ups},
xlabel style={yshift=-5mm},
xtick={1,2,3,4,5,6,7,8,9,10},
xticklabels = {
\strut A1,
\strut A2,
\strut A3,
\strut A4,
\strut A5,
\strut A6,
\strut A7,
\strut A8,
\strut A9,
\strut A10
},
x tick label style={text width=5em,anchor=north,align=center},
ymin=0,
ymax=20,
grid style=dashed,
legend style={
at={(0.738,0.8209)},
anchor=south west,
},]
\addplot[color=blue, mark=ball, mark color=blue] coordinates{(1,6.5)(2,11)(3,17.4)(4,11)(5,17.4)(6,6.5)(7,17.4)(8,6.5)(9,11)(10,11)};
\addplot[color=red, mark=ball, mark color=red] coordinates{(1,5.9)(2,9.5)(3,13.4)(4,8.5)(5,13.7)(6,6)(7,14.3)(8,5.3)(9,9.2)(10,9.4)};
\legend{path, path2}
\end{axis}
\end{tikzpicture}
\end{document}
```
|
https://tex.stackexchange.com/users/232972
|
2D plot marker color cannot be changed after color assignment
| false |
```
\documentclass[varwidth=true]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel=Distance from center, ylabel=Appointment,xlabel={Follow-ups},
xlabel style={yshift=-5mm},
xtick={1,2,3,4,5,6,7,8,9,10},
xticklabels = {
\strut A1,
\strut A2,
\strut A3,
\strut A4,
\strut A5,
\strut A6,
\strut A7,
\strut A8,
\strut A9,
\strut A10
},
x tick label style={text width=5em,anchor=north,align=center},
ymin=0,
ymax=20,
grid style=dashed,
legend style={
, at={(0.738,0.8209)},
anchor=south west,
},]
\addplot[color=blue, mark=ball, mark color=blue] coordinates{(1,6.5)(2,11)(3,17.4)(4,11)(5,17.4)(6,6.5)(7,17.4)(8,6.5)(9,11)(10,11)};
\addplot[red,mark=ball,mark options={ball color=red}] coordinates{(1,5.9)(2,9.5)(3,13.4)(4,8.5)(5,13.7)(6,6)(7,14.3)(8,5.3)(9,9.2)(10,9.4)};
\legend{path, path2}
\end{axis}
\end{tikzpicture}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/162128
|
692837
| 321,419 |
https://tex.stackexchange.com/questions/692823
|
1
|
I am trying to get bold italic vectors with the newtxmath font.
Using other fonts I can just load the isomath package and then use `\vectorsym{...}` to get the desired output.
However, in combination with the newtxmath package, `\vectorsym` has no effect at all.
Below is my MWE which produces two identical non-bold letters x, while I am expecting the second to be bold.
I am loading the font stack according to example 2 on page 17 of the manual
<https://mirror.funkfreundelandshut.de/latex/fonts/newtx/doc/newtxdoc.pdf>
I know, I could redefine `\vectorsym` with the aid of `\bm` but this produces another issue in my actual application, and I thought the point of isomath was that you load it and it takes care of everything...
```
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% page 17 in manual
\usepackage[lining,semibold]{libertine} % a bit lighter than Times--no osf in math
\usepackage[T1]{fontenc} % best for Western European languages
\usepackage{textcomp} % required to get special symbols
\usepackage[varqu,varl]{inconsolata}% a typewriter font must be defined
\usepackage{amsmath}% must be loaded before amsthm, if using
\usepackage{amsthm}% must be loaded before newtxmath
\usepackage[libertine,vvarbb,slantedGreek]{newtxmath}
\usepackage[scr=rsfso]{mathalfa}
\usepackage{bm}% load after all math to give access to bold math
%After loading math package, switch to osf in text.
\useosf % for osf in normal text
\usepackage{isomath}
\begin{document}
$x \vectorsym{x}$
\end{document}
```
|
https://tex.stackexchange.com/users/63717
|
Bold italic vectors with isomath and newtxmath
| true |
The problem is that `isomath` does
```
\ifisomath@reuseMathAlphabets
\DeclareMathAlphabet{\mathbf}{OML}{\isomath@rmdefault}{bx}{it}
\def\mathbfit{\mathbf}
\else
\DeclareMathAlphabet{\mathbfit}{OML}{\isomath@rmdefault}{bx}{it}
\fi
```
and indeed you get
```
LaTeX Font Warning: Font shape `OML/LinuxLibertineT-TLF/bx/it' undefined
(Font) using `OML/nxlmi/m/it' instead on input line 21.
```
The `isomath` package makes some assumptions that aren't satisfied when `newtxmath` is loaded. Change yourself the definition of `\mathbfit`.
```
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[lining,semibold]{libertine} % a bit lighter than Times--no osf in math
\usepackage[T1]{fontenc} % best for Western European languages
\usepackage{textcomp} % required to get special symbols
\usepackage[varqu,varl]{inconsolata}% a typewriter font must be defined
\usepackage{amsmath}% must be loaded before amsthm, if using
\usepackage{amsthm}% must be loaded before newtxmath
\usepackage[libertine,vvarbb,slantedGreek]{newtxmath}
\usepackage[scr=rsfso]{mathalfa}
\usepackage{bm}% load after all math to give access to bold math
\usepackage{isomath}
\useosf % for osf in normal text
% fix \mathbfit
\DeclareMathAlphabet{\mathbfit}{OML}{nxlmi}{bx}{it}
\begin{document}
$x \vectorsym{x}$
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/4427
|
692839
| 321,420 |
https://tex.stackexchange.com/questions/103062
|
4
|
The following will not compile with `LaTeX`.
```
\documentclass[12pt]{article}
\usepackage{amsmath,amsthm,amssymb}
\begin{document}
$$\eqalign{a_1&=1+2+3\cr
a_1+a_2 &=1+2+3+4\cr
a_1+a_2+a_3 &=1+2+3+4+5\cr}$$
\end{document}
```
|
https://tex.stackexchange.com/users/27570
|
Problems with eqalign
| false |
1. Use `\usepackage{plain}`
2. Wrap the `\eqalign` expressions in plain:
```
\documentclass[12pt]{article}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{plain}
\begin{document}
\begin{plain}
$$\eqalign{a_1&=1+2+3\cr
a_1+a_2 &=1+2+3+4\cr
a_1+a_2+a_3 &=1+2+3+4+5\cr}$$
\end{plain}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/301966
|
692840
| 321,421 |
https://tex.stackexchange.com/questions/692838
|
2
|
I'm using `BibLaTeX` (APA) in French and I have one little problem:
When I have only two authors, they are cited with the conjunction symbol `&` whereas I would like the grammatical French conjunction term `et`. Here is a part of the code:
```
\RequirePackage[hyperref,backend=biber,style=apa]{biblatex}
\DeclareLanguageMapping{french}{french-apa}
\DefineBibliographyExtras{french}{\restorecommand\mkbibnamefamily}
% for avoiding small caps problem
```
|
https://tex.stackexchange.com/users/301963
|
"et" instead of ampersand "&" for French biblatex-apa
| false |
APA wants "&" instead of "and" in certain situations. If you want all "&"s between names to be "and"s, try the following code
```
\documentclass[french]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=apa]{biblatex}
\DefineBibliographyExtras{french}{%
\restorecommand\mkbibnamefamily}
\DeclareDelimFormat[parencite,fullcite,fullcitebib]{finalnamedelim}
{\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\bibstring{and}\space}
\DeclareDelimFormat[bib,biblist]{finalnamedelim}{%
\ifthenelse{\value{listcount}>\maxprtauth}
{}
{\ifthenelse{\value{liststop}>2}
{\finalandcomma\addspace\bibstring{and}\space}
{\addspace\bibstring{and}\space}}}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson}
ipsum \textcite{sigfridsson}
dolor \parencite{sigfridsson}
sit \nptextcite{sigfridsson}
\printbibliography
\end{document}
```
|
4
|
https://tex.stackexchange.com/users/35864
|
692847
| 321,422 |
https://tex.stackexchange.com/questions/692842
|
0
|
When I compile my document with pdflatex with `natbib` and either the `plainnat` or the `dinat` style on my computer, the author list is translated to German. E.g., I get "und" between authors instead of "and" and instead of "et al" I get "u. a.".
I am very puzzled, because I don't know why.
* In my bibliography file all references are in English and I also write "and" between each author. So the original is in English and there obviously happens an unwanted translation somewhere.
* When I upload the very same document (i.e. all .tex files and also the .cls file, exactly as they are on my computer) to Overleaf, everything is fine and the compiled document has all references in English.
I use `TexStudio` to write and I also compile from `TexStudio`. Could it be because of `TexStudio`? What could I change to make sure that nothing is translated?
|
https://tex.stackexchange.com/users/301938
|
How to prevent citation call-outs in natbib from being translated to German?
| true |
I'm not sure why you'd be puzzled by the fact that the `dinat` bibliography style generates citation call-outs with German-language particles, such as "und" and "u.a.", instead of "and" and "et al". After all, that's exactly what the `dinat` bibliography style is programmed to do.
```
\documentclass{article}
\begin{filecontents}[overwrite]{mybib.bib}
@misc{jones-smith:3001,
author = "Anna Jones and Carla Smith",
title = "Thoughts",
year = 3001,
}
@misc{jones-miller-smith:3002,
author = "Anna Jones and Brenda Miller and Carla Smith",
title = "Further Thoughts",
year = 3002,
}
\end{filecontents}
\usepackage{natbib}
\bibliographystyle{dinat}
\begin{document}
\noindent
\citet{jones-smith:3001}, \citep{jones-miller-smith:3002}
\bibliography{mybib}
\end{document}
```
---
In contrast, I am *unable* to reproduce this issue when using the `plainnat` bibliography style. I.e., using the same test document as above but employing `plainnat` instead of `dinat`, I get this outcome:
|
1
|
https://tex.stackexchange.com/users/5001
|
692848
| 321,423 |
https://tex.stackexchange.com/questions/692856
|
1
|
I want to define a pair of delimiters that look like (( and )). According to [this question](https://tex.stackexchange.com/questions/4616/a-symbol-for-the-field-of-formal-laurent-series/4635#4635), I am looking for `U+2E28` and `U+2E29`. However, I have no idea how to use these to define the symbols I want. What I have tried:
```
\usepackage{stickstootext}
\usepackage[stix2,vvarbb]{newtxmath}
\DeclareMathSymbol{\lParen}{\mathopen}{boldsymbols}{"2E28}
\DeclareMathSymbol{\rParen}{\mathclose}{boldsymbols}{"2E29}
```
But what shows are strange symbols rather than I expect.
**P.S.** You can try `$\Big\lParen bla \Big\rParen$` to see why I do not want to simply define
```
\newcommand\lParen{\mathopen{(\!(}}
\newcommand\lParen{\mathclose{)\!)}}
```
|
https://tex.stackexchange.com/users/54169
|
How to define a symbol using its unicode number?
| false |
To appear, and in particular to grow with `\Big`, the font needs to define the character, including a recipe for providing size variants.
U+2E28 is in the `Supplemental Punctuation` block of unusual text punctuation, it is not in any of the opentype math fonts that I tried
You might be able to use U+2985 U+2986
```
\documentclass{article}
\usepackage{unicode-math}
\setmathfont{Stix Two Math}
%\setmathfont{Cambria Math}
\begin{document}
$⦅x⦆ \Biggl⦅x\Biggr⦆$
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/1090
|
692859
| 321,427 |
https://tex.stackexchange.com/questions/692858
|
0
|
I am using the `stmaryrd` package and I have to increase the size of "bag" bracket, but unfortunately the usual commands `\big`, `\Big`, `\biggl`, `\Biggl`, `\left`, `\right` do not work, so that I thought to put a specific question here to ask for a solution: I point out I tried to use what illustrated [here](https://tex.stackexchange.com/a/202753/296807) but unfortunately it does not work.
Hoping the question would be more clear I point out I have written something like this
```
\big\Lbag\Lbag x\Rbag\big\Rbag
```
without fraction into the argument.
The code I am using follows:
```
\documentclass[10pt]{article}
\usepackage[paperheight=29.7cm,paperwidth=21cm,textwidth=17cm,textheight=25 cm]{geometry}
\usepackage{amssymb}
\usepackage{stmaryrd}
\usepackage{amsmath}
\begin{document}
$$
\biggl\Lbag\Lbag x\Rbag\biggl\Rbag
$$
\end{document}
```
|
https://tex.stackexchange.com/users/296807
|
How make bag delimiters more big using stmaryrd package?
| true |
The character isn't defined as extensible in fonts I have seen, but if you really need it you could apply scaling
```
\documentclass[10pt]{article}
\usepackage[paperheight=29.7cm,paperwidth=21cm,textwidth=17cm,textheight=25 cm]{geometry}
\usepackage{amssymb}
\usepackage{stmaryrd,graphicx}
\usepackage{amsmath}
\begin{document}
\[
\mathopen{\scalebox{2}{$\Lbag$}}\Lbag x\Rbag\mathclose{\scalebox{2}{$\Rbag$}}
\]
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/1090
|
692867
| 321,431 |
https://tex.stackexchange.com/questions/692864
|
2
|
I want to merge `\textdelta` and `\,` into one command, called `\tdelta`.
Package: `\usepackage[euler]{textgreek}`
I know that I can use `\let\tdelta\textdelta`, but I also want a space after that (`\,`).
|
https://tex.stackexchange.com/users/287423
|
Merging two commands into one
| true |
(following up on a suggestion I made in a comment...)
>
> I want to merge `\textdelta` and `\,` into one command, called `\tdelta`.
>
>
>
I can suggest
```
\newcommand{\tdelta}{\textdelta\,}
```
|
3
|
https://tex.stackexchange.com/users/5001
|
692869
| 321,432 |
https://tex.stackexchange.com/questions/692866
|
3
|
I'm using the report format and would like to a new date to appear on the right header of each section (I can input these dates manually). My knowledge is very basic, so far I have managed to set this in the preamble but I only know how to produce one date across the entire document (given below), rather than updating in each section.
```
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\today}
```
As an overview, my document will be structured like this to record notes from eight meetings, four in each of two chapters.
-Chapter 1
-Section 1.1 (date 1)
-Section 1.2 (date 2)
-Section 1.3 (date 3)
-Section 1.4 (date 4)
-Chapter 2
-Section 2.1 (date 5)
-Section 2.2 (date 6)
-Section 2.3 (date 7)
-Section 2.4 (date 8)
If someone could provide me with some code that I can use at the beginning of each section where I could input the date, I'd be very grateful.
|
https://tex.stackexchange.com/users/251870
|
New date for every section using fancyhdr
| false |
You can define a variable by using `\def\<variablename>` And then just update the variable with each new section.
Here is an MWE:
```
\documentclass{article}
\begin{document}
\def\kdate{4}
\section{Section 1.1 - \kdate}
\def\kdate{5}
\section{Section 1.2 - \kdate}
\def\kdate{6}
\section{Section 1.3 - \kdate}
\end{document}
```
I've used `kdate` for a variable name. You can use whatever you want, just make sure it doesn't clash with a pre-existing variable or command.
**Edit:**
If you are using the `fancyhdr` package to build your headers, you can add that variable to your `\fancyhead` command:
```
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE,LO]{\kdate}
```
|
2
|
https://tex.stackexchange.com/users/245702
|
692871
| 321,434 |
https://tex.stackexchange.com/questions/692874
|
2
|
I'm creating a set of slides in the beamer environment. The base of the in-line graphic object in
```
$\alpha(\includegraphics[width=0.3in]{T_n-down.eps})=$
```
is displayed above its line of text. How do I lower it so the base of the object sits on the baseline of the text? The margins of the graphic object are trimmed. Thank you in advance.
|
https://tex.stackexchange.com/users/301988
|
Adjusting the vertical position of an in-line graphic object in beamer
| false |
You could use the `adjustbox` package and its `valign=...` key. This allows you to specify various different alignments of the image. For example:
```
\documentclass{beamer}
\usepackage[export]{adjustbox}
\begin{document}
\begin{frame}
$\alpha(\includegraphics[width=0.3in,valign=c]{example-image-duck})=$
\end{frame}
\end{document}
```
Other available values for `valign` are shown in this overview from the [adjustbox documentation](https://texdoc.org/serve/adjustbox/0):
|
2
|
https://tex.stackexchange.com/users/36296
|
692875
| 321,437 |
https://tex.stackexchange.com/questions/692874
|
2
|
I'm creating a set of slides in the beamer environment. The base of the in-line graphic object in
```
$\alpha(\includegraphics[width=0.3in]{T_n-down.eps})=$
```
is displayed above its line of text. How do I lower it so the base of the object sits on the baseline of the text? The margins of the graphic object are trimmed. Thank you in advance.
|
https://tex.stackexchange.com/users/301988
|
Adjusting the vertical position of an in-line graphic object in beamer
| false |
You could encase the `\includegraphics` directive in a `\vcenter{\hbox{...}}` wrapper.
```
\documentclass[demo]{beamer} % remove 'demo' option in real doc.
\begin{document}
\begin{frame}
$\alpha(\includegraphics[width=0.3in]{T_n-down})=$
\quad vs.\ \quad
$\alpha\left(\vcenter{\hbox{\includegraphics[width=0.3in]{T_n-down}}}\right)=$
\end{frame}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/5001
|
692876
| 321,438 |
https://tex.stackexchange.com/questions/692866
|
3
|
I'm using the report format and would like to a new date to appear on the right header of each section (I can input these dates manually). My knowledge is very basic, so far I have managed to set this in the preamble but I only know how to produce one date across the entire document (given below), rather than updating in each section.
```
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\today}
```
As an overview, my document will be structured like this to record notes from eight meetings, four in each of two chapters.
-Chapter 1
-Section 1.1 (date 1)
-Section 1.2 (date 2)
-Section 1.3 (date 3)
-Section 1.4 (date 4)
-Chapter 2
-Section 2.1 (date 5)
-Section 2.2 (date 6)
-Section 2.3 (date 7)
-Section 2.4 (date 8)
If someone could provide me with some code that I can use at the beginning of each section where I could input the date, I'd be very grateful.
|
https://tex.stackexchange.com/users/251870
|
New date for every section using fancyhdr
| true |
I just defined a new command `\datesection` which takes up to 3 arguments:
`\datesection[<short title>]{<section title>}[<date/right header content>]`
* The first 2 (optional and mandatory) are the standard `\section` arguments
* The last/trailing optional argument sets the right header
It also has a starred version, which works like the `\section*` command:
```
\documentclass[]{report}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\usepackage{blindtext}
\NewDocumentCommand{\datesection}{s O{#3} m O{\empty}}{
\IfBooleanTF{#1}{
\section*{#3}
\fancyhead[R]{#4}
}{
\section[#2]{#3}
\fancyhead[R]{#4}
}
}
\begin{document}
\datesection{title}[\today]
\blindtext
\clearpage
\datesection[short title]{longer title}[tomorrow]
\blindtext
\clearpage
\datesection*{title 2}[yesterday]
\blindtext
\end{document}
```
Hope that works for you!
|
3
|
https://tex.stackexchange.com/users/297560
|
692877
| 321,439 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.