Loading...
dotfiles
Plaque
default-project
dotfiles
Create New Project
dotfiles
Plaque
default-project
dotfiles
Create New Project
/
Read-Only
Read-Only Mode
Visitor Mode
readonly-visitor
Read-only mode. You can browse and navigate but editing is disabled. Sign up for full access.
2 CPU
8 GB
1 hour
Sign Up (Free)
Sign In
End Visitor Session
Sign in
Sign up
Toggle Theme
Server Status
Keyboard Shortcuts
Read-Only Mode
Workspace
Chat
Console
Files
Profile
Settings
Sign Out
SciTeX
dotfiles
Ask anything about Scientific Research
Write
Analyze
Code
Literature
Console
Console
Chat
Ask anything about Scientific Research.
I can take actions: stats, plots, literature, and your current work.
LLM Model
STT Model
MCP Tools
--
Loading...
MCP Settings
AI Providers
Claude Code Auto-Accept Mode
Interval
1s (fast)
1.5s
2s
3s (slow)
Safety
Conservative (read-only)
Normal (most commands)
Aggressive (all commands)
Auto-Response Commands
Waiting
Y/N
1 (Allow)
2 (Deny)
Y/Y/N
1 (Allow once)
2 (Allow always)
3 (Deny)
Agent Sources
Loading...
Files
readonly-visitor/dotfiles
Recent
Viewer
Viewer
No file selected
Open a file from the Files tab to view it here
readonly-visitor
/
Plaque
/
scitex
/
writer
/
scripts
/
shell
/
modules
/
add_diff_signature.sh
Edit add_diff_signature.sh
#!/bin/bash # -*- coding: utf-8 -*- # Timestamp: "2025-11-12 (ywatanabe)" # File: ./scripts/shell/modules/add_diff_signature.sh # Description: Add metadata signature to diff TeX files # Logging functions (if not already defined) if ! command -v echo_info &> /dev/null; then GRAY='\033[0;90m' GREEN='\033[0;32m' YELLOW='\033[0;33m' RED='\033[0;31m' NC='\033[0m' echo_info() { echo -e "${GRAY}INFO: $1${NC}"; } echo_success() { echo -e "${GREEN}SUCC: $1${NC}"; } echo_warning() { echo -e "${YELLOW}WARN: $1${NC}"; } echo_error() { echo -e "${RED}ERRO: $1${NC}"; } fi add_diff_signature() { local diff_tex_file="$1" local old_version="$2" local new_version="$3" if [ ! -f "$diff_tex_file" ]; then echo_warning " Diff TeX file not found: $diff_tex_file" return 1 fi echo_info " Adding signature to diff document..." # Create signature block local signature=" %% ============================================================================= %% Diff Document Metadata (Auto-generated) %% ============================================================================= %% Comparison: v${old_version} → v${new_version} %% Generated: $(date '+%Y-%m-%d %H:%M:%S') %% User: $(git config user.name 2>/dev/null || echo 'unknown') <$(git config user.email 2>/dev/null || echo 'unknown')> %% Document: ${SCITEX_WRITER_DOC_TYPE} %% Git commit: $(git rev-parse --short HEAD 2>/dev/null || echo 'unknown') %% Git branch: $(git branch --show-current 2>/dev/null || echo 'unknown') %% ============================================================================= " # Add signature header at the beginning of the document (after \documentclass) # This will appear in the PDF as metadata and can be seen in the source # Find the first \begin{document} and insert signature before it local temp_file="${diff_tex_file}.tmp" awk -v sig="$signature" ' /\\begin\{document\}/ { print sig } { print } ' "$diff_tex_file" > "$temp_file" mv "$temp_file" "$diff_tex_file" # Also add visible signature in the PDF footer (optional) # Add to preamble before \begin{document} # Use cat with heredoc to avoid AWK escape sequence issues local temp_file="${diff_tex_file}.tmp" # Find the line number of \begin{document} local begin_doc_line=$(grep -n '\\begin{document}' "$diff_tex_file" | head -1 | cut -d: -f1) if [ -n "$begin_doc_line" ]; then # Insert signature before \begin{document} { head -n $((begin_doc_line - 1)) "$diff_tex_file" cat << EOF \\usepackage{fancyhdr} \\usepackage{lastpage} \\fancypagestyle{diffstyle}{ \\fancyhf{} \\renewcommand{\\headrulewidth}{0.4pt} \\renewcommand{\\footrulewidth}{0.4pt} \\fancyhead[L]{\\small\\textit{Diff: v${old_version} → v${new_version}}} \\fancyhead[R]{\\small\\textit{${SCITEX_WRITER_DOC_TYPE}}} \\fancyfoot[L]{\\small Generated: $(date '+%Y-%m-%d %H:%M')} \\fancyfoot[C]{\\small Page \\thepage\\ of \\pageref{LastPage}} \\fancyfoot[R]{\\small $(git config user.name 2>/dev/null || echo 'Auto-generated')} } \\AtBeginDocument{\\pagestyle{diffstyle}} EOF tail -n +$begin_doc_line "$diff_tex_file" } > "$temp_file" mv "$temp_file" "$diff_tex_file" fi echo_success " Diff signature added (header + footer metadata)" } # Export function for use in other scripts export -f add_diff_signature # EOF